diff --git a/apps/enterprise/src/components/dao-logo/DAOLogo.module.sass b/apps/enterprise/src/components/dao-logo/DAOLogo.module.sass deleted file mode 100644 index d30aa681..00000000 --- a/apps/enterprise/src/components/dao-logo/DAOLogo.module.sass +++ /dev/null @@ -1,29 +0,0 @@ -.root - background-color: #262829 - border-radius: 50% - display: flex - align-items: center - justify-content: center - - aspect-ratio: 1/1 - - &[data-variant="small"] - height: 40px - padding: 8px - - &[data-variant="large"] - height: 60px - padding: 12px - - img - width: 100% - height: 100% - object-fit: cover - - .placeholder - color: var(--text-color-secondary) - max-width: 20px - max-height: 20px - -.link - cursor: pointer diff --git a/apps/enterprise/src/components/dao-logo/DAOLogo.tsx b/apps/enterprise/src/components/dao-logo/DAOLogo.tsx index 08e1dda8..36c0b749 100644 --- a/apps/enterprise/src/components/dao-logo/DAOLogo.tsx +++ b/apps/enterprise/src/components/dao-logo/DAOLogo.tsx @@ -1,36 +1,62 @@ -import classNames from 'classnames'; import { SafeImage } from 'components/safe-image/SafeImage'; import { forwardRef } from 'react'; import { ReactComponent as LogoIcon } from 'components/assets/LogoSmall.svg'; -import styles from './DAOLogo.module.sass'; +import styled from 'styled-components'; +import { roundedCSS } from 'lib/ui/utils/roundedCSS'; +import { centerContentCSS } from 'lib/ui/utils/centerContentCSS'; +import { Text } from 'lib/ui/Text'; +import { getSameDimensionsCSS } from 'lib/ui/utils/getSameDimensionsCSS'; -type Variant = 'small' | 'large'; +export const daoLogoSizes = ['s', 'm', 'l'] as const; + +type DaoLogoSize = typeof daoLogoSizes[number]; + +const logoSizeRecord: Record = { + s: 40, + m: 48, + l: 60 +} interface DAOLogoProps { - className?: string; - variant?: Variant; - logo: string | undefined; - onClick?: () => void; + logo?: string + size?: DaoLogoSize + className?: string } +const Container = styled.div<{ size: DaoLogoSize }>` + background: ${({ theme }) => theme.colors.backgroundGlass.toCssValue()}; + ${roundedCSS}; + ${centerContentCSS}; + + padding: 8px; + + height: ${({ size }) => getSameDimensionsCSS(logoSizeRecord[size])}; + + img { + object-fit: cover; + ${({ size }) => getSameDimensionsCSS(logoSizeRecord[size] * 0.64)}; + } +` + + export const DAOLogo = forwardRef((props, ref) => { - const { className, variant = 'small', logo, onClick, ...rest } = props; + const { logo, size = 'm', className } = props; return ( -
} + fallback={( + + + + )} src={logo} render={(params) => } /> -
+ ); }); diff --git a/apps/enterprise/src/components/layout/Favourites.module.sass b/apps/enterprise/src/components/layout/Favourites.module.sass index b1e42102..63c24eb2 100644 --- a/apps/enterprise/src/components/layout/Favourites.module.sass +++ b/apps/enterprise/src/components/layout/Favourites.module.sass @@ -8,7 +8,4 @@ .icon cursor: pointer - width: 48px !important - height: 48px !important - padding: 12px !important background-color: var(--section-background-color) diff --git a/apps/enterprise/src/pages/create-proposal/Header.tsx b/apps/enterprise/src/pages/create-proposal/Header.tsx index 1f9350d1..ec79fe4a 100644 --- a/apps/enterprise/src/pages/create-proposal/Header.tsx +++ b/apps/enterprise/src/pages/create-proposal/Header.tsx @@ -22,7 +22,9 @@ export const Header = forwardRef((props: HeaderProps, ref: Ref) if (compact) { return ( - +
+ +
{title} @@ -36,7 +38,9 @@ export const Header = forwardRef((props: HeaderProps, ref: Ref) navigate(-1)}> Back - +
+ +
{title} diff --git a/apps/enterprise/src/pages/create-proposal/MobileCreateProposalHeader.tsx b/apps/enterprise/src/pages/create-proposal/MobileCreateProposalHeader.tsx index 916aef5e..3d78844a 100644 --- a/apps/enterprise/src/pages/create-proposal/MobileCreateProposalHeader.tsx +++ b/apps/enterprise/src/pages/create-proposal/MobileCreateProposalHeader.tsx @@ -14,7 +14,7 @@ export const MobileCreateProposalHeader = ({ title }: MobileCreateProposalHeader return ( - + {title} diff --git a/apps/enterprise/src/pages/dao/Header.module.sass b/apps/enterprise/src/pages/dao/Header.module.sass index 0598a8ea..46c52dc4 100644 --- a/apps/enterprise/src/pages/dao/Header.module.sass +++ b/apps/enterprise/src/pages/dao/Header.module.sass @@ -50,9 +50,6 @@ .logo cursor: pointer - width: 48px !important - height: 48px !important - padding: 12px !important .favourite, .logo background-color: var(--section-background-color) diff --git a/apps/enterprise/src/pages/dao/Header.tsx b/apps/enterprise/src/pages/dao/Header.tsx index d7714f73..6cc2ef1b 100644 --- a/apps/enterprise/src/pages/dao/Header.tsx +++ b/apps/enterprise/src/pages/dao/Header.tsx @@ -24,7 +24,9 @@ export const Header = forwardRef((props: HeaderProps, ref: Ref) if (compact) { return ( - +
+ +
{dao.name} @@ -45,7 +47,9 @@ export const Header = forwardRef((props: HeaderProps, ref: Ref) Back - +
+ +
{dao.name} diff --git a/apps/enterprise/src/pages/dao/MobileDaoHeader.tsx b/apps/enterprise/src/pages/dao/MobileDaoHeader.tsx index 8f029f29..d1aea27b 100644 --- a/apps/enterprise/src/pages/dao/MobileDaoHeader.tsx +++ b/apps/enterprise/src/pages/dao/MobileDaoHeader.tsx @@ -13,7 +13,7 @@ export const MobileDaoHeader = () => { - + {dao.name} diff --git a/apps/enterprise/src/pages/dao/staking/NFTStaking.tsx b/apps/enterprise/src/pages/dao/staking/NFTStaking.tsx index 5497b052..517c012b 100644 --- a/apps/enterprise/src/pages/dao/staking/NFTStaking.tsx +++ b/apps/enterprise/src/pages/dao/staking/NFTStaking.tsx @@ -75,7 +75,7 @@ export const NftStakingConnectedView = () => { - + Voting power diff --git a/apps/enterprise/src/pages/dao/staking/TokenStaking.tsx b/apps/enterprise/src/pages/dao/staking/TokenStaking.tsx index a53101e8..31d90542 100644 --- a/apps/enterprise/src/pages/dao/staking/TokenStaking.tsx +++ b/apps/enterprise/src/pages/dao/staking/TokenStaking.tsx @@ -105,7 +105,7 @@ export const TokenStakingConnectedView = () => { - + Voting power diff --git a/apps/enterprise/src/pages/proposal/Header.tsx b/apps/enterprise/src/pages/proposal/Header.tsx index 08b44b88..2d733479 100644 --- a/apps/enterprise/src/pages/proposal/Header.tsx +++ b/apps/enterprise/src/pages/proposal/Header.tsx @@ -23,7 +23,9 @@ export const Header = forwardRef((props: HeaderProps, ref: Ref) if (compact) { return ( - +
+ +
{proposal.title} @@ -38,7 +40,9 @@ export const Header = forwardRef((props: HeaderProps, ref: Ref) navigate(-1)}> Back - +
+ +
{proposal.title} diff --git a/apps/enterprise/src/pages/proposal/LogoValueView.tsx b/apps/enterprise/src/pages/proposal/LogoValueView.tsx index c2ec4d3e..e712e0db 100644 --- a/apps/enterprise/src/pages/proposal/LogoValueView.tsx +++ b/apps/enterprise/src/pages/proposal/LogoValueView.tsx @@ -8,7 +8,7 @@ interface LogoValueViewProps { export const LogoValueView = ({ value }: LogoValueViewProps) => { return ( - + {value} ) diff --git a/apps/enterprise/src/pages/proposal/SmallScreenProposalHeader.tsx b/apps/enterprise/src/pages/proposal/SmallScreenProposalHeader.tsx index 252ba4c5..390ebcfd 100644 --- a/apps/enterprise/src/pages/proposal/SmallScreenProposalHeader.tsx +++ b/apps/enterprise/src/pages/proposal/SmallScreenProposalHeader.tsx @@ -11,7 +11,7 @@ export const SmallScreenProposalHeader = () => { return ( - + {proposal.title} diff --git a/apps/enterprise/src/pages/shared/DAOCard.module.sass b/apps/enterprise/src/pages/shared/DAOCard.module.sass index 707d0c58..7c30f8e2 100644 --- a/apps/enterprise/src/pages/shared/DAOCard.module.sass +++ b/apps/enterprise/src/pages/shared/DAOCard.module.sass @@ -14,8 +14,6 @@ height: 48px grid-row: 1 / span 2 !important .favourite - width: 48px - height: 48px border-radius: 50% &:not(.skeleton) cursor: pointer @@ -26,16 +24,6 @@ .logo grid-column: 1 grid-row: 1 / span 2 - width: 48px - height: 48px - border-radius: 50% - background-color: #262829 - display: flex - align-items: center - justify-content: center - img - width: 32px - height: 32px .name display: block diff --git a/apps/enterprise/src/pages/shared/DAOCard.tsx b/apps/enterprise/src/pages/shared/DAOCard.tsx index 365f886d..9bc42c76 100644 --- a/apps/enterprise/src/pages/shared/DAOCard.tsx +++ b/apps/enterprise/src/pages/shared/DAOCard.tsx @@ -29,20 +29,20 @@ export const DAOCard = (props: DAOCardProps) => { ); } - const logo = ; - const description = dao.type === undefined ? undefined : dao.type === 'multisig' - ? 'Multisig DAO' - : dao.type === 'nft' - ? 'NFT Community DAO' - : 'Community Token DAO'; + ? 'Multisig DAO' + : dao.type === 'nft' + ? 'NFT Community DAO' + : 'Community Token DAO'; return ( navigate(`/dao/${dao.address}`)}> - {logo} +
+ +
{dao.name} diff --git a/apps/enterprise/src/pages/shared/ProposalCard.tsx b/apps/enterprise/src/pages/shared/ProposalCard.tsx index eabdf70f..792d8ba9 100644 --- a/apps/enterprise/src/pages/shared/ProposalCard.tsx +++ b/apps/enterprise/src/pages/shared/ProposalCard.tsx @@ -96,8 +96,8 @@ export const ProposalCard = (props: ProposalCardProps) => { dao.type === 'multisig' ? proposal.totalVotes : proposal.status === 'in_progress' - ? totalStaked - : proposal.totalVotes; + ? totalStaked + : proposal.totalVotes; return ( { {description}
- + {dao.name}