Browse Source

bufix and integration fix for real api

Skylsmoi 6 years ago
parent
commit
1a89fc318d

+ 8 - 7
src/component/CardPopup/CardPopupCreateContent.jsx View File

10
       <div className='createcontent'>
10
       <div className='createcontent'>
11
         <div className='createcontent__contentname mb-4'>
11
         <div className='createcontent__contentname mb-4'>
12
           <div className='createcontent__contentname__icon ml-1 mr-3'>
12
           <div className='createcontent__contentname__icon ml-1 mr-3'>
13
-            <i className={`fa ${props.icon}`} style={{color: props.color}} />
13
+            <i className={`fa fa-${props.faIcon}`} style={{color: props.color}} />
14
           </div>
14
           </div>
15
 
15
 
16
           <div className='createcontent__contentname__title' style={{color: props.color}}>
16
           <div className='createcontent__contentname__title' style={{color: props.color}}>
17
-            {props.title}
17
+            {props.label}
18
           </div>
18
           </div>
19
         </div>
19
         </div>
20
 
20
 
28
 
28
 
29
           <div className='createcontent__form__button'>
29
           <div className='createcontent__form__button'>
30
             <button
30
             <button
31
+              type='button' // do neither remove this nor set it to 'submit' otherwise clicking the btn will submit the form and reload the page
31
               className='createcontent__form__button btn btn-primary'
32
               className='createcontent__form__button btn btn-primary'
32
-              type='submit'
33
               onClick={props.onValidate}
33
               onClick={props.onValidate}
34
             >
34
             >
35
               {props.btnValidateLabel}
35
               {props.btnValidateLabel}
46
   onValidate: PropTypes.func.isRequired,
46
   onValidate: PropTypes.func.isRequired,
47
   contentName: PropTypes.string.isRequired,
47
   contentName: PropTypes.string.isRequired,
48
   onChangeContentName: PropTypes.func.isRequired,
48
   onChangeContentName: PropTypes.func.isRequired,
49
-  title: PropTypes.string,
50
-  color: PropTypes.string,
49
+  label: PropTypes.string,
50
+  hexcolor: PropTypes.string,
51
+  faIcon: PropTypes.string,
51
   btnValidateLabel: PropTypes.string
52
   btnValidateLabel: PropTypes.string
52
 }
53
 }
53
 
54
 
54
 PopupCreateContent.defaultProps = {
55
 PopupCreateContent.defaultProps = {
55
-  title: '',
56
-  color: '#333',
56
+  label: '',
57
+  hexcolor: '#333',
57
   inputPlaceHolder: '',
58
   inputPlaceHolder: '',
58
   btnValidateLabel: ''
59
   btnValidateLabel: ''
59
 }
60
 }

+ 1 - 1
src/component/PopinFixed/PopinFixedHeader.jsx View File

20
     return (
20
     return (
21
       <div className={classnames('wsContentGeneric__header', `${customClass}__header`)}>
21
       <div className={classnames('wsContentGeneric__header', `${customClass}__header`)}>
22
         <div className={classnames('wsContentGeneric__header__icon', `${customClass}__header__icon`)}>
22
         <div className={classnames('wsContentGeneric__header__icon', `${customClass}__header__icon`)}>
23
-          <i className={icon} />
23
+          <i className={`fa fa-${icon}`} />
24
         </div>
24
         </div>
25
 
25
 
26
         <div className={classnames('wsContentGeneric__header__title mr-auto', `${customClass}__header__title`)}>
26
         <div className={classnames('wsContentGeneric__header__title mr-auto', `${customClass}__header__title`)}>

+ 1 - 1
src/helper.js View File

12
     case 502:
12
     case 502:
13
     case 503:
13
     case 503:
14
     case 504:
14
     case 504:
15
-      return `Error: ${fetchResult.status}` // @TODO : handle errors from api result
15
+      return new Promise((resolve, reject) => reject(fetchResult)) // @TODO : handle errors from api result
16
   }
16
   }
17
 }
17
 }