diff --git a/src/alf/atoms.ts b/src/alf/atoms.ts index 5a3e6d6750..c60af48625 100644 --- a/src/alf/atoms.ts +++ b/src/alf/atoms.ts @@ -951,8 +951,8 @@ export const atoms = { userSelect: 'all', }, outline_inset_1: { - outlineOffset: '-1px', - } as StyleProp, + outlineOffset: -1, + }, /* * Text decoration diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index aa27adb3d1..3f0395f7a4 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -118,7 +118,7 @@ import {LazyQuoteEmbed, QuoteX} from '#/view/com/util/post-embeds/QuoteEmbed' import {Text} from '#/view/com/util/text/Text' import * as Toast from '#/view/com/util/Toast' import {UserAvatar} from '#/view/com/util/UserAvatar' -import {atoms as a, native, useTheme} from '#/alf' +import {atoms as a, native, useTheme, web} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {useDialogControl} from '#/components/Dialog' import {VerifyEmailDialog} from '#/components/dialogs/VerifyEmailDialog' @@ -1515,10 +1515,10 @@ const styles = StyleSheet.create({ paddingVertical: 6, marginLeft: 12, }, - stickyFooterWeb: { + stickyFooterWeb: web({ position: 'sticky', bottom: 0, - }, + }), errorLine: { flexDirection: 'row', alignItems: 'center', diff --git a/src/view/com/composer/ComposerReplyTo.tsx b/src/view/com/composer/ComposerReplyTo.tsx index 6f1cc4f842..bafac18f5e 100644 --- a/src/view/com/composer/ComposerReplyTo.tsx +++ b/src/view/com/composer/ComposerReplyTo.tsx @@ -15,7 +15,7 @@ import {sanitizeHandle} from '#/lib/strings/handles' import {type ComposerOptsPostRef} from '#/state/shell/composer' import {MaybeQuoteEmbed} from '#/view/com/util/post-embeds/QuoteEmbed' import {PreviewableUserAvatar} from '#/view/com/util/UserAvatar' -import {atoms as a, useTheme} from '#/alf' +import {atoms as a, useTheme, web} from '#/alf' import {Text} from '#/components/Typography' import {useSimpleVerificationState} from '#/components/verification' import {VerificationCheck} from '#/components/verification/VerificationCheck' @@ -76,7 +76,7 @@ export function ComposerReplyTo({replyTo}: {replyTo: ComposerOptsPostRef}) { a.mx_lg, a.border_b, t.atoms.border_contrast_medium, - a.user_select_text, + web(a.user_select_text), ]} onPress={onPress} accessibilityRole="button" diff --git a/src/view/com/pager/TabBar.web.tsx b/src/view/com/pager/TabBar.web.tsx index d44b7b60c4..8afea00196 100644 --- a/src/view/com/pager/TabBar.web.tsx +++ b/src/view/com/pager/TabBar.web.tsx @@ -1,7 +1,7 @@ import {useCallback, useEffect, useRef} from 'react' -import {ScrollView, StyleSheet, View} from 'react-native' +import {type ScrollView, StyleSheet, View} from 'react-native' -import {atoms as a, useBreakpoints, useTheme} from '#/alf' +import {atoms as a, useBreakpoints, useTheme, web} from '#/alf' import {Text} from '#/components/Typography' import {PressableWithHover} from '../util/PressableWithHover' import {DraggableScrollView} from './DraggableScrollView' @@ -161,7 +161,7 @@ const desktopStyles = StyleSheet.create({ }, itemInner: { alignItems: 'center', - overflowX: 'hidden', + ...web({overflowX: 'hidden'}), }, itemText: { textAlign: 'center', @@ -204,7 +204,7 @@ const mobileStyles = StyleSheet.create({ itemInner: { flexGrow: 1, alignItems: 'center', - overflowX: 'hidden', + ...web({overflowX: 'hidden'}), }, itemText: { textAlign: 'center', diff --git a/src/view/com/util/forms/NativeDropdown.web.tsx b/src/view/com/util/forms/NativeDropdown.web.tsx index 9b4a84e05a..cab7bac510 100644 --- a/src/view/com/util/forms/NativeDropdown.web.tsx +++ b/src/view/com/util/forms/NativeDropdown.web.tsx @@ -239,7 +239,6 @@ const getKey = (label: string, index: number, id?: string) => { return `${label}_${index}` } -// @ts-expect-error - web only styles. the only style that should be broken here is `outline` const styles = StyleSheet.create({ separator: { height: 1, @@ -264,7 +263,6 @@ const styles = StyleSheet.create({ justifyContent: 'space-between', alignItems: 'center', columnGap: 20, - // @ts-ignore -web cursor: 'pointer', paddingTop: 8, paddingBottom: 8, @@ -273,6 +271,7 @@ const styles = StyleSheet.create({ borderRadius: 8, fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Liberation Sans", Helvetica, Arial, sans-serif', + // @ts-expect-error web only outline: 0, border: 0, }, diff --git a/src/view/com/util/load-latest/LoadLatestBtn.tsx b/src/view/com/util/load-latest/LoadLatestBtn.tsx index 89e5784b7a..f991991b0e 100644 --- a/src/view/com/util/load-latest/LoadLatestBtn.tsx +++ b/src/view/com/util/load-latest/LoadLatestBtn.tsx @@ -12,9 +12,8 @@ import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' import {clamp} from '#/lib/numbers' import {useGate} from '#/lib/statsig/statsig' import {colors} from '#/lib/styles' -import {isWeb} from '#/platform/detection' import {useSession} from '#/state/session' -import {useLayoutBreakpoints} from '#/alf' +import {atoms as a, useLayoutBreakpoints} from '#/alf' export function LoadLatestBtn({ onPress, @@ -80,7 +79,7 @@ export function LoadLatestBtn({ const styles = StyleSheet.create({ loadLatest: { zIndex: 20, - position: isWeb ? 'fixed' : 'absolute', + ...a.fixed, left: 18, borderWidth: StyleSheet.hairlineWidth, width: 52, diff --git a/src/view/shell/bottom-bar/BottomBarStyles.tsx b/src/view/shell/bottom-bar/BottomBarStyles.tsx index 62c677ced0..c5f31c94e6 100644 --- a/src/view/shell/bottom-bar/BottomBarStyles.tsx +++ b/src/view/shell/bottom-bar/BottomBarStyles.tsx @@ -1,6 +1,7 @@ import {StyleSheet} from 'react-native' import {colors} from '#/lib/styles' +import {atoms as a} from '#/alf' export const styles = StyleSheet.create({ bottomBar: { @@ -13,9 +14,7 @@ export const styles = StyleSheet.create({ paddingLeft: 5, paddingRight: 10, }, - bottomBarWeb: { - position: 'fixed', - }, + bottomBarWeb: a.fixed, ctrl: { flex: 1, paddingTop: 13, diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index 7d7c0ac8d7..0688fb5dc4 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -32,7 +32,7 @@ import {LoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder' import {PressableWithHover} from '#/view/com/util/PressableWithHover' import {UserAvatar} from '#/view/com/util/UserAvatar' import {NavSignupCard} from '#/view/shell/NavSignupCard' -import {atoms as a, tokens, useLayoutBreakpoints, useTheme} from '#/alf' +import {atoms as a, tokens, useLayoutBreakpoints, useTheme, web} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {type DialogControlProps} from '#/components/Dialog' import {ArrowBoxLeft_Stroke2_Corner0_Rounded as LeaveIcon} from '#/components/icons/ArrowBoxLeft' @@ -718,7 +718,7 @@ export function DesktopLeftNav() { const styles = StyleSheet.create({ leftNav: { - position: 'fixed', + ...a.fixed, top: 0, paddingTop: 10, paddingBottom: 10, @@ -736,7 +736,7 @@ const styles = StyleSheet.create({ height: '100%', width: 86, alignItems: 'center', - overflowX: 'hidden', + ...web({overflowX: 'hidden'}), }, backBtn: { position: 'absolute', diff --git a/src/view/shell/index.web.tsx b/src/view/shell/index.web.tsx index e194a49de8..898ff8fa83 100644 --- a/src/view/shell/index.web.tsx +++ b/src/view/shell/index.web.tsx @@ -8,7 +8,7 @@ import {RemoveScrollBar} from 'react-remove-scroll-bar' import {useColorSchemeStyle} from '#/lib/hooks/useColorSchemeStyle' import {useIntentHandler} from '#/lib/hooks/useIntentHandler' import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' -import {NavigationProp} from '#/lib/routes/types' +import {type NavigationProp} from '#/lib/routes/types' import {colors} from '#/lib/styles' import {useIsDrawerOpen, useSetDrawerOpen} from '#/state/shell' import {useComposerKeyboardShortcut} from '#/state/shell/composer/useComposerKeyboardShortcut' @@ -130,7 +130,7 @@ const styles = StyleSheet.create({ backgroundColor: colors.black, // TODO }, drawerMask: { - position: 'fixed', + ...a.fixed, width: '100%', height: '100%', top: 0, @@ -138,7 +138,7 @@ const styles = StyleSheet.create({ }, drawerContainer: { display: 'flex', - position: 'fixed', + ...a.fixed, top: 0, left: 0, height: '100%',