Skip to content

Commit a5268be

Browse files
committed
Add Skia screen and React icon; update navigation and icon exports
1 parent 59fb597 commit a5268be

File tree

5 files changed

+59
-0
lines changed

5 files changed

+59
-0
lines changed

App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import { Dimensions, SafeAreaView, useColorScheme } from 'react-native'
5656
import { GestureHandlerRootView } from 'react-native-gesture-handler'
5757
import Animated, { ZoomIn, ZoomOut } from 'react-native-reanimated'
5858
import './global.css'
59+
import Skia from '@screens/Example/Skia'
5960

6061
function App(): React.JSX.Element {
6162
const scheme = useColorScheme()
@@ -158,6 +159,7 @@ export type RootStackParamList = {
158159
SJF: undefined
159160
Chart: ChartParamList
160161
Onboarding: undefined
162+
Skia: undefined
161163
}
162164

163165
const Stack = createStackNavigator<RootStackParamList>()
@@ -185,6 +187,7 @@ function Navigation() {
185187
<Stack.Screen name='Home' component={Home} options={SMOOTH_ANIMATION} />
186188
<Stack.Screen name='Test' component={Test} options={GestureEnabled} />
187189
<Stack.Screen name='AllUsers' component={AllUsers} options={GestureEnabled} />
190+
<Stack.Screen name='Skia' component={Skia} options={GestureEnabled} />
188191
{/* <Stack.Screen name='Location' component={Location} /> */}
189192
{/* <Stack.Screen name='CompassAnimation' component={CompassAnimation} /> */}
190193
{/* <Stack.Screen name='ParallaxWallpaper' component={ParallaxWallpaper} /> */}

src/assets/icons/icons.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,4 @@ export { default as AngrySolidIcon } from '@icons/angry-solid-rounded.svg'
138138
export { default as SmileSolidIcon } from '@icons/smile-solid-rounded.svg'
139139
export { default as PlaySolidIcon } from '@icons/play-solid-rounded.svg'
140140
export { default as ReloadIcon } from '@icons/reload-solid-rounded.svg'
141+
export { default as ReactIcon } from '@icons/react-solid-rounded.svg'
Lines changed: 6 additions & 0 deletions
Loading

src/screens/Example/Skia.tsx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { Setting07SolidIcon } from '@assets/icons/icons'
2+
import { Gap12 } from '@components/Gap'
3+
import RoundedIcon from '@components/RoundedIcon'
4+
import SettGroup from '@components/Settings/SettGroup'
5+
import { SettOption } from '@components/Settings/SettOption'
6+
import SettText from '@components/Settings/SettText'
7+
import SettWrapper from '@components/Settings/SettWrapper'
8+
import { Canvas, Circle, Group } from '@shopify/react-native-skia'
9+
import type { NavProp } from '@utils/types'
10+
import { View } from 'react-native'
11+
12+
const App = () => {
13+
const width = 256
14+
const height = 256
15+
const r = width * 0.33
16+
return (
17+
<View className='items-center justify-center p-5'>
18+
<Canvas style={{ width, height }}>
19+
<Group blendMode='multiply'>
20+
<Circle cx={r} cy={r} r={r} color='cyan' />
21+
<Circle cx={width - r} cy={r} r={r} color='magenta' />
22+
<Circle cx={width / 2} cy={width - r} r={r} color='yellow' />
23+
</Group>
24+
</Canvas>
25+
</View>
26+
)
27+
}
28+
29+
export default function Skia({ navigation }: NavProp) {
30+
return (
31+
<SettWrapper navigation={navigation} title='Blank Settings'>
32+
<Gap12>
33+
<SettText className='mt-3'>Beginning Text</SettText>
34+
<SettGroup title='Sample title'>
35+
<SettOption
36+
title='A blank setting'
37+
Icon={<RoundedIcon Icon={Setting07SolidIcon} className='bg-slate-500' />}
38+
arrow
39+
/>
40+
</SettGroup>
41+
<SettText>Sample text</SettText>
42+
</Gap12>
43+
<SettText>End Text</SettText>
44+
<App />
45+
</SettWrapper>
46+
)
47+
}

src/screens/Try/TyrItOut.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
MathSolidIcon,
1313
NeuralNetworkSolidIcon,
1414
PaintBoardSolidIcon,
15+
ReactIcon,
1516
Setting07SolidIcon,
1617
SoftwareLicenseSolidIcon,
1718
TestTube01SolidIcon,
@@ -56,6 +57,7 @@ const tools: Group[] = [
5657
startText: 'Here are some tools related to computer science. You can try them out and see how they work.',
5758
title: 'Tools',
5859
tools: [
60+
{ title: 'RN Skia', Icon: ReactIcon, to: 'Skia', className: 'bg-blue-500' },
5961
{ title: 'Your Age', Icon: Calendar03SolidIcon, to: 'YourAge', className: 'bg-rose-500' },
6062
{ title: 'Random Color', Icon: PaintBoardSolidIcon, to: 'RandomColor', className: 'bg-orange-500' },
6163
{ title: 'Gradient Colors', Icon: ColorsSolidIcon, className: 'bg-green-500' },

0 commit comments

Comments
 (0)