-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add: new homepage * add: totalStats subgraph hook * chore: mobile/responsive styles fixes * 224 homepage with factory (#229) * wip: use factory instead of withTheme * remove withTheme hook usage, add: centralize breakpoint handling * style fixes * fix: handle copy in ui * add typing
- Loading branch information
Showing
30 changed files
with
1,927 additions
and
829 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { Box, Link, Pressable, Text, useBreakpointValue } from 'native-base'; | ||
|
||
import { InterSemiBold } from '../utils/webFonts'; | ||
|
||
type ActionButtonProps = { | ||
href?: string; | ||
text: string; | ||
bg: string; | ||
textColor: string; | ||
onPress?: any; | ||
}; | ||
|
||
export const buttonStyles = { | ||
buttonContainer: { | ||
justifyContent: 'space-evenly', | ||
marginTop: 2, | ||
}, | ||
button: { | ||
width: '100%', | ||
height: 47, | ||
flex: 1, | ||
justifyContent: 'space-between', | ||
alignItems: 'center', | ||
paddingRight: 10, | ||
paddingLeft: 10, | ||
paddingBottom: 1, | ||
fontSize: 'md', | ||
fontWeight: 700, | ||
flexDirection: 'row', | ||
flexWrap: 'wrap', | ||
borderRadius: 50, | ||
}, | ||
buttonText: { | ||
...InterSemiBold, | ||
fontSize: 'md', | ||
}, | ||
}; | ||
|
||
const ActionButton = ({ href, text, bg, textColor, onPress }: ActionButtonProps) => { | ||
const responsiveStyles = useBreakpointValue({ | ||
base: { | ||
button: { | ||
...buttonStyles.button, | ||
justifyContent: 'center', | ||
}, | ||
buttonText: { | ||
...buttonStyles.buttonText, | ||
height: 47, | ||
display: 'flex', | ||
alignItems: 'center', | ||
}, | ||
buttonContainer: { | ||
...buttonStyles.buttonContainer, | ||
width: '100%', | ||
}, | ||
}, | ||
lg: buttonStyles, | ||
}); | ||
|
||
const { buttonContainer, button, buttonText } = responsiveStyles ?? {}; | ||
|
||
const content = ( | ||
<Pressable {...button} onPress={onPress} backgroundColor={bg}> | ||
<Text {...buttonText} color={textColor}> | ||
{text} | ||
</Text> | ||
</Pressable> | ||
); | ||
|
||
if (href) { | ||
return ( | ||
<Link {...buttonContainer} href={href} isExternal={true}> | ||
{content} | ||
</Link> | ||
); | ||
} | ||
|
||
return <Box {...buttonContainer}>{content}</Box>; | ||
}; | ||
|
||
export default ActionButton; |
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.