diff --git a/packages/mobile-app/app/(tabs)/balances.tsx b/packages/mobile-app/app/(tabs)/balances.tsx index 6f4e202..872db87 100644 --- a/packages/mobile-app/app/(tabs)/balances.tsx +++ b/packages/mobile-app/app/(tabs)/balances.tsx @@ -6,16 +6,85 @@ import { Tabs, Text, VStack, + Card, } from "@ironfish/tackle-box"; import { SafeAreaGradient } from "@/components/SafeAreaGradient/SafeAreaGradient"; +import { View } from "react-native"; +import Animated, { + useAnimatedScrollHandler, + useSharedValue, + SharedValue, +} from "react-native-reanimated"; const GRADIENT_COLORS = ["#DE83F0", "#FFC2E8"]; export default function Balances() { + const scrollYOffset = useSharedValue(0); + + const scrollHandler = useAnimatedScrollHandler((event) => { + scrollYOffset.value = event.contentOffset.y; + }); + return ( - + + + + + + + + Assets + Transactions + + + + + + + + + + + + + + Transactions + Transactions + Transactions + Transactions + Transactions + + + + + + + + ); +} +function AccountHeader({ offsetY }: { offsetY: SharedValue }) { + return ( + + + + + + Account 1 + + + + 100.55 IRON @@ -26,52 +95,36 @@ export default function Balances() { + + ); +} - - - - Assets - Transactions - - - - Assets - Assets - Assets - Assets - Assets - - - - - Transactions - Transactions - Transactions - Transactions - Transactions - - - - - +function AssetBadge() { + return ( + ); } -function NavBar() { +function AssetRow() { return ( - - - - - Account 1 - - - - + + + + + $IRON + + 100.55 + + + + + ); } diff --git a/packages/tackle-box/lib/components/Box/Box.tsx b/packages/tackle-box/lib/components/Box/Box.tsx index 0d25ac6..92c962a 100644 --- a/packages/tackle-box/lib/components/Box/Box.tsx +++ b/packages/tackle-box/lib/components/Box/Box.tsx @@ -26,14 +26,19 @@ const styles = css.create({ flexDirection: "column", alignItems: "stretch", justifyContent: "flex-start", + position: "relative", }, backgroundColor: (color?: string) => ({ backgroundColor: color, }), - dimensions: (height: UnitValue, width: UnitValue) => ({ + dimensions: (height?: UnitValue, width?: UnitValue) => ({ height, width, }), + minDimensions: (minHeight?: UnitValue, minWidth?: UnitValue) => ({ + minHeight, + minWidth, + }), margin: ( top: UnitValue, right: UnitValue, @@ -77,21 +82,26 @@ const styles = css.create({ }); export type BoxProps = BorderRadiusArgs & - BorderWidthArgs & { + BorderWidthArgs & + MarginPadding & { children?: ReactNode; height?: UnitValue; width?: UnitValue; + minHeight?: UnitValue; + minWidth?: UnitValue; bg?: Colors; borderColor?: Colors; borderWidth?: number; flexGrow?: number; style?: StyleObj; - } & MarginPadding; + }; export function Box({ children, height = "auto", width = "100%", + minHeight, + minWidth, bg, borderColor, borderRadius = 0, @@ -176,6 +186,7 @@ export function Box({ style={[ styles.base, styles.dimensions(height, width), + styles.minDimensions(minHeight, minWidth), styles.margin(...margin), styles.padding(...padding), styles.borderRadius(borderRadiusValues), diff --git a/packages/tackle-box/lib/components/Card/Card.tsx b/packages/tackle-box/lib/components/Card/Card.tsx new file mode 100644 index 0000000..bdfde0a --- /dev/null +++ b/packages/tackle-box/lib/components/Card/Card.tsx @@ -0,0 +1,72 @@ +import { PropsWithChildren } from "react"; +import { css } from "react-strict-dom"; +import { Box } from "@/components/Box/Box"; +import { MarginPadding } from "@/utils/useMarginPaddingValues"; + +const style = css.create({ + shadowWrapper: { + position: "absolute", + top: 0, + left: 0, + right: 0, + bottom: 0, + }, + content: { + zIndex: 1, + }, +}); + +type CardProps = PropsWithChildren< + MarginPadding & { + active?: boolean; + } +>; + +export function Card({ + children, + active, + m, + mx, + my, + mt, + mr, + mb, + ml, + p = 4, + px, + py, + pt, + pr, + pb, + pl, +}: CardProps) { + return ( + + + {children} + + + + + + ); +} diff --git a/packages/tackle-box/lib/components/Stack/Stack.tsx b/packages/tackle-box/lib/components/Stack/Stack.tsx index 42ea9b1..3155dd3 100644 --- a/packages/tackle-box/lib/components/Stack/Stack.tsx +++ b/packages/tackle-box/lib/components/Stack/Stack.tsx @@ -22,14 +22,12 @@ const styles = css.create({ type StackProps = BoxProps & { gap?: number; - spacing?: number; alignItems?: string; justifyContent?: string; }; export function HStack({ gap = 0, - spacing, alignItems = "stretch", justifyContent = "flex-start", children, @@ -39,7 +37,7 @@ export function HStack({