-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
253 additions
and
120 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
// https://docs.expo.dev/guides/using-eslint/ | ||
module.exports = { | ||
extends: ["expo", "prettier"], | ||
plugins: ["prettier"], | ||
plugins: ["prettier", "plugin:import/typescript"], | ||
rules: { | ||
"prettier/prettier": "error", | ||
}, | ||
settings: { | ||
"import/resolver": { | ||
typescript: {}, | ||
}, | ||
}, | ||
}; |
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,49 +1,46 @@ | ||
import { StyleSheet } from "react-native"; | ||
import { Box, HStack, Icon, Text } from "@ironfish/tackle-box"; | ||
import { SafeAreaView } from "react-native-safe-area-context"; | ||
import Svg, { RadialGradient, Rect, Stop } from "react-native-svg"; | ||
import { | ||
Box, | ||
HStack, | ||
Icon, | ||
IconButton, | ||
Text, | ||
VStack, | ||
} from "@ironfish/tackle-box"; | ||
import { SafeAreaGradient } from "@/components/SafeAreaGradient/SafeAreaGradient"; | ||
|
||
const GRADIENT_COLORS = ["#DE83F0", "#FFC2E8"]; | ||
|
||
export default function Balances() { | ||
return ( | ||
<SafeAreaView style={styles.safeArea} edges={["top", "bottom"]}> | ||
<Svg style={[StyleSheet.absoluteFill, styles.svg]}> | ||
<RadialGradient | ||
id="gradient" | ||
cx="50%" | ||
cy="50%" | ||
rx="80px" | ||
ry="160px" | ||
gradientUnits="userSpaceOnUse" | ||
> | ||
<Stop offset="0" stopColor={GRADIENT_COLORS[0]} /> | ||
<Stop offset="1" stopColor={GRADIENT_COLORS[1]} /> | ||
</RadialGradient> | ||
<Rect x="0" y="0" width="100%" height="100%" fill="url(#gradient)" /> | ||
</Svg> | ||
<SafeAreaGradient from={GRADIENT_COLORS[0]} to={GRADIENT_COLORS[1]}> | ||
<NavBar /> | ||
|
||
<HStack> | ||
<Icon name="hamburger-menu" /> | ||
<Text size="lg">Account 1</Text> | ||
<Icon name="gear" /> | ||
</HStack> | ||
<VStack alignItems="center"> | ||
<Text size="3xl">100.55</Text> | ||
<Text size="lg">IRON</Text> | ||
|
||
<Box bg="white" mt={40}> | ||
<Text size="lg">Balance</Text> | ||
</Box> | ||
</SafeAreaView> | ||
<HStack py={8} px={6}> | ||
<IconButton label="Receive" icon="arrow-receive" /> | ||
<IconButton label="Send" icon="arrow-send" /> | ||
<IconButton label="Bridge" icon="arrows-bridge" /> | ||
</HStack> | ||
</VStack> | ||
|
||
<Box bg="background" flexGrow={1} /> | ||
</SafeAreaGradient> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
safeArea: { | ||
flex: 1, | ||
backgroundColor: "lightblue", | ||
}, | ||
svg: { | ||
height: "100%", | ||
width: "100%", | ||
zIndex: -1, | ||
}, | ||
}); | ||
function NavBar() { | ||
return ( | ||
<HStack alignItems="center" px={4} py={6}> | ||
<Icon name="hamburger-menu" /> | ||
<Box flexGrow={1}> | ||
<Text size="lg" textAlign="center"> | ||
Account 1 | ||
</Text> | ||
</Box> | ||
<Icon name="gear" /> | ||
</HStack> | ||
); | ||
} |
64 changes: 64 additions & 0 deletions
64
packages/mobile-app/components/SafeAreaGradient/SafeAreaGradient.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,64 @@ | ||
import { ReactNode } from "react"; | ||
import { type Edges, SafeAreaView } from "react-native-safe-area-context"; | ||
import { StyleSheet, View } from "react-native"; | ||
import Svg, { RadialGradient, Rect, Stop } from "react-native-svg"; | ||
|
||
type Props = { | ||
from: string; | ||
to: string; | ||
children: ReactNode; | ||
edges?: Edges; | ||
}; | ||
|
||
export function SafeAreaGradient({ | ||
from, | ||
to, | ||
children, | ||
edges = ["top"], | ||
}: Props) { | ||
return ( | ||
<SafeAreaView | ||
edges={edges} | ||
style={[ | ||
styles.safeArea, | ||
{ | ||
backgroundColor: to, | ||
}, | ||
]} | ||
> | ||
<View style={styles.svgContainer}> | ||
<Svg style={StyleSheet.absoluteFillObject}> | ||
<RadialGradient | ||
id="gradient" | ||
cx="50%" | ||
cy="50%" | ||
rx="50%" | ||
ry="50%" | ||
gradientUnits="userSpaceOnUse" | ||
> | ||
<Stop offset="0" stopColor={from} /> | ||
<Stop offset="1" stopColor={to} /> | ||
</RadialGradient> | ||
<Rect x="0" y="0" width="100%" height="100%" fill="url(#gradient)" /> | ||
</Svg> | ||
</View> | ||
{children} | ||
</SafeAreaView> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
safeArea: { | ||
flex: 1, | ||
}, | ||
svgContainer: { | ||
position: "absolute", | ||
top: 140, | ||
left: 0, | ||
width: "100%", | ||
aspectRatio: 1, | ||
zIndex: -1, | ||
flexDirection: "row", | ||
justifyContent: "center", | ||
}, | ||
}); |
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
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.