snowballtools-base/packages/frontend/src/components/shared/CustomIcon
Vivian Phung f84e2c0d9d
Refactor: Rename SVG Properties for React Standard (#194)
### TL;DR

A refactor of the Icon components in the front-end package has been carried out. This includes `CollaboratorsIcon.tsx`, `CopyUnfilledIcon.tsx`, and `TrashIcon.tsx`.

### What changed?

Several attributes previously written in kebab-case were changed to camelCase to adhere to JSX syntax standards. These include `stroke-linecap`, `stroke-linejoin`, `fill-rule`, and `clip-rule`.

### How to test?

Ensure that the rendering and functionality of the icons in the application remain unchanged after this update. 

### Why make this change?

The update ensures that our code complies with the preferred casing convention in JSX and avoids all potential related issues.
2024-05-22 14:46:53 -04:00
..
templates Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
AppleIcon.tsx Signup with sdk 2024-04-23 21:21:58 -05:00
ArrowLeftCircleFilledIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
ArrowRightCircleFilledIcon.tsx Signup with sdk 2024-04-23 21:21:58 -05:00
ArrowRightCircleIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
BranchIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
BranchStrokeIcon.tsx [6/n][project settings ui] collaborators ui 2024-05-14 19:56:14 +00:00
BuildingIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
CalendarDaysIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
CalendarIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
CheckIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
CheckRadioIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
CheckRadioOutlineIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
CheckRoundFilledIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
ChevronDoubleDownIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
ChevronDownIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
ChevronDownSmallIcon.tsx ui cleanup 2024-05-14 19:58:32 +00:00
ChevronGrabberHorizontal.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
ChevronLeft.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
ChevronRight.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
ChevronUpDown.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
ChevronUpSmallIcon.tsx ui cleanup 2024-05-14 19:58:32 +00:00
CirclePlaceholderOnIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
ClockIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
ClockOutlineIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
CollaboratorsIcon.tsx Refactor: Rename SVG Properties for React Standard (#194) 2024-05-22 14:46:53 -04:00
CommitIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
CopyIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
CopyUnfilledIcon.tsx Refactor: Rename SVG Properties for React Standard (#194) 2024-05-22 14:46:53 -04:00
CrossCircleIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
CrossIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
CursorBoxIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
CustomIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
EditBigIcon.tsx EditEnvironmentVariableRow cleanup (#74) 2024-05-16 20:39:42 -04:00
EllipseIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
EllipsesIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
FolderIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
GearIcon.tsx format prettier 2024-05-09 16:18:52 -04:00
GithubIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
GitHubLogoIcon.tsx [6/n][project settings ui] collaborators ui 2024-05-14 19:56:14 +00:00
GithubStrokeIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
GitIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
GitTeaIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
GlobeIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
GoogleIcon.tsx Signup with sdk 2024-04-23 21:21:58 -05:00
HideEyeOffIcon.tsx EditEnvironmentVariableRow cleanup (#74) 2024-05-16 20:39:42 -04:00
HorizontalDotIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
index.ts EditEnvironmentVariableRow cleanup (#74) 2024-05-16 20:39:42 -04:00
InfoRoundFilledIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
InfoSquareIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
KeyIcon.tsx Signup with sdk 2024-04-23 21:21:58 -05:00
LifeBuoyIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
LinkChainIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
LinkIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
LoaderIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
LoadingIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
LockIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
LogoutIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
MenuIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
MinusCircleIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
NotificationBellIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
PencilIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
PlusIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
QuestionMarkRoundFilledIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
QuestionMarkRoundIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
README.md ️ feat: create custom icon and plus icon component 2024-02-19 21:15:51 +07:00
RefreshIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
RocketIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
SearchIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
SettingsSlidersIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
ShowEyeIcon.tsx EditEnvironmentVariableRow cleanup (#74) 2024-05-16 20:39:42 -04:00
SnowballIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
StorageIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
SwitchIcon.tsx [6/n][project settings ui] collaborators ui 2024-05-14 19:56:14 +00:00
TrashIcon.tsx Refactor: Rename SVG Properties for React Standard (#194) 2024-05-22 14:46:53 -04:00
TrendingIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
UndoIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
WarningDiamondIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
WarningIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00
WarningTriangleIcon.tsx Lint using tsc; fix type errors 2024-04-11 21:49:14 -05:00

1. What icons are compatible with this component?

  • Viewbox "0 0 24 24": From where you're exporting from, please make sure the icon is using viewBox="0 0 24 24" before downloading/exporting. Not doing so will result in incorrect icon scaling

2. How to add a new icon?

2.1 Sanitising the icon

  1. Duplicate a current icon e.g. CrossIcon and rename it accordingly.
  2. Rename the function inside the new file you duplicated too
  3. Replace the markup with your SVG markup (make sure it complies with the above section's rule)
  4. Depending on the svg you pasted... A. If the <svg> has only 1 child, remove the <svg> parent entirely so you only have the path left B. If your component has more than 1 paths, rename <svg> tag with the <g> tag. Then, remove all attributes of this <g> tag so that it's just <g>
  5. Usually, icons are single colored. If that's the case, replace all fill/stroke color with currentColor. E.g. . Leave the other attributes without removing them.
  6. If your icon has more than one colour, then it's up to you to decide whether we want to use tailwind to help set the fill and stroke colors
  7. Lastly, export your icon in index.ts by following what was done for CrossIcon
  8. Make sure to provide a name to the <CustomIcon> component for accessibility sake
  9. Done!

2.3 Use your newly imported icon

  1. You can change simply use <BellIcon size="32" /> to quickly change both width and height with the same value (square). For custom viewBox, width and height, simply provide all three props.
  2. Coloring the icon: Simply add a className with text color. E.g. <BellIcon className="text-gray-500" />