Browse Source

added proper color management

Skylsmoi 5 years ago
parent
commit
0d4a7ff24f
4 changed files with 28 additions and 58 deletions
  1. 2 0
      src/container/PopupCreateThread.jsx
  2. 22 6
      src/container/Thread.jsx
  3. 3 51
      src/css/index.styl
  4. 1 1
      src/helper.js

+ 2 - 0
src/container/PopupCreateThread.jsx View File

@@ -65,6 +65,8 @@ class PopupCreateHtmlDocument extends React.Component {
65 65
         if (resSave.apiResponse.status === 200) {
66 66
           this.handleClose()
67 67
 
68
+          GLOBAL_dispatchEvent({ type: 'refreshContentList', data: {} })
69
+
68 70
           GLOBAL_dispatchEvent({
69 71
             type: 'openContentUrl', // handled by tracim_front:src/container/WorkspaceContent.jsx
70 72
             data: {

+ 22 - 6
src/container/Thread.jsx View File

@@ -110,8 +110,12 @@ class Thread extends React.Component {
110 110
 
111 111
     handleFetchResult(await fetchResultSaveThread)
112 112
       .then(resSave => {
113
-        if (resSave.apiResponse.status === 200) this.loadContent()
114
-        else console.warn('Error saving threads. Result:', resSave, 'content:', content, 'config:', config)
113
+        if (resSave.apiResponse.status === 200) {
114
+          this.loadContent()
115
+          GLOBAL_dispatchEvent({ type: 'refreshContentList', data: {} })
116
+        } else {
117
+          console.warn('Error saving threads. Result:', resSave, 'content:', content, 'config:', config)
118
+        }
115 119
       })
116 120
   }
117 121
 
@@ -164,16 +168,24 @@ class Thread extends React.Component {
164 168
     if (!isVisible) return null
165 169
 
166 170
     return (
167
-      <PopinFixed customClass={`wsContentThread`}>
171
+      <PopinFixed
172
+        customClass={config.slug}
173
+        customColor={config.hexcolor}
174
+      >
168 175
         <PopinFixedHeader
169
-          customClass={`wsContentThread`}
176
+          customClass={`${config.slug}__contentpage`}
177
+          customColor={config.hexcolor}
170 178
           faIcon={config.faIcon}
171 179
           title={content.label}
172 180
           onClickCloseBtn={this.handleClickBtnCloseApp}
173 181
           onValidateChangeTitle={this.handleSaveEditTitle}
174 182
         />
175 183
 
176
-        <PopinFixedOption customClass={`wsContentThread`} i18n={i18n}>
184
+        <PopinFixedOption
185
+          customClass={`${config.slug}__contentpage`}
186
+          customColor={config.hexcolor}
187
+          i18n={i18n}
188
+        >
177 189
           <div className='justify-content-end'>
178 190
             <SelectStatus
179 191
               selectedStatus={config.availableStatuses.find(s => s.slug === content.status)}
@@ -183,6 +195,7 @@ class Thread extends React.Component {
183 195
             />
184 196
 
185 197
             <ArchiveDeleteContent
198
+              customColor={config.hexcolor}
186 199
               onClickArchiveBtn={this.handleClickArchive}
187 200
               onClickDeleteBtn={this.handleClickDelete}
188 201
               disabled={false}
@@ -190,9 +203,12 @@ class Thread extends React.Component {
190 203
           </div>
191 204
         </PopinFixedOption>
192 205
 
193
-        <PopinFixedContent customClass={`${config.customClass}__contentpage`}>
206
+        <PopinFixedContent
207
+          customClass={`${config.slug}__contentpage`}
208
+        >
194 209
           <Timeline
195 210
             customClass={`${config.slug}__contentpage`}
211
+            customColor={config.hexcolor}
196 212
             loggedUser={loggedUser}
197 213
             timelineData={listMessage}
198 214
             newComment={newComment}

+ 3 - 51
src/css/index.styl View File

@@ -1,14 +1,8 @@
1 1
 @import "../../node_modules/tracim_lib/src/css/Variable.styl"
2 2
 
3
-btnState()
4
-  background-color darkenThread
5
-  color off-white
6
-
7
-.wsContentThread
3
+.thread
8 4
   width 1100px
9 5
   &__header
10
-    // color white
11
-    background-color threadColor
12 6
     &__editionmode
13 7
       display none
14 8
     &__icon
@@ -16,60 +10,18 @@ btnState()
16 10
         color white
17 11
   .selectStatus
18 12
     margin-right 15px
19
-    .dropdown-item
20
-      &:hover, &:focus, &:active, &visited, &:focus-within
21
-        background-color threadColor
22
-        color off-white!important // @FIXME 04/07/2018 AC - we must use a plugin for this
23
-  .optionicon
24
-    &:hover, &:focus, &:active
25
-      color threadColor
26 13
   .timeline
27 14
     margin 0
28 15
   .thread
29 16
     &__contentpage
17
+      &__content
18
+        width 100%
30 19
       &__messagelist
31 20
         &__item__avatar
32 21
           border 1px solid darkenThread
33 22
           background-color off-white
34 23
       &__texteditor
35 24
         flex 0 0 auto
36
-        &__advancedtext
37
-          &__btn
38
-            color fontColor
39
-            border-color threadColor
40
-            cursor pointer
41
-            &:hover ,&:focus, &:visited, &:active
42
-              btnState()
43
-              border-color darkenThread
44
-              box-shadow none
45
-        &__submit
46
-          &__btn
47
-            background-color threadColor
48
-            color white
49
-            &:hover, &:focus, &:visited, &:active
50
-              background-color darkenThread
51
-
52
-
53
-.received
54
-  .timeline__messagelist__item__content
55
-    background-color threadColor
56
-
57
-.popupCreateContent
58
-  .cardPopup
59
-    &__header
60
-      background-color threadColor
61
-  .createcontent
62
-    &__contentname
63
-      color threadColor
64
-    &__form
65
-      &__button
66
-        & > button
67
-          border-color threadColor
68
-          background-color threadColor
69
-          &:hover, &:active, &:visited &:focus
70
-            background-color darkenThread
71
-            box-shadow none
72
-
73 25
 
74 26
 @media (min-width: min-lg) and (max-width: max-lg)
75 27
   .wsContentThread

+ 1 - 1
src/helper.js View File

@@ -10,7 +10,7 @@ export const debug = { // copied from html-documents => outdated
10 10
     label: 'Thread',
11 11
     slug: 'thread',
12 12
     faIcon: 'comments-o',
13
-    hexcolor: '#65c7f2',
13
+    hexcolor: '#ad4cf9',
14 14
     creationLabel: 'Write a thread',
15 15
     domContainer: 'appContainer',
16 16
     apiUrl: 'http://localhost:6543/api/v2',