Skip to content

Commit

Permalink
chore(suite): increase NotificationCard padding in accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
dahaca committed Oct 31, 2022
1 parent f3cdab5 commit 91cc9ae
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const AnnouncementsWrapper = styled.div`
margin-bottom: 16px;
`;

const Announcement = (props: Props) => {
export const AccountAnnouncement = (props: Props) => {
const { account } = props.selectedAccount;
const notifications = [];

Expand All @@ -36,5 +36,3 @@ const Announcement = (props: Props) => {
if (notifications.length === 0) return null;
return <AnnouncementsWrapper>{notifications}</AnnouncementsWrapper>;
};

export default Announcement;
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const getExceptionPage = ({ account }: Props) => {
}
};

const Exception = (props: Props) => {
export const AccountException = (props: Props) => {
const page = getExceptionPage(props);
if (page) return <Wrapper>{page}</Wrapper>;
return (
Expand All @@ -55,5 +55,3 @@ const Exception = (props: Props) => {
</Wrapper>
);
};

export default Exception;
21 changes: 13 additions & 8 deletions packages/suite/src/components/wallet/AccountMode/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
import React from 'react';
import styled from 'styled-components';
import { SelectedAccountWatchOnlyMode } from '@suite-common/wallet-types';

import AuthConfirmFailed from './AuthConfirmFailed';
import BackendDisconnected from './BackendDisconnected';
import DeviceUnavailable from './DeviceUnavailable';

interface Props {
const Container = styled.div`
margin-bottom: 10px;
`;

interface AccountModeProps {
mode: SelectedAccountWatchOnlyMode[] | undefined;
}

const AccountMode = (props: Props) => {
if (!props.mode) return null;
export const AccountMode = (props: AccountModeProps) => {
if (!props.mode) {
return null;
}

return (
<>
<Container>
{props.mode.map(m => {
switch (m) {
case 'auth-confirm-failed':
Expand All @@ -22,12 +30,9 @@ const AccountMode = (props: Props) => {
case 'device-unavailable':
return <DeviceUnavailable key={m} />;
default:
// return <>{m} not implemented</>;
return null;
}
})}
</>
</Container>
);
};

export default AccountMode;
16 changes: 9 additions & 7 deletions packages/suite/src/components/wallet/WalletLayout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React, { useState, useEffect } from 'react';
import { Progress } from '@trezor/components';
import styled from 'styled-components';
import { AccountsMenu } from '@wallet-components';
import Exception from '@wallet-components/AccountException';
import AccountMode from '@wallet-components/AccountMode';
import AccountAnnouncement from '@wallet-components/AccountAnnouncement';
import { AccountTopPanel } from '@wallet-components/AccountTopPanel';
import { Progress } from '@trezor/components';
import {
AccountsMenu,
AccountMode,
AccountException,
AccountAnnouncement,
AccountTopPanel,
} from '@wallet-components';
import { MAX_WIDTH_WALLET_CONTENT } from '@suite-constants/layout';
import { AppState, ExtendedMessageDescriptor } from '@suite-types';
import { useTranslation, useLayout } from '@suite-hooks';
Expand Down Expand Up @@ -105,7 +107,7 @@ export const WalletLayout = ({
<AccountMode mode={account.mode} />
<AccountAnnouncement selectedAccount={account} />
<EmptyHeaderPlaceholder />
<Exception account={account} />
<AccountException account={account} />
</Wrapper>
);
}
Expand Down
8 changes: 8 additions & 0 deletions packages/suite/src/components/wallet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ import { Pagination } from './Pagination';
import { TransactionTimestamp } from './TransactionTimestamp';
import { withCoinmarket, withSelectedAccountLoaded } from './hocs';
import type { WithCoinmarketProps, WithSelectedAccountLoadedProps } from './hocs';
import { AccountMode } from './AccountMode';
import { AccountException } from './AccountException';
import { AccountAnnouncement } from './AccountAnnouncement';
import { AccountTopPanel } from './AccountTopPanel';

export {
Title,
Expand Down Expand Up @@ -71,6 +75,10 @@ export {
KYCError,
Pagination,
TransactionTimestamp,
AccountMode,
AccountException,
AccountAnnouncement,
AccountTopPanel,
};

export type { WithCoinmarketProps, WithSelectedAccountLoadedProps };

0 comments on commit 91cc9ae

Please sign in to comment.