-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Release v0.3.0-beta.0 (#2411)
- Loading branch information
Showing
154 changed files
with
4,910 additions
and
1,338 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 { DOMProps } from "expo/dom" | ||
import type { FC } from "react" | ||
|
||
declare global { | ||
export type WebComponent<P = object> = FC<P & { dom?: DOMProps }> | ||
} | ||
export {} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: { | ||
config: "./tailwind.dom.config.ts", | ||
}, | ||
autoprefixer: {}, | ||
}, | ||
} |
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,5 @@ | ||
import { Animated, FlatList, ScrollView, TouchableOpacity } from "react-native" | ||
|
||
export const AnimatedScrollView = Animated.createAnimatedComponent(ScrollView) | ||
export const AnimatedFlatList = Animated.createAnimatedComponent(FlatList) | ||
export const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity) |
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,103 @@ | ||
import { cn } from "@follow/utils/src/utils" | ||
import { useRef } from "react" | ||
import { Pressable } from "react-native" | ||
import Animated, { | ||
interpolateColor, | ||
useAnimatedStyle, | ||
useSharedValue, | ||
withDelay, | ||
withTiming, | ||
} from "react-native-reanimated" | ||
import { useEventCallback } from "usehooks-ts" | ||
|
||
import { CheckFilledIcon } from "@/src/icons/check_filled" | ||
import { Copy2CuteReIcon } from "@/src/icons/copy_2_cute_re" | ||
import { useColor } from "@/src/theme/colors" | ||
|
||
type Size = "sm" | "md" | "tiny" | ||
interface CopyButtonProps { | ||
onCopy: () => void | ||
className?: string | ||
size?: Size | ||
} | ||
|
||
const sizeClassNames = { | ||
tiny: "size-6", | ||
sm: "size-8", | ||
md: "size-10", | ||
} | ||
|
||
const sizeIconSize = { | ||
tiny: 14, | ||
sm: 18, | ||
md: 20, | ||
} | ||
|
||
const AnimatedPressable = Animated.createAnimatedComponent(Pressable) | ||
export const CopyButton = ({ onCopy, className, size = "sm" }: CopyButtonProps) => { | ||
const initialIconScale = useSharedValue(1) | ||
const pressedIconScale = useSharedValue(0) | ||
const initialStyle = useAnimatedStyle(() => ({ | ||
transform: [{ scale: initialIconScale.value }], | ||
})) | ||
|
||
const initialBgColor = useColor("gray3") | ||
const pressedBgColor = useColor("green") | ||
|
||
const pressedStyle = useAnimatedStyle(() => ({ | ||
position: "absolute", | ||
transform: [{ scale: pressedIconScale.value }], | ||
})) | ||
|
||
const wrapperStyle = useAnimatedStyle(() => ({ | ||
backgroundColor: interpolateColor( | ||
pressedIconScale.value, | ||
[0, 1], | ||
[initialBgColor, pressedBgColor], | ||
), | ||
})) | ||
|
||
const animatedProgressingRef = useRef(false) | ||
const handlePress = useEventCallback(() => { | ||
onCopy() | ||
|
||
if (animatedProgressingRef.current) return | ||
animatedProgressingRef.current = true | ||
initialIconScale.value = withTiming(0, { duration: 100 }, () => { | ||
pressedIconScale.value = withTiming(1, { duration: 100 }, () => { | ||
pressedIconScale.value = withDelay( | ||
1000, | ||
withTiming(0, { duration: 100 }, () => { | ||
initialIconScale.value = withTiming(1, { duration: 100 }) | ||
}), | ||
) | ||
}) | ||
}) | ||
|
||
setTimeout( | ||
() => { | ||
animatedProgressingRef.current = false | ||
}, | ||
100 + 100 + 1000 + 100 + 100, | ||
) | ||
}) | ||
return ( | ||
<AnimatedPressable | ||
hitSlop={10} | ||
style={wrapperStyle} | ||
className={cn( | ||
"bg-gray-4 items-center justify-center rounded-lg", | ||
sizeClassNames[size], | ||
className, | ||
)} | ||
onPress={handlePress} | ||
> | ||
<Animated.View style={initialStyle}> | ||
<Copy2CuteReIcon color="#fff" height={sizeIconSize[size]} width={sizeIconSize[size]} /> | ||
</Animated.View> | ||
<Animated.View style={pressedStyle}> | ||
<CheckFilledIcon color="#fff" height={sizeIconSize[size]} width={sizeIconSize[size]} /> | ||
</Animated.View> | ||
</AnimatedPressable> | ||
) | ||
} |
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 |
---|---|---|
|
@@ -11,6 +11,6 @@ const node = ( | |
}} | ||
/> | ||
) | ||
export const HeaderBlur = () => { | ||
export const BlurEffect = () => { | ||
return node | ||
} |
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,14 @@ | ||
"use dom" | ||
import "@follow/components/assets/colors-media.css" | ||
import "@follow/components/assets/tailwind.css" | ||
|
||
import type { HtmlProps } from "@follow/components" | ||
import { Html } from "@follow/components" | ||
|
||
export default function HtmlRender({ | ||
content, | ||
dom, | ||
...options | ||
}: { dom?: import("expo/dom").DOMProps } & HtmlProps) { | ||
return <Html content={content} {...options} /> | ||
} |
18 changes: 18 additions & 0 deletions
18
apps/mobile/src/components/common/ModalSharedComponents.tsx
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,18 @@ | ||
import { router } from "expo-router" | ||
import { TouchableOpacity } from "react-native" | ||
|
||
import { CloseCuteReIcon } from "@/src/icons/close_cute_re" | ||
import { useColor } from "@/src/theme/colors" | ||
|
||
export const ModalHeaderCloseButton = () => { | ||
return <ModalHeaderCloseButtonImpl /> | ||
} | ||
|
||
const ModalHeaderCloseButtonImpl = () => { | ||
const label = useColor("label") | ||
return ( | ||
<TouchableOpacity onPress={() => router.dismiss()}> | ||
<CloseCuteReIcon color={label} /> | ||
</TouchableOpacity> | ||
) | ||
} |
20 changes: 20 additions & 0 deletions
20
apps/mobile/src/components/common/SafeNavigationScrollView.tsx
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,20 @@ | ||
import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs" | ||
import { useHeaderHeight } from "@react-navigation/elements" | ||
import type { FC } from "react" | ||
import type { ScrollViewProps } from "react-native" | ||
import { ScrollView, View } from "react-native" | ||
import { useSafeAreaInsets } from "react-native-safe-area-context" | ||
|
||
export const SafeNavigationScrollView: FC<ScrollViewProps> = ({ children, ...props }) => { | ||
const headerHeight = useHeaderHeight() | ||
const tabBarHeight = useBottomTabBarHeight() | ||
const insets = useSafeAreaInsets() | ||
|
||
return ( | ||
<ScrollView contentInsetAdjustmentBehavior="automatic" {...props}> | ||
<View style={{ height: headerHeight - insets.top }} /> | ||
<View>{children}</View> | ||
<View style={{ height: tabBarHeight - insets.bottom }} /> | ||
</ScrollView> | ||
) | ||
} |
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,20 @@ | ||
import { cn } from "@follow/utils/src/utils" | ||
import type { FC, PropsWithChildren } from "react" | ||
import type { StyleProp, ViewStyle } from "react-native" | ||
import { Text, View } from "react-native" | ||
|
||
export const FormLabel: FC< | ||
PropsWithChildren<{ | ||
label: string | ||
optional?: boolean | ||
className?: string | ||
style?: StyleProp<ViewStyle> | ||
}> | ||
> = ({ label, optional, className, style }) => { | ||
return ( | ||
<View className={cn("flex-row", className)} style={style}> | ||
<Text className="text-label font-medium capitalize">{label}</Text> | ||
{!optional && <Text className="text-red ml-1 align-sub">*</Text>} | ||
</View> | ||
) | ||
} |
Oops, something went wrong.