Skip to content

Commit

Permalink
Merge pull request #282 from Crossbell-Box/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
dohooo authored Dec 10, 2023
2 parents efecbbc + de293a9 commit 787e10c
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 55 deletions.
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"@babel/plugin-proposal-private-property-in-object": "^7.21.0",
"@babel/plugin-transform-flow-strip-types": "^7.21.0",
"@changesets/apply-release-plan": "^6.1.3",
"@changesets/cli": "^2.26.1",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.26.1",
"@changesets/config": "^2.3.0",
"@changesets/get-release-plan": "^3.0.16",
"@changesets/types": "^5.2.1",
Expand All @@ -75,7 +75,6 @@
"@react-navigation/elements": "^1.3.17",
"@react-navigation/native": "^6.1.6",
"@react-navigation/native-stack": "^6.9.12",
"@react-navigation/stack": "^6.3.17",
"@sentry/cli": "^2.19.1",
"@sentry/react-native": "5.5.0",
"@shopify/flash-list": "^1.6.3",
Expand Down Expand Up @@ -119,7 +118,7 @@
"ethers": "6.9.0",
"expo": "^49.0.13",
"expo-application": "~5.3.0",
"expo-blur": "~12.4.1",
"expo-blur": "~12.9.0",
"expo-build-properties": "~0.8.3",
"expo-clipboard": "~4.3.0",
"expo-constants": "~14.4.2",
Expand Down Expand Up @@ -188,7 +187,7 @@
"react-native-reanimated-carousel": "^3.5.1",
"react-native-redash": "^18.1.0",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "github:software-mansion/react-native-screens#1d8ab85967e1285b7191c4f65d7e54ea77e0fd94",
"react-native-screens": "^3.29.0",
"react-native-sensors": "^7.3.6",
"react-native-shadow-2": "^7.0.7",
"react-native-svg": "13.9.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/CreateShortsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Image } from "expo-image";
import * as MediaLibrary from "expo-media-library";
import { Button, ScrollView, Stack, View, XStack, YStack, useWindowDimensions } from "tamagui";

import { isAndroid } from "@/constants/platform";
import { IS_ANDROID } from "@/constants";
import { useColors } from "@/hooks/use-colors";
import { useCreateShots } from "@/hooks/use-create-shots";
import { useIsLogin } from "@/hooks/use-is-login";
Expand Down Expand Up @@ -190,7 +190,7 @@ export const CreateShortsButton: FC = () => {
}, containerAnimStyle]}
>
<Animated.View style={[actionsContainerAnimStyle, { width: targetWidth, height: targetHeight, position: "absolute", borderRadius: 10, padding: 12 }]}>
<BlurView tint="dark" intensity={isAndroid ? 10 : 30} style={StyleSheet.absoluteFillObject}/>
<BlurView tint="dark" intensity={IS_ANDROID ? 10 : 30} style={StyleSheet.absoluteFillObject}/>
<XStack flex={1} gap={6}>
<XStack flex={1} >
<ScrollView ref={scrollViewRef} flex={1}>
Expand Down
3 changes: 2 additions & 1 deletion src/components/FeedList/FeedListItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { SizableText, Stack, Text, XStack } from "tamagui";

