Commit 754e3197 authored by tom's avatar tom

monaco icons

parent 9fcd429d
...@@ -101,7 +101,7 @@ export default function useNavItems(): ReturnType { ...@@ -101,7 +101,7 @@ export default function useNavItems(): ReturnType {
config.features.beaconChain.isEnabled && { config.features.beaconChain.isEnabled && {
text: 'Withdrawals', text: 'Withdrawals',
nextRoute: { pathname: '/withdrawals' as const }, nextRoute: { pathname: '/withdrawals' as const },
icon: 'arrow/north-east', icon: 'arrows/north-east',
isActive: pathname === '/withdrawals', isActive: pathname === '/withdrawals',
}, },
].filter(Boolean); ].filter(Boolean);
......
...@@ -55,6 +55,11 @@ ...@@ -55,6 +55,11 @@
| "link" | "link"
| "lock" | "lock"
| "minus" | "minus"
| "monaco/file"
| "monaco/folder-open"
| "monaco/folder"
| "monaco/solidity"
| "monaco/vyper"
| "moon-with-star" | "moon-with-star"
| "moon" | "moon"
| "networks" | "networks"
......
import { Icon, chakra } from '@chakra-ui/react'; import { chakra } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import iconFile from './icons/file.svg'; import type { IconName } from 'ui/shared/IconSvg';
import iconSolidity from './icons/solidity.svg'; import IconSvg from 'ui/shared/IconSvg';
import iconVyper from './icons/vyper.svg';
interface Props { interface Props {
className?: string; className?: string;
...@@ -11,19 +10,19 @@ interface Props { ...@@ -11,19 +10,19 @@ interface Props {
} }
const CodeEditorFileIcon = ({ className, fileName }: Props) => { const CodeEditorFileIcon = ({ className, fileName }: Props) => {
const as = (() => { const name: IconName = (() => {
if (/.vy$/.test(fileName)) { if (/.vy$/.test(fileName)) {
return iconVyper; return 'monaco/vyper';
} }
if (/.sol|.yul$/.test(fileName)) { if (/.sol|.yul$/.test(fileName)) {
return iconSolidity; return 'monaco/solidity';
} }
return iconFile; return 'monaco/file';
})(); })();
return <Icon className={ className } as={ as } boxSize="16px"/>; return <IconSvg className={ className } name={ name } boxSize="16px"/>;
}; };
export default React.memo(chakra(CodeEditorFileIcon)); export default React.memo(chakra(CodeEditorFileIcon));
import type { ChakraProps } from '@chakra-ui/react'; import type { ChakraProps } from '@chakra-ui/react';
import { Box, Accordion, AccordionButton, AccordionItem, AccordionPanel, Icon, chakra } from '@chakra-ui/react'; import { Box, Accordion, AccordionButton, AccordionItem, AccordionPanel, chakra } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import type { FileTree } from './types'; import type { FileTree } from './types';
import IconSvg from 'ui/shared/IconSvg';
import CodeEditorFileIcon from './CodeEditorFileIcon'; import CodeEditorFileIcon from './CodeEditorFileIcon';
import CodeEditorMainFileIndicator from './CodeEditorMainFileIndicator'; import CodeEditorMainFileIndicator from './CodeEditorMainFileIndicator';
import iconFolderOpen from './icons/folder-open.svg';
import iconFolder from './icons/folder.svg';
import useThemeColors from './utils/useThemeColors'; import useThemeColors from './utils/useThemeColors';
interface Props { interface Props {
...@@ -57,7 +57,7 @@ const CodeEditorFileTree = ({ tree, level = 0, onItemClick, isCollapsed, selecte ...@@ -57,7 +57,7 @@ const CodeEditorFileTree = ({ tree, level = 0, onItemClick, isCollapsed, selecte
boxSize="16px" boxSize="16px"
mr="2px" mr="2px"
/> />
<Icon as={ isExpanded ? iconFolderOpen : iconFolder } boxSize="16px" mr="4px"/> <IconSvg name={ isExpanded ? 'monaco/folder-open' : 'monaco/folder' } boxSize="16px" mr="4px"/>
{ leafName } { leafName }
</AccordionButton> </AccordionButton>
<AccordionPanel p="0"> <AccordionPanel p="0">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment