Browse Source

bufix and integration fix for real api

Skylsmoi 5 years ago
parent
commit
1a89fc318d

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

@@ -10,11 +10,11 @@ const PopupCreateContent = props => {
10 10
       <div className='createcontent'>
11 11
         <div className='createcontent__contentname mb-4'>
12 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 14
           </div>
15 15
 
16 16
           <div className='createcontent__contentname__title' style={{color: props.color}}>
17
-            {props.title}
17
+            {props.label}
18 18
           </div>
19 19
         </div>
20 20
 
@@ -28,8 +28,8 @@ const PopupCreateContent = props => {
28 28
 
29 29
           <div className='createcontent__form__button'>
30 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 32
               className='createcontent__form__button btn btn-primary'
32
-              type='submit'
33 33
               onClick={props.onValidate}
34 34
             >
35 35
               {props.btnValidateLabel}
@@ -46,14 +46,15 @@ PopupCreateContent.propTypes = {
46 46
   onValidate: PropTypes.func.isRequired,
47 47
   contentName: PropTypes.string.isRequired,
48 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 52
   btnValidateLabel: PropTypes.string
52 53
 }
53 54
 
54 55
 PopupCreateContent.defaultProps = {
55
-  title: '',
56
-  color: '#333',
56
+  label: '',
57
+  hexcolor: '#333',
57 58
   inputPlaceHolder: '',
58 59
   btnValidateLabel: ''
59 60
 }

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

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

+ 1 - 1
src/helper.js View File

@@ -12,6 +12,6 @@ export const libHandleFetchResult = fetchResult => {
12 12
     case 502:
13 13
     case 503:
14 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
 }