import { Avatar } from "@/components/Avatar";
import { Center } from "@/components/Base/Center";
import { IS_IOS } from "@/constants";
import { bgsReversed } from "@/constants/bgs";
import { useCoverImage } from "@/hooks/use-cover-image";
import { useImageSize } from "@/hooks/use-image-size";
Expand Down Expand Up @@ -120,7 +121,7 @@ export const FeedListItem: FC<Props> = (props) => {
style={{ height: "100%", width: "100%", position: "absolute" }}
contentFit="cover"
/>
<BlurView tint="light" intensity={10} style={{ position: "absolute", width: "100%", height: "100%" }} />
{IS_IOS && <BlurView tint="light" intensity={10} style={{ position: "absolute", width: "100%", height: "100%" }} />}
<SizableText
size={"$5"}
fontWeight={"700"}
Expand Down
8 changes: 0 additions & 8 deletions src/constants/platform.ts

This file was deleted.

8 changes: 4 additions & 4 deletions src/hooks/use-navigation.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { useNavigation } from "@react-navigation/native";
import type { StackNavigationProp } from "@react-navigation/stack";
import type { NativeStackNavigationProp } from "@react-navigation/native-stack";

import type { HomeBottomTabsParamList, RootStackParamList, SettingsStackParamList } from "@/navigation/types";

export const useRootNavigation = () => (
useNavigation<StackNavigationProp<RootStackParamList>>()
useNavigation<NativeStackNavigationProp<RootStackParamList>>()
);

export const useHomeNavigation = () => (
useNavigation<StackNavigationProp<HomeBottomTabsParamList>>()
useNavigation<NativeStackNavigationProp<HomeBottomTabsParamList>>()
);

export const useSettingsNavigation = () => (
useNavigation<StackNavigationProp<SettingsStackParamList>>()
useNavigation<NativeStackNavigationProp<SettingsStackParamList>>()
);
4 changes: 2 additions & 2 deletions src/navigation/settings.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from "react";
import { useTranslation } from "react-i18next";

import { createStackNavigator } from "@react-navigation/stack";
import { createNativeStackNavigator } from "@react-navigation/native-stack";

import { Advanced } from "@/pages/Advanced";
import { Settings } from "@/pages/Settings";

import type { SettingsStackParamList } from "./types";

const SettingsStack = createStackNavigator<SettingsStackParamList>();
const SettingsStack = createNativeStackNavigator<SettingsStackParamList>();

export const SettingsNavigator = () => {
const i18n = useTranslation("common");
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Explore/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import type { CharacterEntity } from "crossbell";
import { Text, ListItem, SizableText, Stack, XStack, YStack, Spinner } from "tamagui";

import { Avatar } from "@/components/Avatar";
import { isAndroid } from "@/constants/platform";
import { IS_ANDROID } from "@/constants";
import { useNavigateToUserInfo } from "@/hooks/use-navigate-to-user-info";
import { useRootNavigation } from "@/hooks/use-navigation";
import type { HomeBottomTabsParamList, RootStackParamList } from "@/navigation/types";
import type { RootStackParamList } from "@/navigation/types";
import { useGetShowcase } from "@/queries/home";
import { GA } from "@/utils/GA";

Expand Down Expand Up @@ -43,7 +43,7 @@ export const ExplorePage: FC<NativeStackScreenProps<RootStackParamList, "Explore
}, []);

