Skip to content

Commit

Permalink
Replace old ODS icons with new ODS icons (#1207)
Browse files Browse the repository at this point in the history
  • Loading branch information
sepehr2github authored Jan 31, 2024
1 parent 626226f commit 4640a75
Show file tree
Hide file tree
Showing 103 changed files with 557 additions and 586 deletions.
8 changes: 0 additions & 8 deletions .babelrc

This file was deleted.

8 changes: 8 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],
'@babel/preset-react',
'@babel/preset-typescript',
'babel-preset-vite',
],
};
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
transform: {
'^.+\\.tsx?$': 'babel-jest',
'^.+\\.m?[tj]sx?$': 'babel-jest',
'^.+\\.svg$': '<rootDir>/svgTransform.ts',
},
testEnvironment: 'jsdom',
Expand All @@ -13,4 +13,5 @@ module.exports = {
// using this to include utils folder so jest is aware of where the test-utils file resides
moduleDirectories: ['node_modules', 'utils', __dirname],
setupFiles: ['dotenv/config'],
transformIgnorePatterns: ['node_modules/(?!(.*\\.mjs$|react-merge-refs))'],
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"dependencies": {
"@apollo/client": "^3.5.8",
"@aragon/ods": "^1.0.8",
"@aragon/ods": "^1.0.9",
"@aragon/sdk-client": "^1.22.1",
"@aragon/sdk-client-common": "^1.14.1",
"@elastic/apm-rum-react": "^2.0.0",
Expand Down
15 changes: 8 additions & 7 deletions src/components/accordionMethod/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import * as Accordion from '@radix-ui/react-accordion';
import {
AlertInline,
ButtonIcon,
IconChevronDown,
IconMenuVertical,
IconSuccess,
IconWarning,
Dropdown,
ListItemProps,
} from '@aragon/ods-old';
import {Icon, IconType} from '@aragon/ods';
import styled from 'styled-components';
import {shortenAddress} from 'utils/library';

Expand Down Expand Up @@ -91,7 +88,11 @@ export const AccordionItem: React.FC<AccordionMethodType & {name: string}> = ({
{shortenAddress(smartContractAddress)}
</p>
)}
{verified ? <IconSuccess /> : <IconWarning />}
{verified ? (
<Icon icon={IconType.RADIO_CHECK} />
) : (
<Icon icon={IconType.WARNING} />
)}
<p
className={`ml-2 font-semibold ${
verified ? 'text-primary-500' : 'text-warning-500'
Expand All @@ -115,7 +116,7 @@ export const AccordionItem: React.FC<AccordionMethodType & {name: string}> = ({
<ButtonIcon
mode="ghost"
size="medium"
icon={<IconMenuVertical />}
icon={<Icon icon={IconType.MENU_VERTICAL} />}
/>
}
/>
Expand All @@ -124,7 +125,7 @@ export const AccordionItem: React.FC<AccordionMethodType & {name: string}> = ({
<AccordionButton
mode={type === 'action-builder' ? 'ghost' : 'secondary'}
size="medium"
icon={<IconChevronDown />}
icon={<Icon icon={IconType.CHEVRON_DOWN} />}
/>
</Accordion.Trigger>
</VStack>
Expand Down
4 changes: 2 additions & 2 deletions src/components/addCommittee/addCommitteeWallet.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
ButtonIcon,
Dropdown,
IconMenuVertical,
Label,
ListItemAction,
InputValue as WalletInputValue,
} from '@aragon/ods-old';
import {Icon, IconType} from '@aragon/ods';
import React, {useCallback} from 'react';
import {Controller, useFormContext, useWatch} from 'react-hook-form';
import {useTranslation} from 'react-i18next';
Expand Down Expand Up @@ -121,7 +121,7 @@ const AddCommitteeWalletRow: React.FC<WalletRowProps> = ({index, onDelete}) => {
mode="ghost"
size="large"
bgWhite
icon={<IconMenuVertical />}
icon={<Icon icon={IconType.MENU_VERTICAL} />}
data-testid="trigger"
/>
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/addCommittee/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
ButtonIcon,
ButtonText,
Dropdown,
IconMenuVertical,
ListItemAction,
} from '@aragon/ods-old';
import React, {useEffect, useRef} from 'react';
Expand All @@ -19,6 +18,7 @@ import Row from './addCommitteeWallet';
import {useNetwork} from '../../context/network';
import {Address, useEnsName} from 'wagmi';
import {CHAIN_METADATA} from '../../utils/constants';
import {Icon, IconType} from '@aragon/ods';

const AddCommittee: React.FC = () => {
const {t} = useTranslation();
Expand Down Expand Up @@ -98,7 +98,7 @@ const AddCommittee: React.FC = () => {
mode="ghost"
size="large"
bgWhite
icon={<IconMenuVertical />}
icon={<Icon icon={IconType.MENU_VERTICAL} />}
data-testid="trigger"
/>
}
Expand Down
5 changes: 3 additions & 2 deletions src/components/addLinks/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ButtonText, IconAdd} from '@aragon/ods-old';
import {ButtonText} from '@aragon/ods-old';
import {useAlertContext} from 'context/alert';
import React from 'react';
import {useFieldArray, useFormContext, useWatch} from 'react-hook-form';
Expand All @@ -7,6 +7,7 @@ import styled from 'styled-components';

import Header from './header';
import Row from './row';
import {Icon, IconType} from '@aragon/ods';

export type AddLinks = {
/** Name of the fieldArray that is the target of the link inputs. Defaults to
Expand Down Expand Up @@ -66,7 +67,7 @@ const AddLinks: React.FC<AddLinks> = ({
mode={bgWhite ? 'ghost' : 'secondary'}
size="large"
onClick={handleAddLink}
{...(buttonPlusIcon ? {iconLeft: <IconAdd />} : {})}
{...(buttonPlusIcon ? {iconLeft: <Icon icon={IconType.ADD} />} : {})}
/>
</Container>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/addLinks/row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
AlertInline,
ButtonIcon,
Dropdown,
IconMenuVertical,
Label,
ListItemAction,
TextInput,
Expand All @@ -19,6 +18,7 @@ import {
} from 'utils/constants';
import {isOnlyWhitespace} from 'utils/library';
import {BgWhite} from './header';
import {Icon, IconType} from '@aragon/ods';

type LinkRowProps = {
index: number;
Expand Down Expand Up @@ -183,7 +183,7 @@ const LinkRow: React.FC<LinkRowProps & BgWhite> = ({
mode="ghost"
size="large"
bgWhite
icon={<IconMenuVertical />}
icon={<Icon icon={IconType.MENU_VERTICAL} />}
data-testid="trigger"
/>
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/addWallets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import {
ButtonIcon,
ButtonText,
Dropdown,
IconMenuVertical,
ListItemAction,
} from '@aragon/ods-old';
import {Icon, IconType} from '@aragon/ods';
import React, {useEffect, useRef} from 'react';
import {useFieldArray, useFormContext, useWatch} from 'react-hook-form';
import {useTranslation} from 'react-i18next';
Expand Down Expand Up @@ -115,7 +115,7 @@ const AddWallets: React.FC = () => {
mode="ghost"
size="large"
bgWhite
icon={<IconMenuVertical />}
icon={<Icon icon={IconType.MENU_VERTICAL} />}
data-testid="trigger"
/>
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/addWallets/row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import {
AlertInline,
ButtonIcon,
Dropdown,
IconMenuVertical,
Label,
ListItemAction,
NumberInput,
TextInput,
InputValue as WalletInputValue,
} from '@aragon/ods-old';
import {Icon, IconType} from '@aragon/ods';
import Big from 'big.js';
import {constants} from 'ethers';
import React, {useCallback, useState} from 'react';
Expand Down Expand Up @@ -236,7 +236,7 @@ const WalletRow: React.FC<WalletRowProps> = ({index, onDelete}) => {
mode="ghost"
size="large"
bgWhite
icon={<IconMenuVertical />}
icon={<Icon icon={IconType.MENU_VERTICAL} />}
data-testid="trigger"
/>
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/breadcrumbs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import styled from 'styled-components';
import {Link} from 'react-router-dom';
import {BreadcrumbData} from 'use-react-router-breadcrumbs';
import {IconChevronRight} from '@aragon/ods-old';
import {Icon, IconType} from '@aragon/ods';

type Props = {
breadcrumbs: BreadcrumbData[];
Expand All @@ -24,7 +24,7 @@ const Breadcrumbs: React.FC<Props> = ({breadcrumbs}) => {
>
{breadcrumb}
</Link>
{!isLast && <IconChevronRight />}
{!isLast && <Icon icon={IconType.CHEVRON_RIGHT} />}
</Breadcrumb>
);
})}
Expand Down
15 changes: 4 additions & 11 deletions src/components/daoCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {AvatarDao, IconBlock, IconCommunity} from '@aragon/ods-old';
import {AvatarDao} from '@aragon/ods-old';
import {Icon, IconType} from '@aragon/ods';
import React from 'react';
import {useTranslation} from 'react-i18next';
import styled from 'styled-components';
Expand Down Expand Up @@ -52,11 +53,11 @@ export const DaoCard = (props: IDaoCardProps) => {
</DaoDataWrapper>
<DaoMetadataWrapper>
<IconWrapper>
<StyledIconBlock />
<Icon icon={IconType.BLOCKCHAIN} className="text-neutral-600" />
<IconLabel>{CHAIN_METADATA[network].name}</IconLabel>
</IconWrapper>
<IconWrapper>
<StyledIconCommunity />
<Icon icon={IconType.APP_COMMUNITY} className="text-neutral-600" />
<IconLabel>{daoType}</IconLabel>
</IconWrapper>
</DaoMetadataWrapper>
Expand Down Expand Up @@ -118,11 +119,3 @@ const IconWrapper = styled.div.attrs({
const DaoDataWrapper = styled.div.attrs({
className: 'flex flex-col grow space-y-3 flex-1',
})``;

const StyledIconBlock = styled(IconBlock).attrs({
className: 'text-neutral-600',
})``;

const StyledIconCommunity = styled(IconCommunity).attrs({
className: 'text-neutral-600',
})``;
4 changes: 2 additions & 2 deletions src/components/daoSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import {
AvatarDao,
AvatarDaoProps,
ButtonIcon,
IconChevronDown,
shortenAddress,
} from '@aragon/ods-old';
import {Icon, IconType} from '@aragon/ods';
import React from 'react';
import styled from 'styled-components';

Expand Down Expand Up @@ -39,7 +39,7 @@ export const DaoSelector: React.FC<DaoSelectorProps> = ({
</LeftContent>

<ButtonIcon
icon={<IconChevronDown />}
icon={<Icon icon={IconType.CHEVRON_DOWN} />}
mode="secondary"
size="small"
bgWhite={!isDesktop}
Expand Down
5 changes: 3 additions & 2 deletions src/components/executionWidget/actions/mintTokenCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {IconLinkExternal, Link, ListItemAddress} from '@aragon/ods-old';
import React, {useCallback, useEffect, useMemo, useState} from 'react';
import {Link, ListItemAddress} from '@aragon/ods-old';
import {useTranslation} from 'react-i18next';
import styled from 'styled-components';
import {Icon, IconType} from '@aragon/ods';

import {AccordionMethod} from 'components/accordionMethod';
import {useNetwork} from 'context/network';
Expand Down Expand Up @@ -170,7 +171,7 @@ export const MintTokenCard: React.FC<{
<Link
label={t('labels.seeAllHolders')}
href={`${CHAIN_METADATA[network].explorer}/token/tokenholderchart/${action.summary.daoTokenAddress}`}
iconRight={<IconLinkExternal />}
iconRight={<Icon icon={IconType.LINK_EXTERNAL} />}
/>
</SummaryContainer>
</Container>
Expand Down
15 changes: 5 additions & 10 deletions src/components/executionWidget/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
AlertCard,
AlertInline,
ButtonText,
IconAdd,
IconLinkExternal,
} from '@aragon/ods-old';
import React from 'react';
import {AlertCard, AlertInline, ButtonText} from '@aragon/ods-old';
import {Icon, IconType} from '@aragon/ods';
import {useTranslation} from 'react-i18next';
import styled from 'styled-components';

Expand Down Expand Up @@ -51,7 +46,7 @@ export const ExecutionWidget: React.FC<ExecutionWidgetProps> = ({
onAddAction && {
label: t('governance.executionCard.addAction'),
onClick: onAddAction,
iconLeft: <IconAdd />,
iconLeft: <Icon icon={IconType.ADD} />,
}
}
/>
Expand Down Expand Up @@ -135,7 +130,7 @@ const WidgetFooter: React.FC<FooterProps> = ({
<StyledButtonText
label={t('governance.executionCard.seeTransaction')}
mode="secondary"
iconRight={<IconLinkExternal />}
iconRight={<Icon icon={IconType.LINK_EXTERNAL} />}
size="large"
bgWhite
onClick={handleTxViewButtonClick}
Expand All @@ -154,7 +149,7 @@ const WidgetFooter: React.FC<FooterProps> = ({
<StyledButtonText
label={t('governance.executionCard.seeTransaction')}
mode="secondary"
iconRight={<IconLinkExternal />}
iconRight={<Icon icon={IconType.LINK_EXTERNAL} />}
size="large"
bgWhite
onClick={handleTxViewButtonClick}
Expand Down
13 changes: 4 additions & 9 deletions src/components/fullScreenStepper/fullScreenStepper.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
import {
Breadcrumb,
ButtonText,
IconChevronLeft,
IconChevronRight,
Wizard,
} from '@aragon/ods-old';
import React, {
createContext,
useCallback,
Expand All @@ -13,6 +6,8 @@ import React, {
useMemo,
useState,
} from 'react';
import {Breadcrumb, ButtonText, Wizard} from '@aragon/ods-old';
import {Icon, IconType} from '@aragon/ods';
import {useTranslation} from 'react-i18next';
import {useNavigate} from 'react-router-dom';
import styled from 'styled-components';
Expand Down Expand Up @@ -171,7 +166,7 @@ export const FullScreenStepper: React.FC<FullScreenStepperProps> = ({
onBackButtonClicked ? onBackButtonClicked() : prev()
}
disabled={currentStep === 1}
iconLeft={<IconChevronLeft />}
iconLeft={<Icon icon={IconType.CHEVRON_LEFT} />}
/>
<ButtonValidationTrigger onClick={onNextButtonDisabledClicked}>
<ButtonText
Expand All @@ -181,7 +176,7 @@ export const FullScreenStepper: React.FC<FullScreenStepperProps> = ({
onNextButtonClicked ? onNextButtonClicked(next) : next()
}
disabled={isNextButtonDisabled}
iconRight={<IconChevronRight />}
iconRight={<Icon icon={IconType.CHEVRON_RIGHT} />}
/>
</ButtonValidationTrigger>
</FormFooter>
Expand Down
Loading

0 comments on commit 4640a75

Please sign in to comment.