Skip to content

Commit

Permalink
fix: waitlist with segment
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarkhanzadian committed Dec 9, 2024
1 parent 7c762ef commit 5d06887
Show file tree
Hide file tree
Showing 9 changed files with 193 additions and 154 deletions.
13 changes: 10 additions & 3 deletions apps/mobile/src/app/(home)/hardware-wallets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
NotifyUserSheetData,
NotifyUserSheetLayout,
} from '@/components/sheets/notify-user-sheet.layout';
import { WaitlistIds } from '@/features/waitlist/ids';
import { t } from '@lingui/macro';

import {
Expand All @@ -27,41 +28,47 @@ function getUnavailableFeatures() {
message: 'Bitkey',
}),
icon: <LogoHardwareBitkey />,
id: WaitlistIds.bitkey,
},
capsule: {
title: t({
id: 'hardware_wallets.ledger',
message: 'Ledger',
}),
icon: <LogoHardwareLedger />,
id: WaitlistIds.capsule,
},
copper: {
title: t({
id: 'hardware_wallets.onekey',
message: 'OneKey',
}),
icon: <LogoHardwareOnekey />,
id: WaitlistIds.copper,
},
fireblocks: {
title: t({
id: 'hardware_wallets.passport',
message: 'Passport',
}),
icon: <LogoHardwareFoundation />,
id: WaitlistIds.fireblocks,
},
foredefi: {
title: t({
id: 'hardware_wallets.ryder',
message: 'Ryder',
}),
icon: <LogoHardwareRyder />,
id: WaitlistIds.foredefi,
},
portal: {
title: t({
id: 'hardware_wallets.trezor',
message: 'Trezor',
}),
icon: <LogoHardwareTrezor />,
id: WaitlistIds.portal,
},
};
}
Expand All @@ -88,20 +95,20 @@ export default function HardwareWalletListScreen() {
})}
>
<SettingsList>
{Object.entries(getUnavailableFeatures()).map(featureEntry => {
const [featureKey, feature] = featureEntry;
{Object.values(getUnavailableFeatures()).map(feature => {
const hardwareWalletName = feature.title;
function onPress() {
onOpenSheet({
title: t({
id: 'notify_user.hardware_wallets.header_title',
message: `Connect hardware wallet: ${hardwareWalletName}`,
}),
id: feature.id,
});
}
return (
<SettingsListItem
key={featureKey}
key={feature.id}
title={feature.title}
icon={feature.icon}
onPress={onPress}
Expand Down
16 changes: 13 additions & 3 deletions apps/mobile/src/app/(home)/mpc-wallets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
NotifyUserSheetData,
NotifyUserSheetLayout,
} from '@/components/sheets/notify-user-sheet.layout';
import { WaitlistIds } from '@/features/waitlist/ids';
import { t } from '@lingui/macro';

import {
Expand All @@ -29,55 +30,64 @@ function getUnavailableFeatures() {
message: 'BitGo',
}),
icon: <LogoMpcBitgo />,
id: WaitlistIds.bitgo,
},
capsule: {
title: t({
id: 'mpc_wallets.capsule',
message: 'Capsule',
}),
icon: <LogoMpcCapsule />,
id: WaitlistIds.capsule,
},
copper: {
title: t({
id: 'mpc_wallets.copper',
message: 'Copper',
}),
icon: <LogoMpcCopper />,
id: WaitlistIds.copper,
},
fireblocks: {
title: t({
id: 'mpc_wallets.fireblocks',
message: 'Fireblocks',
}),
icon: <LogoMpcFireblocks />,
id: WaitlistIds.fireblocks,
},
foredefi: {
title: t({
id: 'mpc_wallets.fordefi',
message: 'Fordefi',
}),
icon: <LogoMpcFordefi />,

id: WaitlistIds.foredefi,
},
portal: {
title: t({
id: 'mpc_wallets.portal',
message: 'Portal',
}),
icon: <LogoMpcPortal />,
id: WaitlistIds.portal,
},
privy: {
title: t({
id: 'mpc_wallets.privy',
message: 'Privy',
}),
icon: <LogoMpcPrivy />,
id: WaitlistIds.privy,
},
qredo: {
title: t({
id: 'mpc_wallets.oredo',
message: 'Qredo',
}),
icon: <LogoMpcQredo />,
id: WaitlistIds.qredo,
},
};
}
Expand All @@ -104,12 +114,12 @@ export default function MpcWalletListScreen() {
})}
>
<SettingsList>
{Object.entries(getUnavailableFeatures()).map(featureEntry => {
const [featureKey, feature] = featureEntry;
{Object.values(getUnavailableFeatures()).map(feature => {
const mpcWalletName = feature.title;

function onPress() {
onOpenSheet({
id: feature.id,
title: t({
id: 'notify_user.mpc_wallet.header_title',
message: `Connect Mpc wallet: ${mpcWalletName}`,
Expand All @@ -119,7 +129,7 @@ export default function MpcWalletListScreen() {

return (
<SettingsListItem
key={featureKey}
key={feature.id}
onPress={onPress}
title={feature.title}
icon={feature.icon}
Expand Down
97 changes: 48 additions & 49 deletions apps/mobile/src/app/(home)/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { SettingsListItem } from '@/components/settings/settings-list-item';
import { NotifyUserSheetLayout } from '@/components/sheets/notify-user-sheet.layout';
import { useAuthContext } from '@/components/splash-screen-guard/use-auth-context';
import { NetworkBadge } from '@/features/settings/network-badge';
import { WaitlistIds } from '@/features/waitlist/ids';
import { AppRoutes } from '@/routes';
import { TestId } from '@/shared/test-id';
import { isFeatureEnabled } from '@/utils/feature-flag';
Expand Down Expand Up @@ -119,57 +120,53 @@ export default function SettingsScreen() {
testID={TestId.settingsNotificationsButton}
/>
)}
{isFeatureEnabled() && (
<SettingsListItem
title={t({
id: 'settings.help.cell_title',
message: 'Help',
})}
caption={t({
id: 'settings.help.cell_caption',
message: 'Support, guides and articles',
})}
icon={<SupportIcon />}
onPress={() => router.navigate(AppRoutes.SettingsHelp)}
testID={TestId.settingsHelpButton}
/>
)}
</SettingsList>
{isFeatureEnabled() && (
<Accordion
label={t({
id: 'settings.accordion_label',
message: 'More options',
<SettingsListItem
title={t({
id: 'settings.help.cell_title',
message: 'Help',
})}
testID={TestId.settingsMoreOptionsButton}
content={
<SettingsList>
<SettingsListItem
title={t({
id: 'settings.contacts.cell_title',
message: 'Contacts',
})}
icon={<UsersTwoIcon />}
onPress={() => {
contactsSheetRef.current?.present();
}}
testID={TestId.settingsContactsButton}
/>
<SettingsListItem
title={t({
id: 'settings.fees.cell_title',
message: 'Fees',
})}
icon={<SettingsGearIcon />}
onPress={() => {
feesSheetRef.current?.present();
}}
testID={TestId.settingsFeesButton}
/>
</SettingsList>
}
caption={t({
id: 'settings.help.cell_caption',
message: 'Support, guides and articles',
})}
icon={<SupportIcon />}
onPress={() => router.navigate(AppRoutes.SettingsHelp)}
testID={TestId.settingsHelpButton}
/>
)}
</SettingsList>
<Accordion
label={t({
id: 'settings.accordion_label',
message: 'More options',
})}
testID={TestId.settingsMoreOptionsButton}
content={
<SettingsList>
<SettingsListItem
title={t({
id: 'settings.contacts.cell_title',
message: 'Contacts',
})}
icon={<UsersTwoIcon />}
onPress={() => {
contactsSheetRef.current?.present();
}}
testID={TestId.settingsContactsButton}
/>
<SettingsListItem
title={t({
id: 'settings.fees.cell_title',
message: 'Fees',
})}
icon={<SettingsGearIcon />}
onPress={() => {
feesSheetRef.current?.present();
}}
testID={TestId.settingsFeesButton}
/>
</SettingsList>
}
/>
<Divider />
<Box py="3">
<Text variant="label01">
Expand Down Expand Up @@ -198,6 +195,7 @@ export default function SettingsScreen() {
id: 'contacts.header_title',
message: 'Contacts',
}),
id: WaitlistIds.contacts,
}}
sheetRef={contactsSheetRef}
/>
Expand All @@ -207,6 +205,7 @@ export default function SettingsScreen() {
id: 'fees.header_title',
message: 'Custom fees',
}),
id: WaitlistIds.fees,
}}
sheetRef={feesSheetRef}
/>
Expand Down
Loading

0 comments on commit 5d06887

Please sign in to comment.