diff --git a/docs/theme.md b/docs/theme.md index 0a7501159..db050174c 100644 --- a/docs/theme.md +++ b/docs/theme.md @@ -12,7 +12,7 @@ import React from 'react'; import { NativeBaseProvider, useTheme, - SimpleGrid, + FlatList, Center, Box, } from 'native-base'; @@ -20,11 +20,13 @@ import { function ColorPalete() { const { colors } = useTheme(); return ( - - {Object.keys(colors['emerald']).map((colorKey) => ( - - ))} - + + } + /> + ); } @@ -55,8 +57,9 @@ function Tokens() { 'lightText', ]); return ( -
- Contrast threshold is: +
+ Contrast threshold is:{' '} + {contrastThreshold}
@@ -67,13 +70,14 @@ function Tokens() { export default function () { return ( -
+
); } + ``` ## useContrastText @@ -83,10 +87,16 @@ If you are defining the background yourself and pass a contrasting color to the ```SnackPlayer name=useContrastText import React from 'react'; -import { Button, Stack, useContrastText, NativeBaseProvider, Center } from 'native-base'; -function UseContrastingTextHook () { - const bgDark = 'emerald.700'; - const bgLight = 'emerald.200'; +import { + Button, + Stack, + useContrastText, + NativeBaseProvider, + Center, +} from 'native-base'; +function UseContrastingTextHook() { + const bgDark = 'primary.700'; + const bgLight = 'primary.200'; const colorContrastDark = useContrastText(bgDark); const colorContrastLight = useContrastText(bgLight); @@ -106,12 +116,13 @@ function UseContrastingTextHook () { export default function () { return ( -
+
); } + ``` ## useColorMode @@ -122,7 +133,6 @@ If you want to define some conditionals based on current color mode or change th import React from 'react'; import { NativeBaseProvider, - VStack, useColorMode, Text, Button, @@ -132,23 +142,25 @@ import { function UseColorMode() { const { colorMode, toggleColorMode } = useColorMode(); return ( -
- - The active color mode is {colorMode} +
+ + The active color mode is{' '} + + {colorMode} +
); } -// Example template which wraps component with NativeBaseProvider -export default function () { +export default Example = () => { return ( ); -} +}; ``` @@ -168,24 +180,26 @@ import { } from 'native-base'; function UseColorMode() { - const { colorMode, toggleColorMode } = useColorMode(); + const { toggleColorMode } = useColorMode(); return ( -
- - The active color mode is {useColorModeValue('Light', 'Dark')} +
+ + The active color mode is{' '} + + {useColorModeValue('Light', 'Dark')} +
); } -// Example template which wraps component with NativeBaseProvider -export default function () { +export default Example = () => { return ( ); -} +}; ```