Browse Source

added component CardPopup + added route for WIP component + begin integration of Home component

Skylsmoi 6 years ago
parent
commit
f760c4d970

+ 0 - 31
src/component/HomepageCard/HomepageCard.jsx View File

1
-import React, { Component } from 'react'
2
-import LogoHomepage from '../../img/logoHeader.svg'
3
-
4
-class HomepageCard extends Component {
5
-  render () {
6
-    return (
7
-      <div className='card homepagecard'>
8
-        <div className='card-body homepagecard__body'>
9
-          <div className='homepagecard__title text-center my-4'>
10
-            Bienvenue sur Tracim
11
-          </div>
12
-          <div className='homepagecard__thanks text-center'>
13
-            Merci de nous faire confiance et d'utiliser notre outil collaboratif
14
-          </div>
15
-          <div className='homepagecard__delimiter delimiter' />
16
-          <div className='homepagecard__text text-center mb-5'>
17
-            Vous allez créez votre premier espace de travail
18
-          </div>
19
-          <div className='homepagecard__btn btn btn-outline-primary'>
20
-            Créer votre espace de travail
21
-          </div>
22
-          <div className='homepagecard__logo mt-5 mb-3'>
23
-            <img src={LogoHomepage} alt='logo homepage' />
24
-          </div>
25
-        </div>
26
-      </div>
27
-    )
28
-  }
29
-}
30
-
31
-export default HomepageCard

+ 54 - 0
src/component/common/CardPopup/CardPopup.jsx View File

1
+import React from 'react'
2
+import PropTypes from 'prop-types'
3
+import classnames from 'classnames'
4
+
5
+require('./CardPopup.styl')
6
+
7
+const CardPopup = props => {
8
+  return (
9
+    <div className={classnames(props.customClass, 'cardPopup')}>
10
+      <div className='cardPopup__container'>
11
+        <div className='cardPopup__header' />
12
+
13
+        <div className='nopadding'>
14
+          <div className='cardPopup__close' onClick={props.onClose}>
15
+            <i className='fa fa-times' />
16
+          </div>
17
+
18
+          <div className='cardPopup__body'>
19
+            <div className='cardPopup__body__icon'>
20
+              <i className={props.icon} />
21
+            </div>
22
+
23
+            <div className='cardPopup__body__text'>
24
+              <div className='cardPopup__body__text__title'>
25
+                {props.title}
26
+              </div>
27
+              <div className='cardPopup__body__text__message'>
28
+                {props.message}
29
+              </div>
30
+            </div>
31
+          </div>
32
+        </div>
33
+      </div>
34
+    </div>
35
+  )
36
+}
37
+
38
+export default CardPopup
39
+
40
+CardPopup.propTypes = {
41
+  customClass: PropTypes.string,
42
+  title: PropTypes.string,
43
+  message: PropTypes.string,
44
+  icon: PropTypes.string,
45
+  onClose: PropTypes.func
46
+}
47
+
48
+CardPopup.defaultProps = {
49
+  customClass: 'defaultCustomClass',
50
+  title: 'Default title',
51
+  message: 'Default message',
52
+  icon: 'fa fa-times-circle',
53
+  onClose: () => {}
54
+}

+ 39 - 0
src/component/common/CardPopup/CardPopup.styl View File

1
+@import '../../../css/Variable.styl'
2
+
3
+.cardPopup
4
+  position fixed
5
+  display flex
6
+  justify-content center
7
+  width 100%
8
+  z-index 10
9
+  &__container
10
+    margin-top 50px
11
+    border 0
12
+    border-radius 10px
13
+    width 800px
14
+    background lightGrey
15
+    box-shadow shadow-all
16
+  &__header
17
+    border-top-right-radius 10px
18
+    border-top-left-radius 10px
19
+    width 100%
20
+    height 8px
21
+  &__close
22
+    display flex
23
+    justify-content flex-end
24
+    margin 5px
25
+    cursor pointer
26
+  &__body
27
+    display flex
28
+    align-items center
29
+    margin 10px 0 25px 0
30
+    &__icon
31
+      padding 0 30px
32
+      font-size 40px
33
+    &__text
34
+      &__title
35
+        font-size 20px
36
+        font-weight 600
37
+      &__message
38
+        padding-right 20px
39
+        font-weight 500

