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