Created
August 12, 2020 15:12
-
-
Save iamclaytonray/49691b2c8010a982a2ae783c09c02e59 to your computer and use it in GitHub Desktop.
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
import clsx from 'rn-clsx'; | |
export const spacing = { | |
xs: 4, | |
sm: 8, | |
md: 16, | |
lg: 24, | |
xlg: 32, | |
}; | |
export const theme = { | |
spacing, | |
}; | |
// components/Input/index.tsx | |
export const Input = () => { | |
const inputStyles = clsx( | |
{ | |
root: true, | |
focused: props.focused, | |
disabled: props.disabled, | |
}, | |
styles.container | |
); | |
return <TextInput {...props} style={inputStyles} /> | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
root: { | |
flexDirection: 'row', | |
alignItems: 'center', | |
justifyContent: 'center', | |
backgroundColor: theme.colors.neutral00, | |
paddingHorizontal: theme.spacing.sm, | |
color: theme.colors.neutral900, | |
borderBottomColor: theme.colors.neutral700, | |
borderBottomWidth: 2, | |
}, | |
focused: { | |
borderBottomColor: theme.colors.primary, | |
}, | |
disabled: { | |
backgroundColor: theme.colors.neutral300, | |
opacity: 0.5, | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment