Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI update/delegation transaction #545

Merged
merged 23 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a03daea
Radio button cursor
soerenbf Oct 15, 2024
5034320
Move text to translations
soerenbf Oct 15, 2024
10613d2
Revise delegation flow structure
soerenbf Oct 16, 2024
1d1abb7
Setup multi-step form structure for delegation configuration
soerenbf Oct 16, 2024
86c55c7
Configure delegation target implementation
soerenbf Oct 16, 2024
5ac9edd
Delegator stake configuration layout + text
soerenbf Oct 16, 2024
8daec21
Merge branch 'ui-update/amount-picker' into ui-update/delegation-tran…
soerenbf Oct 22, 2024
567b6c3
Connect delegation registration amount to account
soerenbf Oct 22, 2024
ae82efa
Calculate transaction fee
soerenbf Oct 22, 2024
83eae02
Merge branch 'ui-update/amount-picker' into ui-update/delegation-tran…
soerenbf Oct 22, 2024
69098ff
Add pool info to delegation amount view
soerenbf Oct 23, 2024
378ddfb
Initial work on delegation result
soerenbf Oct 23, 2024
43b1f4f
Register delegation submission layout
soerenbf Oct 23, 2024
534b24a
Add translations
soerenbf Oct 23, 2024
df536fa
Submitted transaction page
soerenbf Oct 23, 2024
4fa9cef
Cleanup
soerenbf Oct 24, 2024
f3102a9
Merge branch 'browser-ui-update' into ui-update/delegation-transaction
soerenbf Oct 24, 2024
548477d
Handle configure delegation in submitted view
soerenbf Oct 24, 2024
ffa505f
Handle pending/failed transactions on submission page
soerenbf Oct 24, 2024
4459fb1
Cleanup
soerenbf Oct 24, 2024
2144deb
Use text components instead of css classes
soerenbf Oct 25, 2024
4ec0eec
Move routes to top level router spec
soerenbf Oct 25, 2024
279bbe6
Small fixes from PR suggestions
soerenbf Oct 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/browser-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"build:dev": "cross-env NODE_ENV=development yarn build-base",
"build:prod": "cross-env NODE_ENV=production yarn build-base",
"build": "yarn build:prod",
"check": "tsc --noEmit",
"test": "jest",
"watch": "cross-env WATCH=1 yarn build:dev",
"storybook": "storybook dev -p 6006",
Expand Down
52 changes: 35 additions & 17 deletions packages/browser-wallet/src/popup/popupX/constants/routes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { AccountAddress, TransactionHash } from '@concordium/web-sdk';
import { generatePath } from 'react-router-dom';

