Fix theming in web app
This commit is contained in:
parent
d2a3d65900
commit
98e9c1850d
|
@ -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