Fix auth flow, FAB, and and load latest button
This commit is contained in:
@@ -41,7 +41,14 @@ export const SplashScreen = ({
|
|||||||
</View>
|
</View>
|
||||||
<View
|
<View
|
||||||
testID="signinOrCreateAccount"
|
testID="signinOrCreateAccount"
|
||||||
style={[a.px_xl, a.gap_md, a.pb_2xl]}>
|
style={[
|
||||||
|
a.px_xl,
|
||||||
|
a.gap_md,
|
||||||
|
a.pb_2xl,
|
||||||
|
a.w_full,
|
||||||
|
a.mx_auto,
|
||||||
|
{maxWidth: 450},
|
||||||
|
]}>
|
||||||
<Button
|
<Button
|
||||||
testID="createAccountButton"
|
testID="createAccountButton"
|
||||||
onPress={onPressCreateAccount}
|
onPress={onPressCreateAccount}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {LayoutChangeEvent, ScrollView, StyleSheet, View} from 'react-native'
|
|||||||
|
|
||||||
import {usePalette} from '#/lib/hooks/usePalette'
|
import {usePalette} from '#/lib/hooks/usePalette'
|
||||||
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
||||||
import {isNative} from '#/platform/detection'
|
import {isNative, isNativeTablet} from '#/platform/detection'
|
||||||
import {PressableWithHover} from '../util/PressableWithHover'
|
import {PressableWithHover} from '../util/PressableWithHover'
|
||||||
import {Text} from '../util/text/Text'
|
import {Text} from '../util/text/Text'
|
||||||
import {DraggableScrollView} from './DraggableScrollView'
|
import {DraggableScrollView} from './DraggableScrollView'
|
||||||
@@ -37,8 +37,9 @@ export function TabBar({
|
|||||||
() => ({borderBottomColor: indicatorColor || pal.colors.link}),
|
() => ({borderBottomColor: indicatorColor || pal.colors.link}),
|
||||||
[indicatorColor, pal],
|
[indicatorColor, pal],
|
||||||
)
|
)
|
||||||
const {isDesktop, isTablet} = useWebMediaQueries()
|
const {isTabletOrDesktop} = useWebMediaQueries()
|
||||||
const styles = isDesktop || isTablet ? desktopStyles : mobileStyles
|
const styles =
|
||||||
|
isTabletOrDesktop && !isNativeTablet ? desktopStyles : mobileStyles
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isNative) {
|
if (isNative) {
|
||||||
@@ -143,7 +144,7 @@ export function TabBar({
|
|||||||
<View style={[styles.itemInner, selected && indicatorStyle]}>
|
<View style={[styles.itemInner, selected && indicatorStyle]}>
|
||||||
<Text
|
<Text
|
||||||
emoji
|
emoji
|
||||||
type={isDesktop || isTablet ? 'xl-bold' : 'lg-bold'}
|
type={isTabletOrDesktop ? 'xl-bold' : 'lg-bold'}
|
||||||
testID={testID ? `${testID}-${item}` : undefined}
|
testID={testID ? `${testID}-${item}` : undefined}
|
||||||
style={[
|
style={[
|
||||||
selected ? pal.text : pal.textLight,
|
selected ? pal.text : pal.textLight,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {useMinimalShellFabTransform} from '#/lib/hooks/useMinimalShellTransform'
|
|||||||
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
||||||
import {clamp} from '#/lib/numbers'
|
import {clamp} from '#/lib/numbers'
|
||||||
import {gradients} from '#/lib/styles'
|
import {gradients} from '#/lib/styles'
|
||||||
import {isWeb} from '#/platform/detection'
|
import {isNativeTablet, isWeb} from '#/platform/detection'
|
||||||
import {ios} from '#/alf'
|
import {ios} from '#/alf'
|
||||||
|
|
||||||
export interface FABProps
|
export interface FABProps
|
||||||
@@ -37,7 +37,7 @@ export function FABInner({testID, icon, onPress, ...props}: FABProps) {
|
|||||||
styles.outer,
|
styles.outer,
|
||||||
size,
|
size,
|
||||||
tabletSpacing,
|
tabletSpacing,
|
||||||
isMobile && fabMinimalShellTransform,
|
(isMobile || isNativeTablet) && fabMinimalShellTransform,
|
||||||
]}>
|
]}>
|
||||||
<PressableScale
|
<PressableScale
|
||||||
testID={testID}
|
testID={testID}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import {useColorSchemeStyle} from '#/lib/hooks/useColorSchemeStyle'
|
|||||||
import {useIsKeyboardVisible} from '#/lib/hooks/useIsKeyboardVisible'
|
import {useIsKeyboardVisible} from '#/lib/hooks/useIsKeyboardVisible'
|
||||||
import {usePalette} from '#/lib/hooks/usePalette'
|
import {usePalette} from '#/lib/hooks/usePalette'
|
||||||
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
||||||
import {isWeb} from '#/platform/detection'
|
|
||||||
import {atoms as a} from '#/alf'
|
import {atoms as a} from '#/alf'
|
||||||
import {Text} from '../text/Text'
|
import {Text} from '../text/Text'
|
||||||
|
|
||||||
@@ -79,9 +78,7 @@ export const LoggedOutLayout = ({
|
|||||||
contentContainerStyle={styles.scrollViewContentContainer}
|
contentContainerStyle={styles.scrollViewContentContainer}
|
||||||
keyboardShouldPersistTaps="handled"
|
keyboardShouldPersistTaps="handled"
|
||||||
keyboardDismissMode="on-drag">
|
keyboardDismissMode="on-drag">
|
||||||
<View style={[styles.contentWrapper, isWeb && a.my_auto]}>
|
<View style={[styles.contentWrapper]}>{children}</View>
|
||||||
{children}
|
|
||||||
</View>
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
) : (
|
) : (
|
||||||
@@ -98,6 +95,7 @@ const styles = StyleSheet.create({
|
|||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
// @ts-ignore web only
|
// @ts-ignore web only
|
||||||
height: '100vh',
|
height: '100vh',
|
||||||
|
flex: 1,
|
||||||
},
|
},
|
||||||
side: {
|
side: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
@@ -114,8 +112,9 @@ const styles = StyleSheet.create({
|
|||||||
flex: 2,
|
flex: 2,
|
||||||
},
|
},
|
||||||
scrollViewContentContainer: {
|
scrollViewContentContainer: {
|
||||||
flex: 1,
|
flexGrow: 1,
|
||||||
paddingHorizontal: 40,
|
paddingHorizontal: 40,
|
||||||
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
leadinText: {
|
leadinText: {
|
||||||
fontSize: 36,
|
fontSize: 36,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {usePalette} from '#/lib/hooks/usePalette'
|
|||||||
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
||||||
import {clamp} from '#/lib/numbers'
|
import {clamp} from '#/lib/numbers'
|
||||||
import {colors} from '#/lib/styles'
|
import {colors} from '#/lib/styles'
|
||||||
import {isWeb} from '#/platform/detection'
|
import {isNativeTablet, isWeb} from '#/platform/detection'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
|
|
||||||
const AnimatedTouchableOpacity =
|
const AnimatedTouchableOpacity =
|
||||||
@@ -37,7 +37,9 @@ export function LoadLatestBtn({
|
|||||||
|
|
||||||
// Adjust height of the fab if we have a session only on mobile web. If we don't have a session, we want to adjust
|
// Adjust height of the fab if we have a session only on mobile web. If we don't have a session, we want to adjust
|
||||||
// it on both tablet and mobile since we are showing the bottom bar (see createNativeStackNavigatorWithAuth)
|
// it on both tablet and mobile since we are showing the bottom bar (see createNativeStackNavigatorWithAuth)
|
||||||
const showBottomBar = hasSession ? isMobile : isTabletOrMobile
|
const showBottomBar = hasSession
|
||||||
|
? isMobile || isNativeTablet
|
||||||
|
: isTabletOrMobile
|
||||||
|
|
||||||
const bottomPosition = isTablet
|
const bottomPosition = isTablet
|
||||||
? {bottom: 50}
|
? {bottom: 50}
|
||||||
@@ -51,7 +53,7 @@ export function LoadLatestBtn({
|
|||||||
(isTallViewport
|
(isTallViewport
|
||||||
? styles.loadLatestOutOfLine
|
? styles.loadLatestOutOfLine
|
||||||
: styles.loadLatestInline),
|
: styles.loadLatestInline),
|
||||||
isTablet && styles.loadLatestInline,
|
isTablet && !isNativeTablet && styles.loadLatestInline,
|
||||||
pal.borderDark,
|
pal.borderDark,
|
||||||
pal.view,
|
pal.view,
|
||||||
bottomPosition,
|
bottomPosition,
|
||||||
|
|||||||
Reference in New Issue
Block a user