Skip to content

Commit

Permalink
feat: feedback
Browse files Browse the repository at this point in the history
- add main container margins
- update History page WIP🚧
- limit apy values to after 06/06
- update fontwrights medium
- theme consolidation WIP🚧
- add default address formatting
  • Loading branch information
toniocodo committed Sep 27, 2023
1 parent 00ae472 commit 78b76a3
Show file tree
Hide file tree
Showing 18 changed files with 147 additions and 138 deletions.
2 changes: 1 addition & 1 deletion apps/oeth/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const App = () => {
height: theme.mixins.toolbar.height,
})}
/>
<Container sx={{ my: 3 }} maxWidth="sm">
<Container sx={{ mt: 3, mb: 10 }} maxWidth="sm">
<Outlet />
</Container>
</Stack>
Expand Down
2 changes: 1 addition & 1 deletion libs/oeth/history/src/components/HistoryButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function HistoryFilterButton({
fontStyle: 'normal',
lineHeight: (theme) => theme.typography.pxToRem(20),
':hover': {
background: (theme) => alpha(theme.palette.common.white, 0.1),
background: (theme) => alpha(theme.palette.common.white, 0.04),
},
...sx,
}}
Expand Down
16 changes: 12 additions & 4 deletions libs/oeth/history/src/components/HistoryCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useState } from 'react';

import { Box, Button, Divider, Stack, Typography } from '@mui/material';
import { Box, Divider, Stack, Typography } from '@mui/material';
import { ConnectedButton } from '@origin/shared/providers';
import { useIntl } from 'react-intl';
import { useAccount } from 'wagmi';

Expand Down Expand Up @@ -56,14 +57,21 @@ export function HistoryCard() {
setPage={(page) => setPage(page)}
/>
) : (
<Box sx={{ height: '15rem', display: 'grid', placeContent: 'center' }}>
<Stack
sx={{
height: '15rem',
justifyContent: 'center',
alignItems: 'center',
gap: 2,
}}
>
<Typography>
{intl.formatMessage({
defaultMessage: 'Connect your wallet to see your history',
})}
</Typography>
<Button onClick={() => console.log('test')}>Connect</Button>
</Box>
<ConnectedButton />
</Stack>
)}
</Box>
);
Expand Down
2 changes: 1 addition & 1 deletion libs/oeth/history/src/components/HistoryCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function HistoryCell(props: Props) {
{/* @ts-expect-error whatever */}
<TransactionIcon type={props.type.toLowerCase()} />
<Stack>
<Typography>{props.type}</Typography>
<Typography fontWeight="500">{props.type}</Typography>
<Typography color="text.secondary" variant="body2">
{intl.formatDate(new Date(props.timestamp))}
</Typography>
Expand Down
72 changes: 41 additions & 31 deletions libs/oeth/history/src/components/HistoryTable.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useMemo } from 'react';

import {
Box,
Stack,
Table,
TableBody,
TableCell,
TableHead,
TableRow,
Typography,
} from '@mui/material';
import { LinkIcon } from '@origin/shared/components';
import { quantityFormat } from '@origin/shared/utils';
Expand Down Expand Up @@ -64,37 +64,37 @@ export function HistoryTable({
},
}),
columnHelper.accessor('value', {
cell: (info) => intl.formatNumber(info.getValue(), quantityFormat),
header: intl.formatMessage({ defaultMessage: 'Change' }),
cell: (info) => (
<Typography textAlign="end">
{intl.formatNumber(info.getValue(), quantityFormat)}
</Typography>
),
header: () => (
<Typography textAlign="end">
{intl.formatMessage({ defaultMessage: 'Change' })}
</Typography>
),
}),
columnHelper.accessor('balance', {
cell: (info) => (
<Stack
direction="row"
alignItems="center"
justifyContent="space-between"
gap={1}
sx={{ textAlign: 'right' }}
>
<Box
sx={{
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
overflow: 'hidden',
maxWidth: '75%',
}}
component="span"
>
{intl.formatNumber(info.getValue(), quantityFormat)}
</Box>

<LinkIcon
url={`https://etherscan.io/tx/${info.row.original.txHash}`}
sx={{ transform: 'translateY(6.5%)' }}
/>
</Stack>
<Typography textAlign="end">
{intl.formatNumber(info.getValue(), quantityFormat)}
</Typography>
),
header: () => (
<Typography textAlign="end">
{intl.formatMessage({ defaultMessage: 'Balance' })}
</Typography>
),
}),
columnHelper.display({
id: 'link',
cell: (info) => (
<LinkIcon
size={10}
url={`https://etherscan.io/tx/${info.row.original.txHash}`}
/>
),
header: intl.formatMessage({ defaultMessage: 'Balance' }),
}),
],
[intl],
Expand All @@ -118,7 +118,7 @@ export function HistoryTable({
});

