-
Notifications
You must be signed in to change notification settings - Fork 926
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Innei <tukon479@gmail.com>
- Loading branch information
Showing
13 changed files
with
525 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import type { BlurViewProps } from "expo-blur" | ||
import { BlurView } from "expo-blur" | ||
import { useColorScheme } from "nativewind" | ||
import type { FC } from "react" | ||
import { forwardRef } from "react" | ||
|
||
export const ThemedBlurView: FC<BlurViewProps> = ({ tint, ...rest }) => { | ||
export const ThemedBlurView = forwardRef<BlurView, BlurViewProps>(({ tint, ...rest }, ref) => { | ||
const { colorScheme } = useColorScheme() | ||
return ( | ||
<BlurView | ||
ref={ref} | ||
tint={colorScheme === "light" ? "systemMaterialLight" : "systemMaterialDark"} | ||
{...rest} | ||
/> | ||
) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { cn } from "@follow/utils" | ||
import type { FC, PropsWithChildren } from "react" | ||
import type { ViewProps } from "react-native" | ||
import { Pressable, Text, View } from "react-native" | ||
|
||
import { RightCuteReIcon } from "@/src/icons/right_cute_re" | ||
import { useColor } from "@/src/theme/colors" | ||
|
||
export const GroupedInsetListCard: FC<PropsWithChildren> = ({ children }) => { | ||
return ( | ||
<View className="bg-secondary-system-grouped-background mx-4 flex-1 overflow-hidden rounded-[10px]"> | ||
{children} | ||
</View> | ||
) | ||
} | ||
|
||
export const GroupedInsetListSectionHeader: FC<{ | ||
label: string | ||
}> = ({ label }) => { | ||
return ( | ||
<View className="mx-4 h-[23px] px-5"> | ||
<Text className="text-secondary-label" ellipsizeMode="tail" numberOfLines={1}> | ||
{label} | ||
</Text> | ||
</View> | ||
) | ||
} | ||
|
||
export const GroupedInsetListItem: FC<PropsWithChildren & ViewProps> = ({ children, ...props }) => { | ||
return ( | ||
<View {...props} className={cn("px-5 py-4", props.className)}> | ||
{children} | ||
</View> | ||
) | ||
} | ||
|
||
export const GroupedInsetListNavigationLink: FC<{ | ||
label: string | ||
icon?: React.ReactNode | ||
onPress: () => void | ||
}> = ({ label, icon, onPress }) => { | ||
const tertiaryLabelColor = useColor("tertiaryLabel") | ||
|
||
return ( | ||
<Pressable onPress={onPress}> | ||
{({ pressed }) => ( | ||
<GroupedInsetListItem className={cn(pressed && "bg-system-fill")}> | ||
<View className={"flex-row items-center"}> | ||
<View className="flex-row items-center"> | ||
{icon} | ||
<Text>{label}</Text> | ||
</View> | ||
<View className="-mr-2 ml-auto"> | ||
<RightCuteReIcon height={20} width={20} color={tertiaryLabelColor} /> | ||
</View> | ||
</View> | ||
</GroupedInsetListItem> | ||
)} | ||
</Pressable> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { createContext } from "react" | ||
import type { SharedValue } from "react-native-reanimated" | ||
|
||
interface TabBarBackgroundContextType { | ||
opacity: SharedValue<number> | ||
} | ||
|
||
export const TabBarBackgroundContext = createContext<TabBarBackgroundContextType>({ | ||
opacity: null!, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { View } from "react-native" | ||
|
||
import { | ||
GroupedInsetListCard, | ||
GroupedInsetListNavigationLink, | ||
} from "@/src/components/ui/grouped/GroupedList" | ||
|
||
import { useSettingsNavigation } from "./hooks" | ||
|
||
export const SettingsList = () => { | ||
const navigation = useSettingsNavigation() | ||
|
||
return ( | ||
<View className="bg-system-grouped-background flex-1 py-4"> | ||
<GroupedInsetListCard> | ||
<GroupedInsetListNavigationLink | ||
label="Account" | ||
onPress={() => { | ||
navigation.navigate("Account") | ||
}} | ||
/> | ||
</GroupedInsetListCard> | ||
</View> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Image, Text, View } from "react-native" | ||
import { useSafeAreaInsets } from "react-native-safe-area-context" | ||
|
||
import { useWhoami } from "@/src/store/user/hooks" | ||
|
||
export const UserHeaderBanner = () => { | ||
const whoami = useWhoami() | ||
const insets = useSafeAreaInsets() | ||
|
||
if (!whoami) return null | ||
return ( | ||
<View className="h-[200px] items-center justify-center" style={{ marginTop: -insets.top }}> | ||
<View | ||
className="bg-system-background overflow-hidden rounded-full" | ||
style={{ marginTop: insets.top }} | ||
> | ||
{!!whoami.image && ( | ||
<Image source={{ uri: whoami.image, height: 60, width: 60 }} resizeMode="cover" /> | ||
)} | ||
</View> | ||
|
||
<View className="mt-2"> | ||
<Text className="text-2xl font-bold">{whoami.name}</Text> | ||
{!!whoami.handle && <Text className="text-secondary-label">@{whoami.handle}</Text>} | ||
</View> | ||
</View> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { useNavigation } from "@react-navigation/native" | ||
import type { NativeStackNavigationProp } from "@react-navigation/native-stack" | ||
|
||
type RootStackParamList = { | ||
Account: undefined | ||
} | ||
|
||
export const useSettingsNavigation = () => { | ||
return useNavigation<NativeStackNavigationProp<RootStackParamList>>() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Text, View } from "react-native" | ||
|
||
export const AccountScreen = () => { | ||
return ( | ||
<View> | ||
<Text>Account</Text> | ||
</View> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type { createNativeStackNavigator } from "@react-navigation/native-stack" | ||
|
||
import { AccountScreen } from "./Account" | ||
|
||
export const SettingRoutes = (Stack: ReturnType<typeof createNativeStackNavigator>) => { | ||
return [<Stack.Screen key="Account" name="Account" component={AccountScreen} />] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.