return (
<SafeAreaView edges={["top"]} style={{ flex: 1, paddingTop: isAndroid ? 12 : 0 }} >
<SafeAreaView edges={["top"]} style={{ flex: 1, paddingTop: IS_ANDROID ? 12 : 0 }} >
<XStack
onPress={(e) => {
e.preventDefault();
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Feed/HeaderAnimatedLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { SharedValue } from "react-native-reanimated";
import Animated, { Extrapolation, interpolate, useAnimatedStyle } from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context";

import { isIOS } from "@/constants/platform";
import { IS_IOS } from "@/constants";
import { useDrawer } from "@/hooks/use-drawer";

import type { ShortsSearchType, PostSearchType } from "./feedTypes";
Expand All @@ -16,7 +16,7 @@ export interface Props {
}

export const homeTabHeaderHeight = 55;
export const extraGapBetweenIOSAndAndroid = isIOS ? 0 : 18;
export const extraGapBetweenIOSAndAndroid = IS_IOS ? 0 : 18;

export const HeaderAnimatedLayout: FC<PropsWithChildren<Props>> = (props) => {
const { expanded, children } = props;
Expand Down
6 changes: 2 additions & 4 deletions src/pages/PostDetails/Navigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,18 @@ import * as Sentry from "sentry-expo";
import type { StackProps } from "tamagui";
import { useWindowDimensions, Button, Spacer, H4, SizableText, Stack, XStack, YStack, Circle } from "tamagui";

import type { AlertDialogInstance } from "@/components/AlertDialog";
import { AlertDialog } from "@/components/AlertDialog";
import { AutoFillImage } from "@/components/AutoFillImage";
import type { BottomSheetModalInstance } from "@/components/BottomSheetModal";
import { BottomSheetModal } from "@/components/BottomSheetModal";
import { XTouch } from "@/components/XTouch";
import { isAndroid } from "@/constants/platform";
import { IS_ANDROID } from "@/constants";
import { useColors } from "@/hooks/use-colors";
import { useGlobalLoading } from "@/hooks/use-global-loading";
import { useHitSlopSize } from "@/hooks/use-hit-slop-size";
import { useToggle } from "@/hooks/use-toggle";
import { useGetPage } from "@/queries/page";
import { useGetSite } from "@/queries/site";
import type { ExpandedNote } from "@/types/crossbell";
import { GA } from "@/utils/GA";
import { getNoteSlug } from "@/utils/get-slug";
import { getTwitterShareUrl } from "@/utils/helpers";
Expand Down Expand Up @@ -191,7 +189,7 @@ export const Navigator: FC<Props> = (props) => {
}
};

const topPos = top + (isAndroid ? 15 : 5);
const topPos = top + (IS_ANDROID ? 15 : 5);

return (
<>
Expand Down
5 changes: 2 additions & 3 deletions src/pages/Profile/Posts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { ScrollView } from "react-native";

import { useAccountState } from "@crossbell/react-account";
import { useNavigation } from "@react-navigation/native";
import type { NativeStackScreenProps } from "@react-navigation/native-stack";
import type { StackNavigationProp } from "@react-navigation/stack";
import type { NativeStackNavigationProp, NativeStackScreenProps } from "@react-navigation/native-stack";
import { Newspaper } from "@tamagui/lucide-icons";
import { ListItem, Separator, SizableText, Tabs, YGroup, Spinner, Stack } from "tamagui";

Expand Down Expand Up @@ -47,7 +46,7 @@ export const PostsPage: FC<NativeStackScreenProps<RootStackParamList, "Posts">>
const handle = computed?.account?.character?.handle;
const characterId = computed?.account?.characterId;
const date = useDate();
const navigation = useNavigation<StackNavigationProp<RootStackParamList>>();
const navigation = useNavigation<NativeStackNavigationProp<RootStackParamList>>();

const pages = useGetPagesBySiteLite({
type: "post",
Expand Down
4 changes: 2 additions & 2 deletions src/pages/UserInfo/PostsListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Dimensions, StyleSheet } from "react-native";
import { ScrollView, TouchableOpacity } from "react-native-gesture-handler";

import { useNavigation } from "@react-navigation/native";
import type { StackNavigationProp } from "@react-navigation/stack";
import type { NativeStackNavigationProp } from "@react-navigation/native-stack";
import { Image } from "expo-image";
import removeMd from "remove-markdown";
import { Card, H5, Paragraph, SizableText, Spacer, Text, XStack } from "tamagui";
Expand All @@ -27,7 +27,7 @@ const { width } = Dimensions.get("window");
export const PostsListItem: FC<Props> = (props) => {
const { note } = props;
const date = useDate();
const navigation = useNavigation<StackNavigationProp<RootStackParamList>>();
const navigation = useNavigation<NativeStackNavigationProp<RootStackParamList>>();
const i18n = useTranslation();
const [displayImageUris, setDisplayImageUris] = React.useState<string[]>([]);
const onPress = React.useCallback(() => {
Expand Down
5 changes: 3 additions & 2 deletions src/providers/global-state-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useCallback, useMemo } from "react";
import { View } from "react-native";

import { View } from "tamagui";

import { GlobalStateContext } from "@/context/global-state-context";
import { useScrollVisibilityHandler } from "@/hooks/use-scroll-visibility-handler";
Expand Down Expand Up @@ -40,7 +41,7 @@ export function GlobalStateProvider({ children }: GlobalStateProviderProps) {

return (
<GlobalStateContext.Provider value={{ homeFeed, language, dimensions, setLanguage }}>
<View style={{ flex: 1 }} onLayout={updateDimensions}>
<View flex={1} onLayout={updateDimensions} backgroundColor={"$background"}>
{dimensions && children}
</View>
</GlobalStateContext.Provider>
Expand Down
4 changes: 2 additions & 2 deletions src/utils/explorer-utils.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Alert, Linking } from "react-native";

import { IS_ANDROID } from "@/constants";
import { WALLET_PROJECT_ID } from "@/constants/env";
import { isAndroid } from "@/constants/platform";
import InstalledAppModule from "@/modules/InstalledAppModule";
import type { WalletInfo } from "@/types/api";

Expand All @@ -12,7 +12,7 @@ export async function isAppInstalled(
appScheme?: string | null,
): Promise<boolean> {
return await InstalledAppModule.isAppInstalled(
isAndroid ? applicationId : appScheme,
IS_ANDROID ? applicationId : appScheme,
);
}

Expand Down
24 changes: 8 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4133,15 +4133,6 @@
dependencies:
nanoid "^3.1.23"

"@react-navigation/stack@^6.3.17":
version "6.3.17"
resolved "https://registry.npmmirror.com/@react-navigation/stack/-/stack-6.3.17.tgz#dd3375916a2adaa130659c0113fe05939bc19470"
integrity sha512-8/8ZvJROK3fp6PRmQ9MrXd9epBowA8NkfCaWW/N9H5arqwNX9lTXAkmcjicRhjpX+UNlMBR9dTLkWvPRe2vY9A==
dependencies:
"@react-navigation/elements" "^1.3.18"
color "^4.2.3"
warn-once "^0.1.0"

"@resolver-engine/core@^0.3.3":
version "0.3.3"
resolved "https://registry.npmjs.org/@resolver-engine/core/-/core-0.3.3.tgz#590f77d85d45bc7ecc4e06c654f41345db6ca967"
Expand Down Expand Up @@ -10555,10 +10546,10 @@ expo-asset@~8.10.1:
path-browserify "^1.0.0"
url-parse "^1.5.9"

expo-blur@~12.4.1:
version "12.4.1"
resolved "https://registry.npmmirror.com/expo-blur/-/expo-blur-12.4.1.tgz#b391de84914ef9ece0702378e51e09461ad565ab"
integrity sha512-lGN8FS9LuGUlEriULTC62cCWyg5V7zSVQeJ6Duh1wSq8aAETinZ2/7wrT6o+Uhd/XVVxFNON2T25AGCOtMG6ew==
expo-blur@~12.9.0:
version "12.9.0"
resolved "https://registry.npmjs.org/expo-blur/-/expo-blur-12.9.0.tgz#e35067e211678484ae974b06f95ea9c7e7505aec"
integrity sha512-An7GJ4Ph/Ub1jdHia30gAw0DAqC0ZvmmXfH+zyOx4H4eKARykq38bvuQpED7f/J/4JqL+D14lvn7/wKcfgVZqQ==

expo-build-properties@~0.8.3:
version "0.8.3"
Expand Down Expand Up @@ -16828,9 +16819,10 @@ react-native-safe-modules@^1.0.3:
dependencies:
dedent "^0.6.0"

"react-native-screens@github:software-mansion/react-native-screens#1d8ab85967e1285b7191c4f65d7e54ea77e0fd94":
version "3.22.1"
resolved "https://codeload.github.com/software-mansion/react-native-screens/tar.gz/1d8ab85967e1285b7191c4f65d7e54ea77e0fd94"
react-native-screens@^3.29.0:
version "3.29.0"
resolved "https://registry.npmjs.org/react-native-screens/-/react-native-screens-3.29.0.tgz#1dee0326defbc1d4ef4e68287abb32a8e6b76b29"
integrity sha512-yB1GoAMamFAcYf4ku94uBPn0/ani9QG7NdI98beJ5cet2YFESYYzuEIuU+kt+CNRcO8qqKeugxlfgAa3HyTqlg==
dependencies:
react-freeze "^1.0.0"
warn-once "^0.1.0"
Expand Down

0 comments on commit 787e10c

Please sign in to comment.