return (
<Stack gap={2}>
<Stack>
<Table
sx={{ '& .MuiTableCell-root': { paddingInline: { xs: 2, md: 3 } } }}
>
Expand Down Expand Up @@ -155,12 +155,15 @@ export function HistoryTable({
'& > *:first-of-type': {
width: '50%',
},
'& > *:last-of-type': {
width: '10%',
pl: 0,
},
}}
>
{row.getVisibleCells().map((cell) => (
<TableCell
key={cell.id}
align="left"
sx={{
...(cell.column.columnDef.id === 'type'
? { '&:first-letter': { textTransform: 'uppercase' } }
Expand All @@ -176,16 +179,23 @@ export function HistoryTable({
</Table>
<Stack
direction="row"
alignItems="baseline"
justifyContent="flex-end"
gap={1}
sx={{ paddingInline: 2 }}
sx={{ px: 3, py: 2 }}
>
<HistoryFilterButton
disabled={!hasPreviousPage}
onClick={() => setPage(page - 1)}
>
{intl.formatMessage({ defaultMessage: 'Previous' })}
</HistoryFilterButton>
<Typography fontSize={13} px={2}>
{intl.formatMessage(
{ defaultMessage: 'Page {page}' },
{ page: page + 1 },
)}
</Typography>
<HistoryFilterButton
disabled={!hasNextPage}
onClick={() => setPage(page + 1)}
Expand Down
4 changes: 2 additions & 2 deletions libs/oeth/history/src/queries.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type HistoryTableQuery = {
earned: number;
isContract: boolean;
rebasingOption: string;
credits: any;
lastUpdated: any;
history: Array<{
__typename?: 'History';
Expand Down Expand Up @@ -44,7 +45,6 @@ export type HistoryTableWithFiltersQuery = {
earned: number;
isContract: boolean;
rebasingOption: string;
credits: any;
lastUpdated: any;
history: Array<{
__typename?: 'History';
Expand All @@ -71,6 +71,7 @@ export const HistoryTableDocument = `
earned
isContract
rebasingOption
credits
lastUpdated
history(limit: 20, orderBy: timestamp_DESC, offset: $offset) {
type
Expand Down Expand Up @@ -118,7 +119,6 @@ export const HistoryTableWithFiltersDocument = `
earned
isContract
rebasingOption
credits
lastUpdated
history(
limit: 20
Expand Down
14 changes: 7 additions & 7 deletions libs/oeth/redeem/src/components/RedeemSplitCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const RedeemSplitCard = (props: Omit<StackProps, 'children'>) => {
<Mix />
<Stack flex={1} direction="column">
<Stack direction="row" alignItems="baseline" gap={1}>
<Typography fontWeight={600}>
<Typography fontWeight={500}>
{isEstimateLoading ? (
<Skeleton width={100} />
) : (
Expand All @@ -68,7 +68,7 @@ export const RedeemSplitCard = (props: Omit<StackProps, 'children'>) => {
<Typography variant="body2" color="text.secondary">
{intl.formatMessage({ defaultMessage: 'Gas:' })}
</Typography>
<Typography variant="body2" fontWeight={600}>
<Typography variant="body2" fontWeight={500}>
{isEstimateLoading || gasPriceLoading ? (
<Skeleton width={60} />
) : (
Expand All @@ -80,7 +80,7 @@ export const RedeemSplitCard = (props: Omit<StackProps, 'children'>) => {
<Typography variant="body2" color="text.secondary">
{intl.formatMessage({ defaultMessage: 'Wait time:' })}
</Typography>
<Typography variant="body2" fontWeight={600}>
<Typography variant="body2" fontWeight={500}>
{isEstimateLoading ? (
<Skeleton width={60} />
) : (
Expand All @@ -103,7 +103,7 @@ export const RedeemSplitCard = (props: Omit<StackProps, 'children'>) => {
<Typography variant="body2" color="text.secondary">
{intl.formatMessage({ defaultMessage: 'Rate:' })}
</Typography>
<Typography variant="body2" fontWeight={600}>
<Typography variant="body2" fontWeight={500}>
{isEstimateLoading ? (
<Skeleton width={60} />
) : (
Expand Down Expand Up @@ -132,15 +132,15 @@ export const RedeemSplitCard = (props: Omit<StackProps, 'children'>) => {
>
<Stack direction="row" alignItems="center" spacing={1}>
<Box component="img" src={s.token.icon} />
<Typography fontWeight={600}>{s.token.symbol}</Typography>
<Typography fontWeight={500}>{s.token.symbol}</Typography>
</Stack>
<Stack
direction="row"
alignItems="center"
justifyContent="flex-end"
spacing={2}
>
<Typography fontWeight={600}>
<Typography fontWeight={500}>
{isEstimateLoading ? (
<Skeleton width={80} />
) : (
Expand All @@ -151,7 +151,7 @@ export const RedeemSplitCard = (props: Omit<StackProps, 'children'>) => {
<Skeleton width={80} />
) : (
<Typography
fontWeight={600}
fontWeight={500}
color="text.subtle"
sx={{ minWidth: 100, textAlign: 'end' }}
>
Expand Down
Loading

0 comments on commit 78b76a3

Please sign in to comment.