Fix theming in web app
This commit is contained in:
parent
25ae7dd638
commit
0da0a8d368
|
@ -19,7 +19,7 @@ function App() {
|
|||
const [theme, setTheme] = useState<ThemeVars>('light')
|
||||
|
||||
return (
|
||||
<TamaguiProvider config={tamaguiConfig}>
|
||||
<TamaguiProvider config={tamaguiConfig} defaultTheme={theme}>
|
||||
<div id="app">
|
||||
<div id="sidebar">
|
||||
<Sidebar
|
||||
|
@ -53,11 +53,11 @@ function App() {
|
|||
<Paragraph marginVertical={20}>
|
||||
Theme selected - {theme}{' '}
|
||||
</Paragraph>
|
||||
<button
|
||||
onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}
|
||||
<Button
|
||||
onPress={() => setTheme(theme === 'dark' ? 'light' : 'dark')}
|
||||
>
|
||||
Toogle theme
|
||||
</button>
|
||||
</Button>
|
||||
<Shape marginTop={20} />
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
|
|
@ -44,13 +44,14 @@ type BaseProps = GetProps<typeof Base>
|
|||
interface Props {
|
||||
type?: BaseProps['type']
|
||||
children: string
|
||||
onPress?: () => void
|
||||
}
|
||||
|
||||
const Button = (props: Props) => {
|
||||
const { type = 'primary', children } = props
|
||||
const { type = 'primary', children, onPress } = props
|
||||
|
||||
return (
|
||||
<Base type={type}>
|
||||
<Base type={type} onPress={onPress}>
|
||||
<ButtonText>{children}</ButtonText>
|
||||
</Base>
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue