-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Images uploaded to cloudinary on onChange Modal function - Db retieved from cloudinary ready to be used in the onClick method - ProgressBar changed to use props - ImageReducer implemented and added to rootReducer
- Loading branch information
Benny Ogidan
authored and
Benny Ogidan
committed
Nov 16, 2017
1 parent
7239071
commit dba365f
Showing
12 changed files
with
296 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import request from 'superagent'; | ||
import { showErrorNotification } from './notifications'; | ||
|
||
import { | ||
UPLOAD_TO_CLOUD_IMAGE_SUCCESS, | ||
UPLOAD_TO_CLOUD_IMAGE_FAILURE, | ||
CLOUDINARY_UPLOAD_PRESET, | ||
CLOUDINARY_UPLOAD_URL | ||
} from './actiontype'; | ||
|
||
|
||
|
||
export const UploadImageToCloud = response => ({ type: UPLOAD_TO_CLOUD_IMAGE_SUCCESS, response }); | ||
export const UploadImageToCloudFailure = error => ({ type: UPLOAD_TO_CLOUD_IMAGE_FAILURE, error }); | ||
|
||
export const imageUploadToCloud = (username, imageData) => (dispatch) => | ||
{ | ||
|
||
|
||
return request.post(CLOUDINARY_UPLOAD_URL) | ||
.field({'upload_preset': CLOUDINARY_UPLOAD_PRESET}) | ||
.field('file', imageData) | ||
.field('public_id',`${username}`) | ||
.then((response)=>{ | ||
dispatch(UploadImageToCloud(response.body)) | ||
return (response.body) | ||
}).catch(error=>{ | ||
UploadImageToCloudFailure(error) | ||
}); | ||
} | ||
|
||
|
||
// export const imageUploadToDb = ()=> (dispatch)=> | ||
// { | ||
|
||
// } | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
client/src/app/components/presentation/common/Preloader/ShowProgressBar.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
import {Col, Row, ProgressBar} from 'react-materialize'; | ||
|
||
const ShowProgressBar = () => ( | ||
<Row> | ||
|
||
<Col l={4} s={4} m={4}> | ||
Loading.... | ||
<ProgressBar/> | ||
|
||
</Col> | ||
</Row> | ||
); | ||
|
||
export default ShowProgressBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.