diff --git a/src/view/screens/Debug.tsx b/src/view/screens/Debug.tsx index 0e0464200e..06160bbfe7 100644 --- a/src/view/screens/Debug.tsx +++ b/src/view/screens/Debug.tsx @@ -1,520 +1,67 @@ import React from 'react' -import {ScrollView, View} from 'react-native' -import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types' -import {ViewHeader} from '../com/util/ViewHeader' -import {ThemeProvider, PaletteColorName} from 'lib/ThemeContext' -import {usePalette} from 'lib/hooks/usePalette' -import {s} from 'lib/styles' -import * as Toast from 'view/com/util/Toast' -import {Text} from '../com/util/text/Text' -import {ViewSelector} from '../com/util/ViewSelector' -import {EmptyState} from '../com/util/EmptyState' -import * as LoadingPlaceholder from '../com/util/LoadingPlaceholder' -import {Button, ButtonType} from '../com/util/forms/Button' -import {DropdownButton, DropdownItem} from '../com/util/forms/DropdownButton' -import {ToggleButton} from '../com/util/forms/ToggleButton' -import {RadioGroup} from '../com/util/forms/RadioGroup' -import {ErrorScreen} from '../com/util/error/ErrorScreen' -import {ErrorMessage} from '../com/util/error/ErrorMessage' +import {CenteredView} from '#/view/com/util/Views' -const MAIN_VIEWS = ['Base', 'Controls', 'Error', 'Notifs'] +import {useSetColorMode} from '#/state/shell' +import {Box, Text, Button, H1, H2, H3, H4, H5, H6} from '#/view/nova' -export const DebugScreen = ({}: NativeStackScreenProps< - CommonNavigatorParams, - 'Debug' ->) => { - const [colorScheme, setColorScheme] = React.useState<'light' | 'dark'>( - 'light', - ) - const onToggleColorScheme = () => { - setColorScheme(colorScheme === 'light' ? 'dark' : 'light') - } - return ( - - - - ) -} - -function DebugInner({ - colorScheme, - onToggleColorScheme, -}: { - colorScheme: 'light' | 'dark' - onToggleColorScheme: () => void -}) { - const [currentView, setCurrentView] = React.useState(0) - const pal = usePalette('default') - - const renderItem = (item: any) => { - return ( - - - - - {item.currentView === 3 ? ( - - ) : item.currentView === 2 ? ( - - ) : item.currentView === 1 ? ( - - ) : ( - - )} - - ) - } - - const items = [{currentView}] +export function DebugScreen() { + const setColorMode = useSetColorMode() return ( - - - - - ) -} - -function Heading({label}: {label: string}) { - const pal = usePalette('default') - return ( - - - {label} - - - ) -} - -function BaseView() { - return ( - - - - - - - - - - - - - - - - ) -} - -function ControlsView() { - return ( - - - - - - - - - - - - ) -} - -function ErrorView() { - return ( - - - {}} - /> - - - - - - - - - {}} - /> - - - {}} - numberOfLines={1} - /> - - - ) -} - -function NotifsView() { - const triggerPush = () => { - // TODO: implement local notification for testing - } - const triggerToast = () => { - Toast.show('The task has been completed') - } - const triggerToast2 = () => { - Toast.show('The task has been completed successfully and with no problems') - } - return ( - - - + + + + + +

Heading 1

+

Heading 2

+

Heading 3

+

Heading 4

+
Heading 5
+
Heading 6
+
+ + + + H1 Size Text + + H2 Size Text + H3 Size Text + H4 Size Text + H5 Size Text + H6 Size Text + + + + + + + + + + + + + + + + + + + + + + + ) } diff --git a/src/view/screens/DebugOld.tsx b/src/view/screens/DebugOld.tsx new file mode 100644 index 0000000000..0e0464200e --- /dev/null +++ b/src/view/screens/DebugOld.tsx @@ -0,0 +1,520 @@ +import React from 'react' +import {ScrollView, View} from 'react-native' +import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types' +import {ViewHeader} from '../com/util/ViewHeader' +import {ThemeProvider, PaletteColorName} from 'lib/ThemeContext' +import {usePalette} from 'lib/hooks/usePalette' +import {s} from 'lib/styles' +import * as Toast from 'view/com/util/Toast' +import {Text} from '../com/util/text/Text' +import {ViewSelector} from '../com/util/ViewSelector' +import {EmptyState} from '../com/util/EmptyState' +import * as LoadingPlaceholder from '../com/util/LoadingPlaceholder' +import {Button, ButtonType} from '../com/util/forms/Button' +import {DropdownButton, DropdownItem} from '../com/util/forms/DropdownButton' +import {ToggleButton} from '../com/util/forms/ToggleButton' +import {RadioGroup} from '../com/util/forms/RadioGroup' +import {ErrorScreen} from '../com/util/error/ErrorScreen' +import {ErrorMessage} from '../com/util/error/ErrorMessage' + +const MAIN_VIEWS = ['Base', 'Controls', 'Error', 'Notifs'] + +export const DebugScreen = ({}: NativeStackScreenProps< + CommonNavigatorParams, + 'Debug' +>) => { + const [colorScheme, setColorScheme] = React.useState<'light' | 'dark'>( + 'light', + ) + const onToggleColorScheme = () => { + setColorScheme(colorScheme === 'light' ? 'dark' : 'light') + } + return ( + + + + ) +} + +function DebugInner({ + colorScheme, + onToggleColorScheme, +}: { + colorScheme: 'light' | 'dark' + onToggleColorScheme: () => void +}) { + const [currentView, setCurrentView] = React.useState(0) + const pal = usePalette('default') + + const renderItem = (item: any) => { + return ( + + + + + {item.currentView === 3 ? ( + + ) : item.currentView === 2 ? ( + + ) : item.currentView === 1 ? ( + + ) : ( + + )} + + ) + } + + const items = [{currentView}] + + return ( + + + + + ) +} + +function Heading({label}: {label: string}) { + const pal = usePalette('default') + return ( + + + {label} + + + ) +} + +function BaseView() { + return ( + + + + + + + + + + + + + + + + ) +} + +function ControlsView() { + return ( + + + + + + + + + + + + ) +} + +function ErrorView() { + return ( + + + {}} + /> + + + + + + + + + {}} + /> + + + {}} + numberOfLines={1} + /> + + + ) +} + +function NotifsView() { + const triggerPush = () => { + // TODO: implement local notification for testing + } + const triggerToast = () => { + Toast.show('The task has been completed') + } + const triggerToast2 = () => { + Toast.show('The task has been completed successfully and with no problems') + } + return ( + + +