Bluesky app fork with some witchin' additions 💫

Use new blue everywhere (#9435)

authored by samuel.fm and committed by GitHub 54af1704 8b00b8f9

Changed files
+41 -38
src
view
+18 -22
src/view/com/util/fab/FABInner.tsx
··· 7 7 } from 'react-native' 8 8 import Animated from 'react-native-reanimated' 9 9 import {useSafeAreaInsets} from 'react-native-safe-area-context' 10 - import {LinearGradient} from 'expo-linear-gradient' 11 10 12 11 import {PressableScale} from '#/lib/custom-animations/PressableScale' 13 12 import {useHaptics} from '#/lib/haptics' 14 13 import {useMinimalShellFabTransform} from '#/lib/hooks/useMinimalShellTransform' 15 - import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' 16 14 import {clamp} from '#/lib/numbers' 17 - import {gradients} from '#/lib/styles' 18 15 import {isWeb} from '#/platform/detection' 19 - import {ios} from '#/alf' 16 + import {ios, useBreakpoints, useTheme} from '#/alf' 20 17 import {atoms as a} from '#/alf' 21 18 22 19 export interface FABProps extends ComponentProps<typeof Pressable> { ··· 27 24 28 25 export function FABInner({testID, icon, onPress, style, ...props}: FABProps) { 29 26 const insets = useSafeAreaInsets() 30 - const {isMobile, isTablet} = useWebMediaQueries() 27 + const {gtMobile} = useBreakpoints() 28 + const t = useTheme() 31 29 const playHaptic = useHaptics() 32 30 const fabMinimalShellTransform = useMinimalShellFabTransform() 33 31 34 - const size = isTablet ? styles.sizeLarge : styles.sizeRegular 32 + const size = gtMobile ? styles.sizeLarge : styles.sizeRegular 35 33 36 - const tabletSpacing = isTablet 34 + const tabletSpacing = gtMobile 37 35 ? {right: 50, bottom: 50} 38 36 : {right: 24, bottom: clamp(insets.bottom, 15, 60) + 15} 39 37 ··· 43 41 styles.outer, 44 42 size, 45 43 tabletSpacing, 46 - isMobile && fabMinimalShellTransform, 44 + !gtMobile && fabMinimalShellTransform, 47 45 ]}> 48 46 <PressableScale 49 47 testID={testID} ··· 57 55 playHaptic('Heavy') 58 56 })} 59 57 targetScale={0.9} 60 - style={[a.rounded_full, style]} 58 + style={[ 59 + a.rounded_full, 60 + size, 61 + {backgroundColor: t.palette.primary_500}, 62 + a.align_center, 63 + a.justify_center, 64 + a.shadow_sm, 65 + style, 66 + ]} 61 67 {...props}> 62 - <LinearGradient 63 - colors={[gradients.blueLight.start, gradients.blueLight.end]} 64 - start={{x: 0, y: 0}} 65 - end={{x: 1, y: 1}} 66 - style={[styles.inner, size]}> 67 - {icon} 68 - </LinearGradient> 68 + {icon} 69 69 </PressableScale> 70 70 </Animated.View> 71 71 ) ··· 73 73 74 74 const styles = StyleSheet.create({ 75 75 sizeRegular: { 76 - width: 60, 77 - height: 60, 76 + width: 56, 77 + height: 56, 78 78 borderRadius: 30, 79 79 }, 80 80 sizeLarge: { ··· 87 87 position: isWeb ? 'fixed' : 'absolute', 88 88 zIndex: 1, 89 89 cursor: 'pointer', 90 - }, 91 - inner: { 92 - justifyContent: 'center', 93 - alignItems: 'center', 94 90 }, 95 91 })
+6 -4
src/view/icons/Logo.tsx
··· 10 10 } from 'react-native-svg' 11 11 import {Image} from 'expo-image' 12 12 13 - import {colors} from '#/lib/styles' 14 13 import {useKawaiiMode} from '#/state/preferences/kawaii' 15 - import {flatten} from '#/alf' 14 + import {flatten, useTheme} from '#/alf' 16 15 17 16 const ratio = 57 / 64 18 17 ··· 22 21 } & Omit<SvgProps, 'style'> 23 22 24 23 export const Logo = React.forwardRef(function LogoImpl(props: Props, ref) { 24 + const t = useTheme() 25 25 const {fill, ...rest} = props 26 26 const gradient = fill === 'sky' 27 27 const styles = flatten(props.style) 28 - const _fill = gradient ? 'url(#sky)' : fill || styles?.color || colors.blue3 28 + const _fill = gradient 29 + ? 'url(#sky)' 30 + : fill || styles?.color || t.palette.primary_500 29 31 // @ts-ignore it's fiiiiine 30 - const size = parseInt(rest.width || 32) 32 + const size = parseInt(rest.width || 32, 10) 31 33 32 34 const isKawaii = useKawaiiMode() 33 35
+11 -4
src/view/shell/bottom-bar/BottomBar.tsx
··· 28 28 import {useLoggedOutViewControls} from '#/state/shell/logged-out' 29 29 import {useShellLayout} from '#/state/shell/shell-layout' 30 30 import {useCloseAllActiveElements} from '#/state/util' 31 - import {Text} from '#/view/com/util/text/Text' 32 31 import {UserAvatar} from '#/view/com/util/UserAvatar' 33 32 import {Logo} from '#/view/icons/Logo' 34 33 import {Logotype} from '#/view/icons/Logotype' 35 - import {atoms as a} from '#/alf' 34 + import {atoms as a, useTheme} from '#/alf' 36 35 import {Button, ButtonText} from '#/components/Button' 37 36 import {useDialogControl} from '#/components/Dialog' 38 37 import {SwitchAccountDialog} from '#/components/dialogs/SwitchAccount' ··· 50 49 Message_Stroke2_Corner0_Rounded as Message, 51 50 Message_Stroke2_Corner0_Rounded_Filled as MessageFilled, 52 51 } from '#/components/icons/Message' 52 + import {Text} from '#/components/Typography' 53 53 import {useDemoMode} from '#/storage/hooks/demo-mode' 54 54 import {styles} from './BottomBarStyles' 55 55 ··· 396 396 accessibilityHint, 397 397 accessibilityLabel, 398 398 }: BtnProps) { 399 + const t = useTheme() 400 + 399 401 return ( 400 402 <PressableScale 401 403 testID={testID} ··· 410 412 accessibilityShowsLargeContentViewer> 411 413 {icon} 412 414 {notificationCount ? ( 413 - <View style={[styles.notificationCount, a.rounded_full]}> 414 - <Text style={styles.notificationCountLabel}>{notificationCount}</Text> 415 + <View 416 + style={[ 417 + styles.notificationCount, 418 + a.rounded_full, 419 + {backgroundColor: t.palette.primary_500}, 420 + ]}> 421 + <Text style={styles.notificationCountLabel}>1</Text> 415 422 </View> 416 423 ) : hasNew ? ( 417 424 <View style={[styles.hasNewBadge, a.rounded_full]} />
-7
src/view/shell/bottom-bar/BottomBarStyles.tsx
··· 24 24 position: 'absolute', 25 25 left: '52%', 26 26 top: 8, 27 - backgroundColor: colors.blue3, 28 27 paddingHorizontal: 4, 29 28 paddingBottom: 1, 30 29 borderRadius: 6, ··· 34 33 paddingTop: 3, 35 34 paddingBottom: 3, 36 35 borderRadius: 12, 37 - }, 38 - notificationCountLight: { 39 - borderColor: colors.white, 40 - }, 41 - notificationCountDark: { 42 - borderColor: colors.gray8, 43 36 }, 44 37 notificationCountLabel: { 45 38 fontSize: 12,
+6 -1
src/view/shell/bottom-bar/BottomBarWeb.tsx
··· 236 236 hasNew?: boolean 237 237 notificationCount?: string 238 238 }> = ({children, href, routeName, hasNew, notificationCount}) => { 239 + const t = useTheme() 239 240 const {_} = useLingui() 240 241 const {currentAccount} = useSession() 241 242 const currentRoute = useNavigationState(state => { ··· 272 273 {children({isActive})} 273 274 {notificationCount ? ( 274 275 <View 275 - style={[styles.notificationCount, styles.notificationCountWeb]} 276 + style={[ 277 + styles.notificationCount, 278 + styles.notificationCountWeb, 279 + {backgroundColor: t.palette.primary_500}, 280 + ]} 276 281 aria-label={_( 277 282 msg`${plural(notificationCount, { 278 283 one: '# unread item',