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

Reskin | dao settings #1606

Merged
merged 24 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
634b3b8
Fix breadcrumbs text colour
DarksightKellar Apr 25, 2024
b8d03c5
Refactoring
DarksightKellar Apr 25, 2024
2677f3a
Fix page header bottom margin
DarksightKellar Apr 25, 2024
e04aa1b
Fix settings page top margin
DarksightKellar Apr 25, 2024
15c4726
Rename DAOSettings -> DAOSettingsContent
DarksightKellar Apr 25, 2024
868b669
Remove inter-sections divider; fix section header divider margin
DarksightKellar Apr 25, 2024
b150582
Reskin settings section header and header buttons
DarksightKellar Apr 25, 2024
1f24d68
Reskin settings section layout and sizes
DarksightKellar Apr 25, 2024
b9e2211
Add NESTED SETTINGS SECTION, for when a section has an extra header-c…
DarksightKellar Apr 25, 2024
5b8731b
Reskin MetadataContainer
DarksightKellar Apr 25, 2024
1ae81bb
reskin DisplayAddress
DarksightKellar Apr 25, 2024
6223ddc
Attempt at signers' radio buttons
DarksightKellar Apr 25, 2024
9322192
Reskin modules section
DarksightKellar Apr 25, 2024
2b23826
reskin ERC20TokenContainer
DarksightKellar Apr 25, 2024
049da1e
Reskin ERC721TokensContainer
DarksightKellar Apr 25, 2024
5f11113
Reskin modal base
DarksightKellar Apr 25, 2024
4be2b73
reskin AddSignerModal, RemoveSignerModal
DarksightKellar Apr 25, 2024
debcc6e
minor updates
DarksightKellar Apr 26, 2024
781a7a8
Reskin updateSignerWarning box
DarksightKellar Apr 26, 2024
b2275f4
Prettier
DarksightKellar Apr 26, 2024
8c0e651
cleanup
DarksightKellar Apr 26, 2024
5bba169
Reskin signers' radio buttons
DarksightKellar Apr 26, 2024
10661f8
cleanup
DarksightKellar Apr 29, 2024
da29fba
i18n remove signer warning
DarksightKellar Apr 29, 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
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import { Flex } from '@chakra-ui/react';
import { useFractal } from '../../../providers/App/AppProvider';
import { GovernanceType } from '../../../types';
import { BarLoader } from '../../ui/loaders/BarLoader';
import Divider from '../../ui/utils/Divider';
import ERC20TokenContainer from './components/ERC20Token';
import ERC721TokensContainer from './components/ERC721Token';
import MetadataContainer from './components/Metadata';
import { ModulesContainer } from './components/Modules';
import SignersContainer from './components/Signers';
import { ERC20TokenContainer } from './components/ERC20TokenContainer';
import { ERC721TokensContainer } from './components/ERC721TokensContainer';
import { MetadataContainer } from './components/MetadataContainer';
import { ModulesContainer } from './components/ModulesContainer';
import { SignersContainer } from './components/Signers/SignersContainer';