export type RouteConfig = {
hideBackArrow?: boolean;
backTitle?: string;
Expand Down Expand Up @@ -69,12 +72,6 @@ export const relativeRoutes = {
config: {
backTitle: 'to Send Funds form',
},
confirmed: {
path: 'confirmed',
config: {
hideBackArrow: true,
},
},
},
},
receive: {
Expand All @@ -92,6 +89,12 @@ export const relativeRoutes = {
token: {
path: 'token',
},
submittedTransaction: {
path: 'submitted/:transactionHash',
config: {
hideBackArrow: true,
},
},
},
settings: {
path: 'settings',
Expand Down Expand Up @@ -146,9 +149,11 @@ export const relativeRoutes = {
},
},
},
/** Routes related to staking for the currently selected account */
earn: {
path: 'earn',
baker: {
/** Validation related routes */
validator: {
path: 'baker',
intro: {
path: 'intro',
Expand All @@ -159,23 +164,27 @@ export const relativeRoutes = {
openPool: {
path: 'openPool',
},
bakerKeys: {
path: 'bakerKeys',
keys: {
path: 'keys',
},
},
/** Delegation related routes */
delegator: {
path: 'delegator',
intro: {
path: 'intro',
},
type: {
path: 'type',
},
/** Configure new delegator */
register: {
path: 'register',
configure: {
path: 'configure',
},
},
result: {
path: 'result',
/** Configure existing delegator */
update: {
path: 'update',
},
/** Submit configure delegator transaction */
submit: {
path: 'submit',
},
},
},
Expand Down Expand Up @@ -219,6 +228,15 @@ const buildAbsoluteRoutes = <R extends RouteNode | RoutePath | RouteChildren>(

export const absoluteRoutes = buildAbsoluteRoutes(relativeRoutes);

export const transactionDetailsRoute = (account: AccountAddress.Type, tx: TransactionHash.Type) =>
generatePath(absoluteRoutes.home.transactionLog.details.path, {
account: account.address,
transactionHash: TransactionHash.toHexString(tx),
});

export const submittedTransactionRoute = (tx: TransactionHash.Type) =>
generatePath(absoluteRoutes.home.submittedTransaction.path, { transactionHash: TransactionHash.toHexString(tx) });

/**
* Given two absolute routes, returns the relative route between them.
* Note: fromPath should be a prefix of toPath.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@ import Carousel from '@popup/popupX/shared/Carousel';
import { absoluteRoutes } from '@popup/popupX/constants/routes';
import { useNavigate } from 'react-router-dom';
import Page from '@popup/popupX/shared/Page';
import Text from '@popup/popupX/shared/Text';
import { Trans, useTranslation } from 'react-i18next';

export default function BakerIntro() {
const nav = useNavigate();
const { t } = useTranslation('x', { keyPrefix: 'earn.validator.intro' });
return (
<Page className="baker-intro-container">
<Carousel onDone={() => nav(absoluteRoutes.settings.earn.baker.register.path)}>
<span className="capture__main_small">
<Carousel onDone={() => nav(absoluteRoutes.settings.earn.validator.register.path)}>
<Text.Capture>
<Page.Top heading={t('1.title')} />
<Trans t={t} i18nKey="1.body" />
</span>
<span className="capture__main_small">
</Text.Capture>
<Text.Capture>
<Page.Top heading={t('2.title')} />
<Trans t={t} i18nKey="2.body" />
</span>
<span className="capture__main_small">
</Text.Capture>
<Text.Capture>
<Page.Top heading={t('3.title')} />
<Trans t={t} i18nKey="3.body" />
</span>
</Text.Capture>
</Carousel>
</Page>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import React from 'react';
import Carousel from '@popup/popupX/shared/Carousel';
import { useNavigate } from 'react-router-dom';
import { absoluteRoutes } from '@popup/popupX/constants/routes';
import Page from '@popup/popupX/shared/Page';
import { Trans, useTranslation } from 'react-i18next';
import ExternalLink from '@popup/popupX/shared/ExternalLink';

export default function DelegatorIntro() {
type Props = { onDoneRoute: string };

export default function DelegatorIntro({ onDoneRoute }: Props) {
const nav = useNavigate();
const { t } = useTranslation('x', { keyPrefix: 'earn.delegator.intro' });
return (
<Page className="delegator-intro-container">
<Carousel onDone={() => nav(absoluteRoutes.settings.earn.delegator.type.path)}>
<Carousel onDone={() => nav(onDoneRoute)}>
<span className="capture__main_small">
<Page.Top heading={t('1.title')} />
<Trans
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,56 +1,11 @@
.delegation-result-container {
display: flex;
flex-direction: column;
height: 100%;
padding-bottom: rem(32px);

.capture__main_small {
color: $color-white;
word-wrap: break-word;
}

.delegation-result {
&__title {
display: flex;
flex-direction: column;
justify-content: space-between;
margin-bottom: rem(12px);

.capture__main_small {
color: $color-mineral-2;
padding-left: rem(6px);
}
}

&__card {
display: flex;
flex-direction: column;
border-radius: rem(12px);
padding: rem(16px);
margin-top: rem(16px);
background-color: rgba($color-grey-3, 0.3);

&_row:not(:last-child) {
padding-bottom: rem(8px);
margin-bottom: rem(8px);
border-bottom: 1px solid $color-grey-3;
}

&_row {
display: flex;
flex-direction: column;

.capture__main_small:first-child {
color: rgba($color-mineral-3, 0.5);
margin-bottom: rem(6px);
}
}
}

&__export {
display: flex;
align-items: center;
gap: rem(8px);
margin-top: rem(16px);
}
}
Expand Down
Loading
Loading