Skip to content

Commit

Permalink
simplify. make mobile work
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Apr 16, 2024
1 parent 5c8789d commit f8cfeb8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 63 deletions.
Binary file modified public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 15 additions & 38 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,44 +98,21 @@ const App = () => {
))}
</Stack>
</Modal>
<AppShell
header={{ height: 60 }}
navbar={{ width: 300, breakpoint: 'sm', collapsed: { mobile: !opened } }}
>
<AppShell.Header>
<Group h="100%" px="md" justify="space-between">
<Burger opened={opened} onClick={toggle} hiddenFrom="sm" size="sm" />
<Image src="logo.png" h="100%" p={8} />
{selectedAccount ? (
<Button
onClick={onChangeAccountClick}
variant="outline"
>{`${selectedAccount.meta.name} (${selectedAccount.meta.source})`}</Button>
) : (
<Button onClick={onConnectWalletClick}>Connect wallet</Button>
)}
</Group>
</AppShell.Header>
<AppShell.Navbar p="md">
<RouterNavLink to="/xcm-sdk-sandbox" style={{ color: 'black' }}>
{({ isActive }) => (
<NavLink
component="div"
active={isActive}
label="Encointer XCM"
leftSection={<IconHome2 size="1rem" stroke={1.5} />}
style={{ borderRadius: 4 }}
/>
)}
</RouterNavLink>
</AppShell.Navbar>
<AppShell.Main>
<Routes>
<Route path="/" Component={RouterTransferPage} />
<Route path="/xcm-sdk-sandbox" Component={XcmSdkSandbox} />
</Routes>
</AppShell.Main>
</AppShell>
<Group h="100%" px="md" justify="space-between">
<Image src="logo.png" w="64px" p={8} />
{selectedAccount ? (
<Button
onClick={onChangeAccountClick}
variant="outline"
>{`${selectedAccount.meta.name} (${selectedAccount.meta.source})`}</Button>
) : (
<Button onClick={onConnectWalletClick}>Connect wallet</Button>
)}
</Group>
<Routes>
<Route path="/" Component={XcmSdkSandbox} />
<Route path="/xcm" Component={XcmSdkSandbox} />
</Routes>
</MantineProvider>
</BrowserRouter>
);
Expand Down
27 changes: 2 additions & 25 deletions src/components/TransferForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type FormValues = {
to: TNodeWithRelayChains;
currency: string;
address: string;
amount: string;
amount: number;
useApi: boolean;
};

Expand All @@ -26,7 +26,7 @@ const TransferForm: FC<Props> = ({ onSubmit, loading }) => {
from: 'Encointer',
to: 'Kusama',
currency: 'KSM',
amount: '0.2',
amount: 0.2,
address: selectedAccount? selectedAccount.address : '',
useApi: false,
},
Expand All @@ -36,33 +36,10 @@ const TransferForm: FC<Props> = ({ onSubmit, loading }) => {
},
});

const isNotParaToPara =
form.values.from === 'Polkadot' ||
form.values.from === 'Kusama' ||
form.values.to === 'Polkadot' ||
form.values.to === 'Kusama';

return (
<form onSubmit={form.onSubmit(onSubmit)}>
<Stack>
{!isNotParaToPara && (
<TextInput
label="Currency"
placeholder="GLMR"
required
{...form.getInputProps('currency')}
/>
)}

<TextInput
label="Recipient address on relaychain"
placeholder="0x0000000"
required
{...form.getInputProps('address')}
/>

<TextInput label="Amount KSM to send" placeholder="0.1" required {...form.getInputProps('amount')} />

<Button type="submit" loading={loading}>
Submit transaction
</Button>
Expand Down

0 comments on commit f8cfeb8

Please sign in to comment.