export function Settings() {
export function DAOSettingsContent() {
const {
node: { safe },
governance: { type },
Expand All @@ -29,24 +28,19 @@ export function Settings() {
}

return (
<>
<Flex
flexDir="column"
gap="3rem"
>
{type === GovernanceType.AZORIUS_ERC20 ? (
<ERC20TokenContainer />
) : type === GovernanceType.AZORIUS_ERC721 ? (
<ERC721TokensContainer />
) : type === GovernanceType.MULTISIG ? (
<SignersContainer />
) : null}
<Divider
mt={10}
mb={10}
/>
<ModulesContainer />
<Divider
mt={10}
mb={10}
/>
<MetadataContainer />
</>
</Flex>
);
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Box, Flex, Text } from '@chakra-ui/react';
import { useTranslation } from 'react-i18next';
import { SettingsSection } from '..';
import { useFractal } from '../../../../../providers/App/AppProvider';
import { AzoriusGovernance } from '../../../../../types';
import { formatCoin } from '../../../../../utils';
import { DisplayAddress } from '../../../../ui/links/DisplayAddress';
import { BarLoader } from '../../../../ui/loaders/BarLoader';
import { useFractal } from '../../../../providers/App/AppProvider';
import { AzoriusGovernance } from '../../../../types';
import { formatCoin } from '../../../../utils';
import { DisplayAddress } from '../../../ui/links/DisplayAddress';
import { BarLoader } from '../../../ui/loaders/BarLoader';
import { SettingsSection } from './SettingsSection';

export default function ERC20TokenContainer() {
export function ERC20TokenContainer() {
const { t } = useTranslation(['settings']);
const { governance } = useFractal();

Expand All @@ -16,53 +16,49 @@ export default function ERC20TokenContainer() {

return (
<SettingsSection
contentTitle={t('governanceTokenTitle')}
descriptionTitle={t('governanceTokenTitle')}
descriptionText={t('governanceTokenDescription')}
title={t('governanceTokenTitle')}
descriptionHeader={t('governanceTokenTitle')}
descriptionContent={t('governanceTokenDescription')}
>
{votesToken ? (
<Flex
justifyContent="space-between"
mt={4}
>
{/* TOKEN NAME */}
<Box>
<Text
textStyle="text-sm-mono-regular"
color="chocolate.200"
color="neutral-7"
textStyle="label-small"
>
{t('governanceTokenNameLabel')}
</Text>
<Box mt={2}>
<Flex mt="0.5rem">
<DisplayAddress address={votesToken.address}>{votesToken.name}</DisplayAddress>
</Box>
</Flex>
</Box>

{/* TOKEN SYMBOL */}
mudrila marked this conversation as resolved.
Show resolved Hide resolved
<Box>
<Text
textStyle="text-sm-mono-regular"
color="chocolate.200"
color="neutral-7"
textStyle="label-small"
>
{t('governanceTokenSymbolLabel')}
</Text>
<Text
textStyle="text-base-sans-regular"
color="grayscale.100"
mt={2}
>
{votesToken.symbol}
</Text>
<Text mt="0.5rem">{votesToken.symbol}</Text>
</Box>

{/* TOTAL SUPPLY */}
<Box>
{' '}
DarksightKellar marked this conversation as resolved.
Show resolved Hide resolved
<Text
textStyle="text-sm-mono-regular"
color="chocolate.200"
color="neutral-7"
textStyle="label-small"
>
{t('governanceTokenSupplyLabel')}
</Text>
<Text
textStyle="text-base-sans-regular"
color="grayscale.100"
mt={2}
>
<Text mt="0.5rem">
{formatCoin(
votesToken.totalSupply,
false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Flex, Text, Grid, GridItem } from '@chakra-ui/react';
import { useTranslation } from 'react-i18next';
import { SettingsSection } from '..';
import { useFractal } from '../../../../../providers/App/AppProvider';
import { AzoriusGovernance } from '../../../../../types';
import { DisplayAddress } from '../../../../ui/links/DisplayAddress';
import { BarLoader } from '../../../../ui/loaders/BarLoader';
import { useFractal } from '../../../../providers/App/AppProvider';
import { AzoriusGovernance } from '../../../../types';
import { DisplayAddress } from '../../../ui/links/DisplayAddress';
import { BarLoader } from '../../../ui/loaders/BarLoader';
import { SettingsSection } from './SettingsSection';

export default function ERC721TokensContainer() {
export function ERC721TokensContainer() {
const { t } = useTranslation(['settings']);
const { governance } = useFractal();

Expand All @@ -15,81 +15,75 @@ export default function ERC721TokensContainer() {

return (
<SettingsSection
contentTitle={t('governanceERC721TokenTitle')}
descriptionTitle={t('governanceERC721TokenTitle')}
descriptionText={t('governanceERC721TokenDescription')}
title={t('governanceERC721TokenTitle')}
descriptionHeader={t('governanceERC721TokenTitle')}
descriptionContent={t('governanceERC721TokenDescription')}
>
{erc721Tokens ? (
<Flex flexWrap="wrap">
<Grid
templateColumns="repeat(5, 1fr)"
width="100%"
mt={4}
>
{/* HEADER TITLES */}
mudrila marked this conversation as resolved.
Show resolved Hide resolved
<GridItem colSpan={2}>
<Text
textStyle="text-sm-mono-regular"
color="chocolate.200"
textStyle="label-small"
DarksightKellar marked this conversation as resolved.
Show resolved Hide resolved
color="neutral-7"
>
{t('governanceTokenNameLabel')}
</Text>
</GridItem>
<GridItem colSpan={1}>
<Text
textStyle="text-sm-mono-regular"
color="chocolate.200"
textStyle="label-small"
color="neutral-7"
>
{t('governanceTokenSymbolLabel')}
</Text>
</GridItem>
<GridItem colSpan={1}>
<Text
textStyle="text-sm-mono-regular"
color="chocolate.200"
textStyle="label-small"
color="neutral-7"
>
{t('governanceTokenWeightLabel')}
</Text>
</GridItem>
<GridItem colSpan={1}>
<Text
textStyle="text-sm-mono-regular"
color="chocolate.200"
textStyle="label-small"
color="neutral-7"
>
{t('governanceTokenTotalWeightLabel')}
</Text>
</GridItem>
</Grid>

{/* TOKEN DETAILS */}
{erc721Tokens.map(token => (
<Grid
key={token.address}
width="100%"
templateColumns="repeat(5, 1fr)"
mt={2}
mt="0.5rem"
>
<GridItem colSpan={2}>
<DisplayAddress address={token.address}>{token.name}</DisplayAddress>
<Flex>
<DisplayAddress address={token.address}>{token.name}</DisplayAddress>
</Flex>
</GridItem>

<GridItem colSpan={1}>
<Text
textStyle="text-base-sans-regular"
color="grayscale.100"
>
{token.symbol}
</Text>
<Text>{token.symbol}</Text>
</GridItem>

<GridItem colSpan={1}>
<Text
textStyle="text-base-sans-regular"
color="grayscale.100"
>
{token.votingWeight.toString()}
</Text>
<Text>{token.votingWeight.toString()}</Text>
</GridItem>

<GridItem colSpan={1}>
<Text
textStyle="text-base-sans-regular"
color="grayscale.100"
>
<Text>
{token.totalSupply ? (token.totalSupply * token.votingWeight).toString() : 'n/a'}
</Text>
</GridItem>
Expand Down
Loading