Skip to content

Commit

Permalink
chore: resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
thekidnamedkd committed Oct 29, 2024
2 parents a484892 + 79aa203 commit 5846a0c
Show file tree
Hide file tree
Showing 6 changed files with 239 additions and 188 deletions.
7 changes: 3 additions & 4 deletions src/assets/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1018,9 +1018,7 @@
"myDaos": "My DAOs",
"popular": "Popular",
"newest": "Newest",
"walletBased": "Wallet-based",
"showMore": "Show more",
"tokenBased": "Token-based"
"showMore": "Show more"
},
"activeProposals": "Active proposals",
"showMore": "Show more",
Expand All @@ -1043,7 +1041,8 @@
"linkURL": "https://docs.aragon.org"
},
"toggleFilter": {
"Favourites": "Following",
"favourites": "Following",
"featuredDAOs": "Featured",
"allDAOs": "All DAOs ",
"member": "Member"
},
Expand Down
36 changes: 16 additions & 20 deletions src/components/daoCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {AvatarDao} from '@aragon/ods-old';
import {Icon, IconType} from '@aragon/ods';
import {AvatarIcon, Icon, IconType} from '@aragon/ods';
import React from 'react';
import {useTranslation} from 'react-i18next';
import styled from 'styled-components';
import useScreen from 'hooks/useScreen';
import {generatePath, useHref} from 'react-router-dom';
Expand All @@ -11,15 +10,18 @@ import {toDisplayEns} from 'utils/library';
import {Dashboard} from 'utils/paths';
import {IDao} from 'services/aragon-backend/domain/dao';

interface IDaoWithOverride extends IDao {
overrideUrl?: string;
}

export interface IDaoCardProps {
dao: IDao;
dao: IDaoWithOverride;
}

export const DaoCard = (props: IDaoCardProps) => {
const {dao} = props;
const {name, daoAddress, logo, ens, description, network, pluginName} = dao;
const {name, daoAddress, logo, ens, description, network, overrideUrl} = dao;

const {t} = useTranslation();
const {isDesktop} = useScreen();
const {avatar} = useResolveDaoAvatar(logo);

Expand All @@ -29,23 +31,18 @@ export const DaoCard = (props: IDaoCardProps) => {
});
const daoUrl = useHref(daoPage);

// TODO: This should be changed for new plugin types
const daoType =
pluginName === 'token-voting.plugin.dao.eth' ||
pluginName === 'token-voting-repo'
? t('explore.explorer.tokenBased')
: t('explore.explorer.walletBased');
const resolvedDaoUrl = overrideUrl ?? daoUrl;

return (
<Container href={daoUrl}>
<Container
href={resolvedDaoUrl}
target={overrideUrl != null ? '_blank' : undefined}
>
<DaoDataWrapper>
<HeaderContainer>
<AvatarDao daoName={name} src={logo && avatar} />
<div className="space-y-0.5 text-left xl:space-y-1">
<Title>{name}</Title>
<p className="font-semibold text-neutral-500 ft-text-sm">
{toDisplayEns(ens)}
</p>
</div>
</HeaderContainer>
<Description isDesktop={isDesktop}>{description}</Description>
Expand All @@ -58,10 +55,9 @@ export const DaoCard = (props: IDaoCardProps) => {
/>
<IconLabel>{CHAIN_METADATA[network].name}</IconLabel>
</IconWrapper>
<IconWrapper>
<Icon icon={IconType.APP_MEMBERS} className="text-neutral-600" />
<IconLabel>{daoType}</IconLabel>
</IconWrapper>
{overrideUrl != null && (
<AvatarIcon variant="primary" icon={IconType.LINK_EXTERNAL} />
)}
</DaoMetadataWrapper>
</Container>
);
Expand Down Expand Up @@ -109,7 +105,7 @@ const Description = styled.p.attrs({
`;

const DaoMetadataWrapper = styled.div.attrs({
className: 'flex flex-row space-x-6',
className: 'flex flex-row justify-between items-center',
})``;
const IconLabel = styled.p.attrs({
className: 'text-neutral-600 ft-text-sm',
Expand Down
Loading

0 comments on commit 5846a0c

Please sign in to comment.