Selaa lähdekoodia

added proper color management + comment about better handling of custom events

Skylsmoi 6 vuotta sitten
vanhempi
commit
7697493a11
4 muutettua tiedostoa jossa 26 lisäystä ja 77 poistoa
  1. 1 0
      src/component/HtmlDocument.jsx
  2. 19 4
      src/container/HtmlDocument.jsx
  3. 0 71
      src/css/index.styl
  4. 6 2
      src/index.js

+ 1 - 0
src/component/HtmlDocument.jsx Näytä tiedosto

@@ -25,6 +25,7 @@ const HtmlDocument = props => {
25 25
         <TextAreaApp
26 26
           id={props.wysiwygNewVersion}
27 27
           customClass={'html-documents__editionmode'}
28
+          customColor={props.customColor}
28 29
           onClickCancelBtn={props.onClickCloseEditMode}
29 30
           onClickValidateBtn={props.onClickValidateBtn}
30 31
           text={props.text}

+ 19 - 4
src/container/HtmlDocument.jsx Näytä tiedosto

@@ -278,23 +278,35 @@ class HtmlDocument extends React.Component {
278 278
     if (!isVisible) return null
279 279
 
280 280
     return (
281
-      <PopinFixed customClass={`${config.slug}`}>
281
+      <PopinFixed
282
+        customClass={`${config.slug}`}
283
+        customColor={config.hexcolor}
284
+      >
282 285
         <PopinFixedHeader
283 286
           customClass={`${config.slug}`}
287
+          customColor={config.hexcolor}
284 288
           faIcon={config.faIcon}
285 289
           title={content.label}
286 290
           onClickCloseBtn={this.handleClickBtnCloseApp}
287 291
           onValidateChangeTitle={this.handleSaveEditTitle}
288 292
         />
289 293
 
290
-        <PopinFixedOption customClass={`${config.slug}`} i18n={i18n}>
294
+        <PopinFixedOption
295
+          customColor={config.hexcolor}
296
+          customClass={`${config.slug}`}
297
+          i18n={i18n}
298
+        >
291 299
           <div /* this div in display flex, justify-content space-between */>
292 300
             <div className='d-flex'>
293
-              <NewVersionBtn onClickNewVersionBtn={this.handleClickNewVersion} disabled={mode !== MODE.VIEW} />
301
+              <NewVersionBtn
302
+                customColor={config.hexcolor}
303
+                onClickNewVersionBtn={this.handleClickNewVersion}
304
+                disabled={mode !== MODE.VIEW}
305
+              />
294 306
 
295 307
               {mode === MODE.REVISION &&
296 308
                 <button
297
-                  className='wsContentGeneric__option__menu__lastversion html-documents__lastversionbtn btn btn-default'
309
+                  className='wsContentGeneric__option__menu__lastversion html-documents__lastversionbtn btn'
298 310
                   onClick={this.handleClickLastVersion}
299 311
                   style={{backgroundColor: config.hexcolor, color: '#fdfdfd'}}
300 312
                 >
@@ -313,6 +325,7 @@ class HtmlDocument extends React.Component {
313 325
               />
314 326
 
315 327
               <ArchiveDeleteContent
328
+                customColor={config.hexcolor}
316 329
                 onClickArchiveBtn={this.handleClickArchive}
317 330
                 onClickDeleteBtn={this.handleClickDelete}
318 331
                 disabled={mode === MODE.REVISION}
@@ -327,6 +340,7 @@ class HtmlDocument extends React.Component {
327 340
         >
328 341
           <HtmlDocumentComponent
329 342
             mode={mode}
343
+            customColor={config.hexcolor}
330 344
             wysiwygNewVersion={'wysiwygNewVersion'}
331 345
             onClickCloseEditMode={this.handleCloseNewVersion}
332 346
             onClickValidateBtn={this.handleSaveHtmlDocument}
@@ -339,6 +353,7 @@ class HtmlDocument extends React.Component {
339 353
 
340 354
           <Timeline
341 355
             customClass={`${config.slug}__contentpage`}
356
+            customColor={config.hexcolor}
342 357
             loggedUser={loggedUser}
343 358
             timelineData={timeline}
344 359
             newComment={newComment}

+ 0 - 71
src/css/index.styl Näytä tiedosto

@@ -1,54 +1,18 @@
1 1
 @import "../../node_modules/tracim_lib/src/css/Variable.styl"
2 2
 
3
-btncolor()
4
-  background-color htmlColor
5
-  color off-white
6
-
7
-btnState()
8
-  background-color darkHtmlColor
9
-  color off-white
10
-
11 3
 .html-documents
12 4
   width 70%
13 5
   &__header
14
-    background-color htmlColor
15 6
     &__editionmode
16 7
       display none
17 8
     &__icon
18 9
       .fa-file-text-o
19 10
         color white
20
-  .newversionbtn
21
-    border-color htmlColor
22
-    color fontColor
23
-    &:hover, &:focus, &:visited, &:active
24
-      btnState()
25
-      border-color darkHtmlColor
26
-      box-shadow none
27 11
   &__lastversionbtn
28 12
     & > i
29 13
       font-size 20px
30
-  .optionicon
31
-    &:hover, &:focus, &:active
32
-      color htmlColor
33 14
   .selectStatus
34 15
     margin-right 15px
35
-    .dropdown-item
36
-      &:hover, &:focus, &:active, &visited, &:focus-within
37
-        background-color htmlColor
38
-        color off-white!important // @FIXME 04/07/2018 AC - we must use a plugin for this
39
-  &__editionmode
40
-    &__cancel
41
-      border-color htmlColor
42
-      color htmlColor
43
-      &:hover, &:focus, &:active, &:visited, &focus-within
44
-        border-color htmlColor
45
-        btncolor()
46
-    &__submit
47
-      border-color htmlColor
48
-      color htmlColor
49
-      &:hover, &:focus, &:active, &:visited, &focus-within
50
-        border-color htmlColor
51
-        btncolor()
52 16
   &__contentpage
53 17
     &__textnote
54 18
       margin 10px 5px 10px 10px
@@ -86,31 +50,13 @@ btnState()
86 50
           width 145px
87 51
           color white
88 52
           font-size 17px
89
-          background-color htmlColor
90 53
           & > i
91 54
             margin-right 10px
92 55
             color darkGrey
93 56
             font-size 20px
94
-          &:hover, &:focus
95
-            btnState()
96 57
         &__date
97 58
           color fontColor
98 59
           font-size 17px
99
-    &__texteditor
100
-      &__advancedtext
101
-        &__btn
102
-          color fontColor
103
-          border-color htmlColor
104
-          &:hover ,&:focus, &:visited, &:active
105
-            btnState()
106
-            border-color darkHtmlColor
107
-            box-shadow none
108
-      &__submit
109
-        &__btn
110
-          background-color htmlColor
111
-          color white
112
-          &:hover, &:focus, &:visited, &:active
113
-            background-color darkHtmlColor
114 60
 
115 61
 .messagelistOpen
116 62
   .timeline__messagelist
@@ -121,23 +67,6 @@ btnState()
121 67
   .timeline__messagelist__item__content
122 68
     background-color htmlColor
123 69
 
124
-.popupCreateContent
125
-  .cardPopup
126
-    &__header
127
-      background-color htmlColor
128
-  .createcontent
129
-    &__contentname
130
-      color htmlColor
131
-    &__form
132
-      &__button
133
-        & > button
134
-          border-color htmlColor
135
-          background-color htmlColor
136
-          &:hover, &:active, &:visited &:focus
137
-            background-color darkHtmlColor
138
-            box-shadow none
139
-
140
-
141 70
 @media (min-width: min-sm) and (max-width: max-lg)
142 71
   .html-documents
143 72
     &__contentpage

+ 6 - 2
src/index.js Näytä tiedosto

@@ -2,13 +2,17 @@ import React from 'react'
2 2
 import ReactDOM from 'react-dom'
3 3
 import HtmlDocument from './container/HtmlDocument.jsx'
4 4
 import PopupCreateHtmlDocument from './container/PopupCreateHtmlDocument.jsx'
5
+// @TODO make a file that contains all events implemented by this App.
6
+// @todo add this file to appInterface
7
+// @todo app shall make it's customReducer from the events of this app
8
+// so it will be testable by tracim_frontend
5 9
 
6 10
 require('./css/index.styl')
7 11
 
8 12
 const appInterface = {
9 13
   name: 'HtmlDocument',
10 14
   isRendered: false,
11
-  renderApp: data => {
15
+  renderApp: data => { // renderAppFull
12 16
     return ReactDOM.render(
13 17
       <HtmlDocument data={data} />
14 18
       , document.getElementById(data.config.domContainer)
@@ -17,7 +21,7 @@ const appInterface = {
17 21
   unmountApp: domId => {
18 22
     return ReactDOM.unmountComponentAtNode(document.getElementById(domId)) // returns bool
19 23
   },
20
-  renderPopupCreation: data => {
24
+  renderPopupCreation: data => { // renderAppPopupCreation
21 25
     return ReactDOM.render(
22 26
       <PopupCreateHtmlDocument data={data} />
23 27
       , document.getElementById(data.config.domContainer)