Skip to content

Commit 79be0ef

Browse files
committed
Merge all icons to Icons file
1 parent dc2e527 commit 79be0ef

File tree

12 files changed

+48
-105
lines changed

12 files changed

+48
-105
lines changed

src/components/DataKeyPair.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
ContentCopyIcon,
1717
EditIcon,
1818
ExpandMoreIcon
19-
} from './icons'
19+
} from './Icons'
2020
import { DataBox } from './mui/DataBox'
2121

2222
export type DataKeyPairProps = {

src/components/DataTypes/Object.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useJsonViewerStore } from '../../stores/JsonViewerStore'
88
import type { DataItemProps } from '../../type'
99
import { getValueSize } from '../../utils'
1010
import { DataKeyPair } from '../DataKeyPair'
11-
import { CircularArrowsIcon } from '../icons'
11+
import { CircularArrowsIcon } from '../Icons'
1212
import { DataBox } from '../mui/DataBox'
1313

1414
const objectLb = '{'

src/components/Icons.tsx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { SvgIcon, SvgIconProps } from '@mui/material'
2+
import type React from 'react'
3+
4+
const BaseIcon: React.FC<SvgIconProps> = ({ d, ...props }) => {
5+
return (
6+
<SvgIcon {...props}>
7+
<path d={d}/>
8+
</SvgIcon>
9+
)
10+
}
11+
12+
const Check = 'M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'
13+
const ChevronRight = 'M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z'
14+
const CircularArrows = 'M 12 2 C 10.615 1.998 9.214625 2.2867656 7.890625 2.8847656 L 8.9003906 4.6328125 C 9.9043906 4.2098125 10.957 3.998 12 4 C 15.080783 4 17.738521 5.7633175 19.074219 8.3222656 L 17.125 9 L 21.25 11 L 22.875 7 L 20.998047 7.6523438 C 19.377701 4.3110398 15.95585 2 12 2 z M 6.5097656 4.4882812 L 2.2324219 5.0820312 L 3.734375 6.3808594 C 1.6515335 9.4550558 1.3615962 13.574578 3.3398438 17 C 4.0308437 18.201 4.9801562 19.268234 6.1601562 20.115234 L 7.1699219 18.367188 C 6.3019219 17.710187 5.5922656 16.904 5.0722656 16 C 3.5320014 13.332354 3.729203 10.148679 5.2773438 7.7128906 L 6.8398438 9.0625 L 6.5097656 4.4882812 z M 19.929688 13 C 19.794687 14.08 19.450734 15.098 18.927734 16 C 17.386985 18.668487 14.531361 20.090637 11.646484 19.966797 L 12.035156 17.9375 L 8.2402344 20.511719 L 10.892578 23.917969 L 11.265625 21.966797 C 14.968963 22.233766 18.681899 20.426323 20.660156 17 C 21.355156 15.801 21.805219 14.445 21.949219 13 L 19.929688 13 z'
15+
const Close = 'M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'
16+
const ContentCopy = 'M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z'
17+
const Edit = 'M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'
18+
const ExpandMore = 'M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z'
19+
20+
export const CheckIcon: React.FC<SvgIconProps> = (props) => {
21+
return <BaseIcon d={Check} {...props} />
22+
}
23+
24+
export const ChevronRightIcon: React.FC<SvgIconProps> = (props) => {
25+
return <BaseIcon d={ChevronRight} {...props} />
26+
}
27+
28+
export const CircularArrowsIcon: React.FC<SvgIconProps> = (props) => {
29+
return <BaseIcon d={CircularArrows} {...props} />
30+
}
31+
32+
export const CloseIcon: React.FC<SvgIconProps> = (props) => {
33+
return <BaseIcon d={Close} {...props} />
34+
}
35+
36+
export const ContentCopyIcon: React.FC<SvgIconProps> = (props) => {
37+
return <BaseIcon d={ContentCopy} {...props} />
38+
}
39+
40+
export const EditIcon: React.FC<SvgIconProps> = (props) => {
41+
return <BaseIcon d={Edit} {...props} />
42+
}
43+
44+
export const ExpandMoreIcon: React.FC<SvgIconProps> = (props) => {
45+
return <BaseIcon d={ExpandMore} {...props} />
46+
}

src/components/icons/BaseIcon.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/components/icons/CheckIcon.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/components/icons/ChevronRightIcon.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/components/icons/CircularArrowsIcon.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/components/icons/CloseIcon.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/components/icons/ContentCopyIcon.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/components/icons/EditIcon.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)