Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat: add custom snooze dates and durations #11800

Mergedjuliusmarmingemerged 9 commits intomain fromrefs/pull/11800/headmerged by juliusmarminge View on GitHub

Showing 17 changed files with 74 additions and 0 deletions (loading 15).

x
0 of 17 viewed, 17 left
74 additions and 0 deletionsapps/mobile/src/components/SegmentedControl.tsxAdded
View file
@@ -0,0 +1,74 @@
+import { Platform, Pressable, View } from "react-native";
+import Animated, { Easing, LinearTransition, ReduceMotion } from "react-native-reanimated";
+import { AppText as Text } from "./AppText";
+import { cn } from "../lib/cn";
+​
+export function SegmentedControl<Value extends number | string>(props: {
+ readonly options: readonly {
+ readonly value: Value;
+ readonly label: string;
+ readonly accessibilityLabel?: string;
+ }[];
+ readonly selected: Value;
+ readonly onSelect: (value: Value) => void;
+ /** The tab bar is full height; filters under it are shorter so it stays primary. */
+ readonly size?: "default" | "compact";
+ /** "tab" for the view switcher; filters stay plain buttons. */
+ readonly role?: "tab" | "button";
+ readonly className?: string;
+}) {
+ const compact = props.size === "compact";
+ return (
+ <View
+ accessible={false}
+ className={cn(
+ "flex-row overflow-hidden rounded-full border-continuous bg-card",
+ props.className,
+ )}
+ >
+ <Animated.View
+ pointerEvents="none"