Skip to content

Commit d7160f6

Browse files
committed
refactor: Remove navigation prop from SettWrapper in multiple components for consistency
1 parent 2e1628e commit d7160f6

35 files changed

+38
-39
lines changed

.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
- Do not add unnecessary comments for my understanding.
44

55
- Icons are used from hugeicons if you want to add extra icons to the library, you can add it running `ic-old iconName` command.
6-
`iconName` is from the hugeicons website.
6+
`iconName` is from the hugeicons website.
77

8-
- No need to fix formatting related issues.
8+
- No need to fix formatting related issues.

src/components/RoundNotification.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default function RoundNotification({ n }: { n: number }) {
55
if (n === 0) return null
66
return (
77
<View className='items-center justify-center rounded-full bg-red-500' style={{ height: 22, width: 22 }}>
8-
<SemiBold className='text-xs text-white pt-0.5' numberOfLines={1}>
8+
<SemiBold className='pt-0.5 text-xs text-white' numberOfLines={1}>
99
{n}
1010
</SemiBold>
1111
</View>

src/components/Settings/SettWrapper.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ import { Gap20 } from '@components/Gap'
33
import KeyboardAvoid from '@components/KeyboardAvoid'
44
import { PaddingBottom } from '@components/SafePadding'
55
import { AutoStatusBar } from '@components/StatusBar'
6+
import { useNavigation } from '@react-navigation/native'
67
import { StackNav } from '@utils/types'
78
import React from 'react'
89
import { ScrollViewProps, useColorScheme, View } from 'react-native'
910

1011
type SettWrapperProps = ScrollViewProps & {
1112
Header?: React.ReactNode
1213
title?: string
13-
navigation?: StackNav
1414
}
15-
export default function SettWrapper({ Header, title, navigation, children, ...rest }: SettWrapperProps) {
15+
export default function SettWrapper({ Header, title, children, ...rest }: SettWrapperProps) {
16+
const navigation = useNavigation<StackNav>()
1617
const scheme = useColorScheme()
1718
return (
1819
<View className='bg flex-1'>

src/screens/CoordinateNotes/CoordinateNote.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default function CoordinateNote({ navigation, route }: CoordinateNoteProp
7777

7878
return (
7979
<>
80-
<SettWrapper navigation={navigation} title={name || 'Location Note'}>
80+
<SettWrapper title={name || 'Location Note'}>
8181
<Gap12 className='mt-3'>
8282
<SettGroup title='Location Name'>
8383
<Input

src/screens/CoordinateNotes/CoordinateNotes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function CoordinateNotes({ navigation }: NavProp) {
1818
const notes = coordinateNotesStore((state) => state.notes)
1919
return (
2020
<>
21-
<SettWrapper navigation={navigation} title='Coordinate Notes'>
21+
<SettWrapper title='Coordinate Notes'>
2222
<NoNotes notes={notes} />
2323
<NotesList notes={notes} />
2424
</SettWrapper>

src/screens/CoordinateNotes/LocationTags.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ export default function LocationTags() {
1010
<StatusBar barStyle='default' />
1111
<AppBar />
1212
<ScrollView contentContainerClassName='p-5 flex-1 justify-center items-center'>
13-
<Bold className='text-3xl text text-center'>Coming Soon!</Bold>
14-
<Medium className='text opacity-80 text-base mt-3 text-center'>This feature is currently under development. Stay tuned for updates!</Medium>
13+
<Bold className='text text-center text-3xl'>Coming Soon!</Bold>
14+
<Medium className='text mt-3 text-center text-base opacity-80'>
15+
This feature is currently under development. Stay tuned for updates!
16+
</Medium>
1517
<PaddingBottom />
1618
</ScrollView>
1719
</View>

src/screens/DeveloperOptions/DeveloperOptions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default function DeveloperOptions({ navigation }: NavProp) {
6767
}
6868

6969
return (
70-
<SettWrapper title='Developer Options' navigation={navigation}>
70+
<SettWrapper title='Developer Options'>
7171
<Gap12>
7272
<SettGroup>
7373
<SettOption

src/screens/DeveloperOptions/MMKVDataEditor.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ export default function MMKVDataEditor({
7272
return (
7373
<>
7474
<SettWrapper
75-
navigation={navigation}
7675
title={isNew ? (key ? key : 'New MMKV data') : key}
7776
Header={
7877
<BackHeader

src/screens/DeveloperOptions/MMKVDataList.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export default function MMKVDataList({ navigation }: NavProp) {
4949
return (
5050
<>
5151
<SettWrapper
52-
navigation={navigation}
5352
Header={
5453
<>
5554
<BackHeader title='MMKV data editor' navigation={navigation} />

src/screens/Example/Skia.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const App = () => {
2828

2929
export default function Skia({ navigation }: NavProp) {
3030
return (
31-
<SettWrapper navigation={navigation} title='Blank Settings'>
31+
<SettWrapper title='Blank Settings'>
3232
<Gap12>
3333
<SettText className='mt-3'>Beginning Text</SettText>
3434
<SettGroup title='Sample title'>

0 commit comments

Comments
 (0)