diff options
Diffstat (limited to 'src/platform')
-rw-r--r-- | src/platform/auth-flow.native.ts | 2 | ||||
-rw-r--r-- | src/platform/auth-flow.ts | 2 | ||||
-rw-r--r-- | src/platform/desktop-web/left-column.tsx | 57 | ||||
-rw-r--r-- | src/platform/desktop-web/right-column.tsx | 19 | ||||
-rw-r--r-- | src/platform/desktop-web/shell.tsx | 35 | ||||
-rw-r--r-- | src/platform/shell.tsx | 12 |
6 files changed, 2 insertions, 125 deletions
diff --git a/src/platform/auth-flow.native.ts b/src/platform/auth-flow.native.ts index 596632f17..3c9bd09eb 100644 --- a/src/platform/auth-flow.native.ts +++ b/src/platform/auth-flow.native.ts @@ -4,7 +4,7 @@ import * as ucan from 'ucans' import {InAppBrowser} from 'react-native-inappbrowser-reborn' import {isWeb} from '../platform/detection' import {extractHashFragment, makeAppUrl} from '../platform/urls' -import {ReactNativeStore, parseUrlForUcan} from '../state/auth' +import {ReactNativeStore, parseUrlForUcan} from '../state/lib/auth' import * as env from '../env' export async function requestAppUcan( diff --git a/src/platform/auth-flow.ts b/src/platform/auth-flow.ts index b96fc58e9..fbc85a373 100644 --- a/src/platform/auth-flow.ts +++ b/src/platform/auth-flow.ts @@ -1,7 +1,7 @@ import * as auth from '@adxp/auth' import * as ucan from 'ucans' import {makeAppUrl} from '../platform/urls' -import {ReactNativeStore} from '../state/auth' +import {ReactNativeStore} from '../state/lib/auth' import * as env from '../env' export async function requestAppUcan( diff --git a/src/platform/desktop-web/left-column.tsx b/src/platform/desktop-web/left-column.tsx deleted file mode 100644 index 082231ec9..000000000 --- a/src/platform/desktop-web/left-column.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import React from 'react' -import {Pressable, View, StyleSheet} from 'react-native' -import {Link} from '@react-navigation/native' -import {useRoute} from '@react-navigation/native' - -export const NavItem: React.FC<{label: string; screen: string}> = ({ - label, - screen, -}) => { - const route = useRoute() - return ( - <View> - <Pressable - style={state => [ - // @ts-ignore it does exist! (react-native-web) -prf - state.hovered && styles.navItemHovered, - ]}> - <Link - style={[ - styles.navItemLink, - route.name === screen && styles.navItemLinkSelected, - ]} - to={{screen, params: {}}}> - {label} - </Link> - </Pressable> - </View> - ) -} - -export const DesktopLeftColumn: React.FC = () => { - return ( - <View style={styles.container}> - <NavItem screen="Home" label="Home" /> - <NavItem screen="Search" label="Search" /> - <NavItem screen="Notifications" label="Notifications" /> - </View> - ) -} - -const styles = StyleSheet.create({ - container: { - position: 'absolute', - left: 'calc(50vw - 500px)', - width: '200px', - height: '100%', - }, - navItemHovered: { - backgroundColor: 'gray', - }, - navItemLink: { - padding: '1rem', - }, - navItemLinkSelected: { - color: 'blue', - }, -}) diff --git a/src/platform/desktop-web/right-column.tsx b/src/platform/desktop-web/right-column.tsx deleted file mode 100644 index 5fe65cac8..000000000 --- a/src/platform/desktop-web/right-column.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react' -import {Text, View, StyleSheet} from 'react-native' - -export const DesktopRightColumn: React.FC = () => { - return ( - <View style={styles.container}> - <Text>Right Column</Text> - </View> - ) -} - -const styles = StyleSheet.create({ - container: { - position: 'absolute', - right: 'calc(50vw - 500px)', - width: '200px', - height: '100%', - }, -}) diff --git a/src/platform/desktop-web/shell.tsx b/src/platform/desktop-web/shell.tsx deleted file mode 100644 index ef880306b..000000000 --- a/src/platform/desktop-web/shell.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react' -import {observer} from 'mobx-react-lite' -import {View, StyleSheet} from 'react-native' -import {DesktopLeftColumn} from './left-column' -import {DesktopRightColumn} from './right-column' -import {useStores} from '../../state' - -export const DesktopWebShell: React.FC = observer(({children}) => { - const store = useStores() - return ( - <View style={styles.outerContainer}> - {store.session.isAuthed ? ( - <> - <DesktopLeftColumn /> - <View style={styles.innerContainer}>{children}</View> - <DesktopRightColumn /> - </> - ) : ( - <View style={styles.innerContainer}>{children}</View> - )} - </View> - ) -}) - -const styles = StyleSheet.create({ - outerContainer: { - height: '100%', - }, - innerContainer: { - marginLeft: 'auto', - marginRight: 'auto', - width: '600px', - height: '100%', - }, -}) diff --git a/src/platform/shell.tsx b/src/platform/shell.tsx deleted file mode 100644 index ec8d51e1f..000000000 --- a/src/platform/shell.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react' -import {SafeAreaView} from 'react-native' -import {isDesktopWeb} from './detection' -import {DesktopWebShell} from './desktop-web/shell' - -export const Shell: React.FC = ({children}) => { - return isDesktopWeb ? ( - <DesktopWebShell>{children}</DesktopWebShell> - ) : ( - <SafeAreaView>{children}</SafeAreaView> - ) -} |