mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
smart dev screen selector (#1421)
* use the actual navigation object instead of an array of strings so that any time we add a screen its automatically available from dev settings. * correct type
This commit is contained in:
@@ -22,7 +22,7 @@ import { useSafeBottomPadding } from '@selfxyz/mobile-sdk-alpha/hooks';
|
||||
import BugIcon from '@/images/icons/bug_icon.svg';
|
||||
import IdIcon from '@/images/icons/id_icon.svg';
|
||||
import WarningIcon from '@/images/icons/warning.svg';
|
||||
import type { RootStackParamList } from '@/navigation';
|
||||
import { navigationScreens, type RootStackParamList } from '@/navigation';
|
||||
import { unsafe_clearSecrets } from '@/providers/authProvider';
|
||||
import { usePassport } from '@/providers/passportDataProvider';
|
||||
import { usePointEventStore } from '@/stores/pointEventStore';
|
||||
@@ -183,40 +183,6 @@ function ParameterSection({
|
||||
);
|
||||
}
|
||||
|
||||
const items = [
|
||||
'DevSettings',
|
||||
'CountryPicker',
|
||||
'DevLoadingScreen',
|
||||
'AadhaarUpload',
|
||||
'DevFeatureFlags',
|
||||
'DevHapticFeedback',
|
||||
'DevPrivateKey',
|
||||
'Splash',
|
||||
'Launch',
|
||||
'DocumentOnboarding',
|
||||
'DocumentCamera',
|
||||
'DocumentNFCScan',
|
||||
'DocumentDataInfo',
|
||||
'Loading',
|
||||
'AccountVerifiedSuccess',
|
||||
'ConfirmBelonging',
|
||||
'CreateMock',
|
||||
'Home',
|
||||
'Disclaimer',
|
||||
'QRCodeViewFinder',
|
||||
'Prove',
|
||||
'ProofRequestStatus',
|
||||
'Referral',
|
||||
'Settings',
|
||||
'AccountRecovery',
|
||||
'SaveRecoveryPhrase',
|
||||
'RecoverWithPhrase',
|
||||
'ShowRecoveryPhrase',
|
||||
'CloudBackupSettings',
|
||||
'ComingSoon',
|
||||
'DocumentCameraTrouble',
|
||||
'DocumentNFCTrouble',
|
||||
] satisfies (keyof RootStackParamList)[];
|
||||
const ScreenSelector = ({}) => {
|
||||
const navigation = useNavigation();
|
||||
const [open, setOpen] = useState(false);
|
||||
@@ -274,16 +240,22 @@ const ScreenSelector = ({}) => {
|
||||
<Select.Group>
|
||||
{useMemo(
|
||||
() =>
|
||||
items.sort().map((item, i) => {
|
||||
return (
|
||||
<Select.Item index={i} key={item} value={item}>
|
||||
<Select.ItemText>{item}</Select.ItemText>
|
||||
<Select.ItemIndicator marginLeft="auto">
|
||||
<Check size={16} />
|
||||
</Select.ItemIndicator>
|
||||
</Select.Item>
|
||||
);
|
||||
}),
|
||||
(
|
||||
Object.keys(
|
||||
navigationScreens,
|
||||
) as (keyof typeof navigationScreens)[]
|
||||
)
|
||||
.sort()
|
||||
.map((item, i) => {
|
||||
return (
|
||||
<Select.Item index={i} key={item} value={item}>
|
||||
<Select.ItemText>{item}</Select.ItemText>
|
||||
<Select.ItemIndicator marginLeft="auto">
|
||||
<Check size={16} />
|
||||
</Select.ItemIndicator>
|
||||
</Select.Item>
|
||||
);
|
||||
}),
|
||||
[],
|
||||
)}
|
||||
</Select.Group>
|
||||
|
||||
Reference in New Issue
Block a user