+ 34 - 10
src/container/Home.jsx View File

1
-import React from 'react'
2
-import { connect } from 'react-redux'
1
+import React, { Component } from 'react'
2
+import Card from '../component/common/Card/Card.jsx'
3
+import CardHeader from '../component/common/Card/CardHeader.jsx'
4
+import CardBody from '../component/common/Card/CardBody.jsx'
5
+import LogoHomepage from '../img/logoHeader.svg'
3
 
6
 
4
-class Home extends React.Component {
7
+class Home extends Component {
5
   render () {
8
   render () {
6
-    const { user } = this.props
7
     return (
9
     return (
8
-      <div>
9
-        Home.<br />
10
-        User logged in : {user.logged.toString()}
11
-      </div>
10
+      <section className='homepage'>
11
+        <div className='container-fluid nopadding'>
12
+          <Card customClass='homepagecard'>
13
+            <CardHeader /> {/* @TODO fix architecture of this component */}
14
+            <CardBody customClass='homepagecard'>
15
+              <div>
16
+                <div className='homepagecard__title text-center my-4'>
17
+                  Bienvenue sur Tracim
18
+                </div>
19
+                <div className='homepagecard__thanks text-center'>
20
+                  Merci de nous faire confiance et d'utiliser notre outil collaboratif
21
+                </div>
22
+                <div className='homepagecard__delimiter delimiter' />
23
+                <div className='homepagecard__text text-center mb-5'>
24
+                  Vous allez créez votre premier espace de travail
25
+                </div>
26
+                <div className='homepagecard__btn btn btn-outline-primary'>
27
+                  Créer votre espace de travail
28
+                </div>
29
+                <div className='homepagecard__logo mt-5 mb-3'>
30
+                  <img src={LogoHomepage} alt='logo homepage' />
31
+                </div>
32
+              </div>
33
+            </CardBody>
34
+          </Card>
35
+        </div>
36
+      </section>
12
     )
37
     )
13
   }
38
   }
14
 }
39
 }
15
 
40
 
16
-const mapStateToProps = ({ user }) => ({ user })
17
-export default connect(mapStateToProps)(Home)
41
+export default Home

+ 0 - 16
src/container/Homepage.jsx View File

1
-import React, { Component } from 'react'
2
-import HomepageCard from '../Component/HomepageCard/HomepageCard.jsx'
3
-
4
-class Homepage extends Component {
5
-  render () {
6
-    return (
7
-      <section className='homepage'>
8
-        <div className='container-fluid nopadding'>
9
-          <HomepageCard />
10
-        </div>
11
-      </section>
12
-    )
13
-  }
14
-}
15
-
16
-export default Homepage

+ 37 - 4
src/container/PopupCreateContainer.jsx View File

1
 import React, { Component } from 'react'
1
 import React, { Component } from 'react'
2
-import GenericContent from '../Component/PopupContent/GenericContent.jsx'
3
-import FileContent from '../Component/PopupContent/FileContent.jsx'
4
-import WksContent from '../Component/PopupContent/WksContent.jsx'
2
+// import GenericContent from '../component/PopupContent/GenericContent.jsx'
3
+import FileContent from '../component/PopupContent/FileContent.jsx'
4
+// import WksContent from '../component/PopupContent/WksContent.jsx'
5
 
5
 
