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

feat: redesign app #43

Merged
merged 14 commits into from
Dec 1, 2023
Merged

feat: redesign app #43

merged 14 commits into from
Dec 1, 2023

Conversation

schmanu
Copy link
Owner

@schmanu schmanu commented Dec 13, 2022

Changes

  • new theme
  • remove safe-react-components
  • update to MUI 5
  • Use craco instead of react-rewired#
  • Apply new Figma designs
  • Remove tx history / reduce RPC calls a bit

Todos

  • update dependencies
  • build EthHashInfo component
  • add balance column

<TextFieldInput
>
{changeApprovalItems.map((item) => (
<MenuItem value={item.id}>{item.label}</MenuItem>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<MenuItem value={item.id}>{item.label}</MenuItem>
<MenuItem key={item.id} value={item.id}>{item.label}</MenuItem>

Comment on lines 46 to 49
alt={tokenMap?.get(approval.tokenAddress)?.symbol}
/>
<div style={{ display: 'flex', flexDirection: 'column' }}>
<Typography fontWeight={700}>{tokenMap?.get(approval.tokenAddress)?.symbol}</Typography>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: if you move the symbol getter outside of the render, you'd need not call this twice.

minHeight: 48,
borderBottom: '2px solid #E8E7E6',
width: 'inherit',
borderBottom: `1px solid ${theme.palette.border.main}`,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove reliance on useTheme by using a callback here.

Suggested change
borderBottom: `1px solid ${theme.palette.border.main}`,
borderBottom: (theme) => `1px solid ${theme.palette.border.main}`,

Comment on lines 40 to 41
variant={uiStore.selectedApprovals.length === 0 ? 'outlined' : 'contained'}
disabled={uiStore.selectedApprovals.length === 0}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: you could create a hasSelectedApprovals constant or similar to need not compare twice.

import { useEffect, useState } from 'react';

const isSystemDarkMode = (): boolean => {
if (typeof window === 'undefined' || !window.matchMedia) return false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you're not using NextJS, I don't think you need check for the existence of window. You might be able to simplify this implementation.

useEffect(() => {
const isDark = isSystemDarkMode();
setIsDarkMode(isDark);
document.documentElement.setAttribute('data-theme', isDark ? 'dark' : 'light');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You aren't referencing this anywhere in your CSS at the moment. You can remove if if you want.

shortName: 'rin',
currencySymbol: 'RIN',
baseAPI: 'https://safe-transaction.rinkeby.gnosis.io',
baseAPI: 'https://safe-transaction-mainnet.safe.global',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: fetching this from the config service.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep it out of scope for this PR.

Comment on lines 29 to 40
console.log('Filtering approvals');
return logs.filter((log) => log.topics.length === 3);
})
.then((logs) =>
logs.map((log) => ({
...log,
tokenAddress: log.address,
txHash: log.transactionHash,
blockHash: log.blockHash,
})),
);

return await Promise.all(
approvalLogs.map(async (log) => ({
...log,
timestamp: (await web3Provider.getBlock(log.blockHash)).timestamp,
})),
);
console.log('Fetched approvalLogs');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you want to keep these logs?

@schmanu schmanu merged commit 242c326 into main Dec 1, 2023
2 checks passed
@schmanu schmanu deleted the redesign-app branch December 1, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants