Skip to content

Commit

Permalink
Merge pull request #55 from OriginProtocol/fix/nick-feedback
Browse files Browse the repository at this point in the history
[TAS-326] Feedback round 2
  • Loading branch information
toniocodo authored Oct 4, 2023
2 parents 241e6fe + 3ee91ac commit 4107322
Show file tree
Hide file tree
Showing 27 changed files with 449 additions and 391 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ We use `react-query` in conjunction with `graphql-codegen` for interacting with
- run the graphql-codegen task with `pnpm nx run oeth-shared:codegen-graphql`, it will generate
- the global types in `libs/oeth/shared/src/generated/graphql.ts` and
- the generated hooks next to your graphql file (i.e. `/libs/oeth/history/src/queries.generated.tsx`)
- use the generated hooks in your component with fully typed args and results!
- use the generated hooks in your component with fully typed args and results

Couple of things to note:
- generated hooks receives args as first param, second param exposes all react-query api for controlling execution
Expand Down
6 changes: 1 addition & 5 deletions apps/oeth/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ export const App = () => {
<Topnav />
<Container
sx={{
mt: { xs: 3.25, md: 3 },
mt: 3,
mb: 10,
pt: (theme) => ({
xs: '112px',
md: `${theme.mixins.toolbar.height}px`,
}),
}}
maxWidth="sm"
>
Expand Down
312 changes: 161 additions & 151 deletions apps/oeth/src/components/Topnav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,177 +31,187 @@ export function Topnav(props: BoxProps) {
useState<HTMLButtonElement | null>(null);

return (
<Box
component="nav"
{...props}
sx={(theme) => ({
position: 'fixed',
top: 0,
left: 0,
width: 1,
zIndex: theme.zIndex.appBar,
backgroundColor: alpha(theme.palette.background.default, 0.6),
backdropFilter: 'blur(15px)',
height: {
xs: '112px',
md: `${theme.mixins.toolbar.height}px`,
},
display: 'grid',
borderBottom: {
xs: 'none',
md: `1px solid ${theme.palette.background.paper}`,
},
columnGap: { xs: 1, md: 10 },
rowGap: { xs: 0, md: 10 },
alignItems: 'center',
px: {
xs: 1.5,
md: 3,
},
pt: {
xs: 1.5,
md: 0,
},
gridTemplateColumns: {
xs: '1fr 1fr',
md: 'auto 1fr auto',
},
})}
>
<>
<Box
component={Link}
to="/"
sx={{
height: (theme) => ({
xs: '112px',
md: `${theme.mixins.toolbar.height}px`,
}),
}}
/>
<Box
component="nav"
{...props}
sx={(theme) => ({
'& img': {
maxHeight: {
xs: '1rem',
md: '1.5rem',
},
maxWidth: {
xs: theme.typography.pxToRem(100),
sm: theme.typography.pxToRem(120),
md: theme.typography.pxToRem(180),
},
position: 'fixed',
top: 0,
left: 0,
width: 1,
zIndex: theme.zIndex.appBar,
backgroundColor: alpha(theme.palette.background.default, 0.6),
backdropFilter: 'blur(15px)',
height: {
xs: '112px',
md: `${theme.mixins.toolbar.height}px`,
},
})}
>
<img src="/images/origin-ether-logo.svg" alt="Origin logo" />
</Box>
<Tabs
value={location.pathname}
onChange={(_, value) => {
navigate(value);
}}
sx={{
order: {
xs: 2,
md: 0,
display: 'grid',
borderBottom: {
xs: 'none',
md: `1px solid ${theme.palette.background.paper}`,
},
gridColumn: {
xs: 'span 2',
md: 'span 1',
columnGap: { xs: 1, md: 10 },
rowGap: { xs: 0, md: 10 },
alignItems: 'center',
px: {
xs: 1.5,
md: 3,
},
marginBlockStart: {
xs: 2,
pt: {
xs: 1.5,
md: 0,
},
'& .MuiTabs-flexContainer': {
justifyContent: {
xs: 'center',
md: 'flex-start',
},
gridTemplateColumns: {
xs: '1fr 1fr',
md: 'auto 1fr auto',
},
}}
>
{routes[0].children.map((route) => (
<Tab
key={route?.path ?? '/'}
value={route?.path ?? '/'}
label={intl.formatMessage(route.handle.label)}
/>
))}
</Tabs>
<Box
sx={{
display: 'flex',
justifyContent: 'flex-end',
alignItems: 'center',
gap: { xs: 1, md: 2 },
}}
})}
>
<MuiLink
href="https://oeth.on.fleek.co/"
target="_blank"
noWrap
<Box
component={Link}
to="/"
sx={(theme) => ({
'& img': {
maxHeight: {
xs: '1rem',
md: '1.5rem',
},
maxWidth: {
xs: theme.typography.pxToRem(100),
sm: theme.typography.pxToRem(120),
md: theme.typography.pxToRem(180),
},
},
})}
>
<img src="/images/origin-ether-logo.svg" alt="Origin logo" />
</Box>
<Tabs
value={location.pathname}
onChange={(_, value) => {
navigate(value);
}}
sx={{
borderRadius: 25,
paddingX: {
md: 3,
order: {
xs: 2,
md: 0,
},
paddingY: {
md: 1,
xs: 0.75,
gridColumn: {
xs: 'span 2',
md: 'span 1',
},
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontWeight: 500,
minHeight: { xs: 36, md: 44 },
background: `linear-gradient(0deg, ${alpha(
theme.palette.common.white,
0.05,
)} 0%, ${alpha(theme.palette.common.white, 0.05)} 100%), ${
theme.palette.background.paper
};`,
'&:hover': {
background: (theme) => theme.palette.background.paper,
marginBlockStart: {
xs: 2,
md: 0,
},
'& .MuiTabs-flexContainer': {
justifyContent: {
xs: 'center',
md: 'flex-start',
},
},
}}
>
{isMd
? intl.formatMessage({ defaultMessage: 'IPFS' })
: intl.formatMessage({ defaultMessage: 'View on IPFS' })}
</MuiLink>
<OpenAccountModalButton
onClick={(e) => {
if (isConnected) {
setAccountModalAnchor(e.currentTarget);
}
{routes[0].children.map((route) => (
<Tab
key={route?.path ?? '/'}
value={route?.path ?? '/'}
label={intl.formatMessage(route.handle.label)}
/>
))}
</Tabs>
<Box
sx={{
display: 'flex',
justifyContent: 'flex-end',
alignItems: 'center',
gap: { xs: 1, md: 2 },
}}
>
<MuiLink
href="https://oeth.on.fleek.co/"
target="_blank"
noWrap
sx={{
borderRadius: 25,
paddingX: {
md: 3,
xs: 2,
},
paddingY: {
md: 1,
xs: 0.75,
},
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontWeight: 500,
minHeight: { xs: 36, md: 44 },
background: `linear-gradient(0deg, ${alpha(
theme.palette.common.white,
0.05,
)} 0%, ${alpha(theme.palette.common.white, 0.05)} 100%), ${
theme.palette.background.paper
};`,
'&:hover': {
background: (theme) => theme.palette.background.paper,
},
}}
>
{isMd
? intl.formatMessage({ defaultMessage: 'IPFS' })
: intl.formatMessage({ defaultMessage: 'View on IPFS' })}
</MuiLink>
<OpenAccountModalButton
onClick={(e) => {
if (isConnected) {
setAccountModalAnchor(e.currentTarget);
}
}}
sx={{
borderRadius: 25,
paddingX: {
md: 3,
xs: 2,
},
paddingY: {
md: 1,
xs: 0.75,
},
minWidth: 36,
maxWidth: { xs: isConnected ? 36 : 160, sm: 160, lg: 220 },
fontWeight: 500,
minHeight: { xs: 36, md: 44 },
}}
/>
<AccountPopover
anchor={accountModalAnchor}
setAnchor={setAccountModalAnchor}
/>
</Box>
<Divider
sx={{
borderRadius: 25,
paddingX: {
md: 3,
xs: 2,
},
paddingY: {
md: 1,
xs: 0.75,
},
minWidth: 36,
maxWidth: { xs: isConnected ? 36 : 160, sm: 160, lg: 220 },
fontWeight: 500,
minHeight: { xs: 36, md: 44 },
display: { xs: 'block', md: 'none' },
gridColumn: 'span 2',
gridRowStart: 1,
borderColor: (theme) => theme.palette.background.paper,
position: 'relative',
width: 'calc(100% + 1.5rem)',
bottom: '-3rem',
left: '-0.75rem',
}}
/>
<AccountPopover
anchor={accountModalAnchor}
setAnchor={setAccountModalAnchor}
/>
</Box>
<Divider
sx={{
display: { xs: 'block', md: 'none' },
gridColumn: 'span 2',
gridRowStart: 1,
borderColor: (theme) => theme.palette.background.paper,
position: 'relative',
width: 'calc(100% + 1.5rem)',
bottom: '-3rem',
left: '-0.75rem',
}}
/>
</Box>
</>
);
}
2 changes: 1 addition & 1 deletion libs/oeth/history/src/components/APYContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function APYContainer() {
<Divider orientation="vertical" flexItem />
<ValueContainer
label={intl.formatMessage({
defaultMessage: 'Lifetime earnings (OETH)',
defaultMessage: 'Lifetime Earnings (OETH)',
})}
value={intl.formatNumber(
earnings?.addressById?.earned ?? 0,
Expand Down
2 changes: 1 addition & 1 deletion libs/oeth/history/src/components/HistoryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function HistoryCard() {
justifyContent="space-between"
>
<Typography>
{intl.formatMessage({ defaultMessage: 'OETH transactions' })}
{intl.formatMessage({ defaultMessage: 'OETH Transactions' })}
</Typography>
<Stack direction="row" gap={1}>
<HistoryFilters
Expand Down
6 changes: 2 additions & 4 deletions libs/oeth/history/src/components/HistoryTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ export function HistoryTable({

return (
<Stack>
<Table
sx={{ '& .MuiTableCell-root': { paddingInline: { xs: 2, md: 3 } } }}
>
<Table sx={{ '& .MuiTableCell-root': { px: { xs: 2, md: 3 } } }}>
<TableHead>
{table.getHeaderGroups().map((headerGroup) => (
<TableRow
Expand Down Expand Up @@ -182,7 +180,7 @@ export function HistoryTable({
alignItems="baseline"
justifyContent="flex-end"
gap={1}
sx={{ px: 3, py: 2 }}
sx={{ px: { xs: 2, md: 3 }, py: 2 }}
>
<HistoryFilterButton
disabled={!hasPreviousPage}
Expand Down
Loading

0 comments on commit 4107322

Please sign in to comment.