-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from COS301-SE-2024/chore/mobile/refactor
Gradient button component made
- Loading branch information
Showing
10 changed files
with
71 additions
and
249 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react' | ||
import { LinearGradient } from 'expo-linear-gradient'; | ||
import { StyleSheet } from 'react-native'; | ||
import { Heading } from '@gluestack-ui/themed'; | ||
import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen'; | ||
|
||
const GradientButton = ({ onPress, text }) => { | ||
return ( | ||
<LinearGradient | ||
colors={['#614DC8', '#86EBCC', '#B2FC3A', '#EEF060']} | ||
locations={[0.02, 0.31, 0.67, 0.97]} | ||
start={[0, 1]} | ||
end={[1, 0]} | ||
style={styles.buttonContainer} | ||
> | ||
<Heading style={styles.buttonText} onPress={onPress}> | ||
{text} | ||
</Heading> | ||
</LinearGradient> | ||
) | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
buttonContainer: { | ||
borderRadius: 15, | ||
marginTop: hp('2%'), | ||
alignSelf: 'center', | ||
width: wp('90%'), | ||
height: hp('6%'), | ||
}, | ||
buttonText: { | ||
color: 'black', | ||
fontSize: wp('4%'), | ||
textAlign: 'center', | ||
lineHeight: hp('6%'), | ||
}, | ||
}); | ||
|
||
export default GradientButton |
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
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
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.