6
 class PopupCreateContainer extends Component {
6
 class PopupCreateContainer extends Component {
7
   render () {
7
   render () {
10
         <div className='popupcontent__container card'>
10
         <div className='popupcontent__container card'>
11
           <div className='popupcontent__container__header' />
11
           <div className='popupcontent__container__header' />
12
           <div className='card-body nopadding'>
12
           <div className='card-body nopadding'>
13
-            <FileContent />
13
+            <div className='filecontent p-3'>
14
+              <div className='filecontent__close d-flex justify-content-end'>
15
+                <i className='fa fa-times' />
16
+              </div>
17
+              <div className='filecontent__contentname d-flex align-items-center mb-4'>
18
+                <div className='filecontent__contentname__icon mr-3'>
19
+                  <i className='fa fa-file-text-o' />
20
+                </div>
21
+                <div className='filecontent__contentname__title'>
22
+                  Fichier de prévisualisation
23
+                </div>
24
+              </div>
25
+
26
+              <div className='filecontent__text'>Importer votre fichier :</div>
27
+              <div className='filecontent__form mb-4' drop='true'>
28
+                <div className='filecontent__form__icon d-flex justify-content-center'>
29
+                  <label htmlFor='filecontentUpload' type='file'>
30
+                    <i className='fa fa-download' />
31
+                  </label>
32
+                  <input type='file' className='d-none' id='filecontentUpload' />
33
+                </div>
34
+                <div className='filecontent__form__instruction text-center'>
35
+                  Glisser votre fichier ici
36
+                </div>
37
+                <div className='filecontent__form__text text-center'>
38
+                  Vous pouvez également importer votre fichier en cliquant sur l'icon
39
+                </div>
40
+              </div>
41
+              <div className='filecontent__button d-flex justify-content-end'>
42
+                <button className='filecontent__form__button btn btn-outline-primary'>
43
+                  Créer et Valider
44
+                </button>
45
+              </div>
46
+            </div>
14
           </div>
47
           </div>
15
         </div>
48
         </div>
16
       </div>
49
       </div>

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

8
 import Account from './Account.jsx'
8
 import Account from './Account.jsx'
9
 import FlashMessage from '../component/FlashMessage.jsx'
9
 import FlashMessage from '../component/FlashMessage.jsx'
10
 import WorkspaceContent from './WorkspaceContent.jsx'
10
 import WorkspaceContent from './WorkspaceContent.jsx'
11
+import WIPcomponent from './WIPcomponent.jsx'
11
 import {
12
 import {
12
   Route,
13
   Route,
13
   withRouter
14
   withRouter
59
               <PrivateRoute path={`${PAGE_NAME.WS_CONTENT}/:idws/:filter?`} component={WorkspaceContent} />
60
               <PrivateRoute path={`${PAGE_NAME.WS_CONTENT}/:idws/:filter?`} component={WorkspaceContent} />
60
               <PrivateRoute exact path={PAGE_NAME.ACCOUNT} component={Account} />
61
               <PrivateRoute exact path={PAGE_NAME.ACCOUNT} component={Account} />
61
               <PrivateRoute exact path={PAGE_NAME.DASHBOARD} component={Dashboard} />
62
               <PrivateRoute exact path={PAGE_NAME.DASHBOARD} component={Dashboard} />
63
+              <PrivateRoute path={'/wip/:cp'} component={WIPcomponent} />
62
 
64
 
63
               <Footer />
65
               <Footer />
64
             </div>
66
             </div>

+ 30 - 0
src/container/WIPcomponent.jsx View File

1
+import React from 'react'
2
+import { connect } from 'react-redux'
3
+import PopupCreateContainer from './PopupCreateContainer.jsx'
4
+import ProgressBar from './ProgressBar.jsx'
5
+import Home from './Home.jsx'
6
+import CardPopup from '../component/common/CardPopup/CardPopup.jsx'
7
+
8
+export class WIPcomponent extends React.Component {
9
+  render () {
10
+    const MyComponent = {
11
+      PopupCreateContainer,
12
+      ProgressBar,
13
+      Home,
14
+      CardPopup
15
+    }
16
+
17
+    // this.props.dispatch(newFlashMessage('TEST', 'info', 0))
18
+
19
+    const ComponentToDisplay = MyComponent[this.props.match.params.cp]
20
+
21
+    return (
22
+      <div>
23
+        <ComponentToDisplay />
24
+      </div>
25
+    )
26
+  }
27
+}
28
+
29
+const mapStateToProps = () => ({})
30
+export default connect(mapStateToProps)(WIPcomponent)