This repository has been archived by the owner on Apr 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: indicate refund file upload (#36)
* feat: indicate upload * chore: remove typo * refactor: change style
- Loading branch information
1 parent
54b499d
commit 964455e
Showing
4 changed files
with
76 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,56 @@ | ||
import React from 'react'; | ||
import injectSheet from 'react-jss'; | ||
import PropTypes from 'prop-types'; | ||
import View from '../view'; | ||
import { MdArrowForward } from 'react-icons/md'; | ||
|
||
const styles = { | ||
wrapper: { flex: 1, justifyContent: 'center', alignItems: 'center' }, | ||
const styles = theme => ({ | ||
wrapper: { | ||
flex: 1, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
backgroundColor: p => (p.loading ? theme.colors.tundoraGrey : 'none'), | ||
}, | ||
controls: { flex: 2, justifyContent: 'center', alignItems: 'center' }, | ||
loading: { color: '#fff', fontWeight: '300' }, | ||
text: { color: '#fff', fontWeight: '300' }, | ||
nextIcon: { | ||
paddingRight: '10px', | ||
height: '30px', | ||
width: '30px', | ||
color: '#fff', | ||
color: theme.colors.white, | ||
}, | ||
}; | ||
}); | ||
|
||
const Controls = ({ text, onPress, loading }) => ( | ||
<View style={styles.wrapper} onClick={loading ? null : () => onPress()}> | ||
<View style={styles.controls}> | ||
{loading ? ( | ||
<h1 style={styles.loading}>Loading...</h1> | ||
) : ( | ||
<h1 style={styles.loading}>{text}</h1> | ||
)} | ||
const Controls = ({ | ||
classes, | ||
text, | ||
onPress, | ||
loading, | ||
loadingText, | ||
loadingStyle, | ||
}) => { | ||
return ( | ||
<View | ||
className={classes.wrapper} | ||
onClick={loading ? null : () => onPress()} | ||
> | ||
<View className={classes.controls}> | ||
<h1 className={loading ? loadingStyle : classes.text}> | ||
{loading ? loadingText : text} | ||
</h1> | ||
</View> | ||
<MdArrowForward className={classes.nextIcon} /> | ||
</View> | ||
<MdArrowForward style={styles.nextIcon} /> | ||
</View> | ||
); | ||
); | ||
}; | ||
|
||
Controls.propTypes = { | ||
classes: PropTypes.object.isRequired, | ||
text: PropTypes.string, | ||
onPress: PropTypes.func, | ||
loading: PropTypes.bool, | ||
loadingText: PropTypes.string, | ||
loadingStyle: PropTypes.string, | ||
}; | ||
|
||
export default Controls; | ||
export default injectSheet(styles)(Controls); |
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 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