Skip to content

Commit

Permalink
fix(ids): genera ids unicos en iconos (#650)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathangarrido authored Nov 14, 2024
1 parent 1d8d0b1 commit 959f1da
Show file tree
Hide file tree
Showing 23 changed files with 102 additions and 42 deletions.
10 changes: 6 additions & 4 deletions src/atoms/Icons/ArrowRight.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { uniqueId } from '@/services'
import { Base, BaseProps } from './Base'

export function ArrowRight(props: BaseProps): JSX.Element {
const id = `clip-${uniqueId()}`
return (
<Base {...props}>
<g clipPath="url(#clip0)">
<g clipPath={`url(#${id})`}>
<mask
id="mask0"
id={`mask-${id}`}
style={{ maskType: 'alpha' }}
width="16"
height="16"
Expand All @@ -15,12 +17,12 @@ export function ArrowRight(props: BaseProps): JSX.Element {
>
<path fill="#fff" d="M16 16H32V32H16z" transform="rotate(180 16 16)" />
</mask>
<g mask="url(#mask0)">
<g mask={`url(#mask-${id})`}>
<path fill="currentColor" d="M6.074 14L12 8 6.074 2 4 4.1 7.852 8 4 11.9 6.074 14z" />
</g>
</g>
<defs>
<clipPath id="clip0">
<clipPath id={id}>
<path fill="#fff" d="M0 0H16V16H0z" />
</clipPath>
</defs>
Expand Down
4 changes: 3 additions & 1 deletion src/atoms/Icons/Loader.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { uniqueId } from '@/services'

interface props {
fill?: string
}
Expand All @@ -6,7 +8,7 @@ export function Loader({ fill = '#fff' }: props): JSX.Element {
return (
<div className="loaderAsync" data-testid="loaderAsync">
<svg
id="prefix__eXySq0EBKm11"
id={uniqueId()}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 38 20"
shapeRendering="geometricPrecision"
Expand Down
6 changes: 4 additions & 2 deletions src/atoms/Icons/TinyAlertError.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { uniqueId } from '@/services'
import { Base, BaseProps } from './Base'

export function TinyAlertError(props: BaseProps): JSX.Element {
const id = `clip${uniqueId()}`
return (
<Base {...props} w="12px" h="12px" viewBox="0 0 12 12">
<g clipPath="url(#clip0_2165_6683)">
<g clipPath={`url(#${id})`}>
<circle cx="6" cy="6" r="6" fill="#CC0000" />
<path
fillRule="evenodd"
Expand All @@ -13,7 +15,7 @@ export function TinyAlertError(props: BaseProps): JSX.Element {
/>
</g>
<defs>
<clipPath id="clip0_2165_6683">
<clipPath id={id}>
<rect width="12px" height="12px" fill="white" />
</clipPath>
</defs>
Expand Down
6 changes: 4 additions & 2 deletions src/atoms/Icons/TinyAlertSuccess.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { uniqueId } from '@/services'
import { Base, BaseProps } from './Base'

export function TinyAlertSuccess(props: BaseProps): JSX.Element {
const id = `clip${uniqueId()}`
return (
<Base {...props} w="12px" h="12px" viewBox="0 0 12 12">
<g clipPath="url(#clip0_2191_1138)">
<g clipPath={`url(#${id})`}>
<circle cx="6" cy="6" r="6" fill="#28A745" />
<path
fillRule="evenodd"
Expand All @@ -13,7 +15,7 @@ export function TinyAlertSuccess(props: BaseProps): JSX.Element {
/>
</g>
<defs>
<clipPath id="clip0_2191_1138">
<clipPath id={id}>
<rect width="12" height="12" fill="white" />
</clipPath>
</defs>
Expand Down
2 changes: 1 addition & 1 deletion src/molecules/Buttons/Btn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function Btn({
color = vars('colors-neutral-white'),
disabled = false,
fillLoader = vars('colors-neutral-white'),
id,
id = undefined,
isFullWidth = false,
isLoading = false,
leftIcon,
Expand Down
7 changes: 5 additions & 2 deletions src/organisms/Resources/Icons/Avi.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { FC } from 'react'
import { Icon } from '@chakra-ui/react'

import { uniqueId } from '@/services'

export const Avi: FC = () => {
const id = `clip${uniqueId()}`
return (
<Icon
width="32px"
Expand All @@ -10,7 +13,7 @@ export const Avi: FC = () => {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_2871_5797)">
<g clipPath={`url(#${id})`}>
<path d="M20 1V9H28" stroke="#B0CFE0" strokeWidth="2" strokeMiterlimit="10" />
<path
d="M28 13V9L20 1H4V13"
Expand Down Expand Up @@ -44,7 +47,7 @@ export const Avi: FC = () => {
/>
</g>
<defs>
<clipPath id="clip0_2871_5797">
<clipPath id={id}>
<rect width="32" height="32" fill="white" />
</clipPath>
</defs>
Expand Down
7 changes: 5 additions & 2 deletions src/organisms/Resources/Icons/Csv.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { FC } from 'react'
import { Icon } from '@chakra-ui/react'

import { uniqueId } from '@/services'

export const Csv: FC = () => {
const id = `clip${uniqueId()}`
return (
<Icon
width="32px"
Expand All @@ -10,7 +13,7 @@ export const Csv: FC = () => {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_2871_5770)">
<g clipPath={`url(#${id})`}>
<path d="M20 1V9H28" stroke="#B0CFE0" strokeWidth="2" strokeMiterlimit="10" />
<path
d="M28 13V9L20 1H4V13"
Expand Down Expand Up @@ -47,7 +50,7 @@ export const Csv: FC = () => {
/>
</g>
<defs>
<clipPath id="clip0_2871_5770">
<clipPath id={id}>
<rect width="32" height="32" fill="white" />
</clipPath>
</defs>
Expand Down
7 changes: 5 additions & 2 deletions src/organisms/Resources/Icons/Doc.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { FC } from 'react'
import { Icon } from '@chakra-ui/react'

import { uniqueId } from '@/services'

export const Doc: FC = () => {
const id = `clip${uniqueId()}`
return (
<Icon
width="32px"
Expand All @@ -10,7 +13,7 @@ export const Doc: FC = () => {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_2871_5732)">
<g clipPath={`url(#${id})`}>
<path d="M20 1V9H28" stroke="#B0CFE0" strokeWidth="2" strokeMiterlimit="10" />
<path
d="M28 13V9L20 1H4V13"
Expand Down Expand Up @@ -47,7 +50,7 @@ export const Doc: FC = () => {
/>
</g>
<defs>
<clipPath id="clip0_2871_5732">
<clipPath id={id}>
<rect width="32" height="32" fill="white" />
</clipPath>
</defs>
Expand Down
7 changes: 5 additions & 2 deletions src/organisms/Resources/Icons/Docx.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { FC } from 'react'
import { Icon } from '@chakra-ui/react'

import { uniqueId } from '@/services'

export const Docx: FC = () => {
const id = `clip${uniqueId()}`
return (
<Icon
width="32px"
Expand All @@ -10,7 +13,7 @@ export const Docx: FC = () => {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_2871_5741)">
<g clipPath={`url(#${id})`}>
<path d="M20 1V9H28" stroke="#B0CFE0" strokeWidth="2" strokeMiterlimit="10" />
<path
d="M28 13V9L20 1H4V13"
Expand Down Expand Up @@ -51,7 +54,7 @@ export const Docx: FC = () => {
/>
</g>
<defs>
<clipPath id="clip0_2871_5741">
<clipPath id={id}>
<rect width="32" height="32" fill="white" />
</clipPath>
</defs>
Expand Down
7 changes: 5 additions & 2 deletions src/organisms/Resources/Icons/Gif.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { FC } from 'react'
import { Icon } from '@chakra-ui/react'

import { uniqueId } from '@/services'

export const Gif: FC = () => {
const id = `clip${uniqueId()}`
return (
<Icon
width="32px"
Expand All @@ -10,7 +13,7 @@ export const Gif: FC = () => {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_2871_5704)">
<g clipPath={`url(#${id})`}>
<path d="M20 1V9H28" stroke="#B0CFE0" strokeWidth="2" strokeMiterlimit="10" />
<path
d="M28 13V9L20 1H4V13"
Expand Down Expand Up @@ -41,7 +44,7 @@ export const Gif: FC = () => {
/>
</g>
<defs>
<clipPath id="clip0_2871_5704">
<clipPath id={id}>
<rect width="32" height="32" fill="white" />
</clipPath>
</defs>
Expand Down
7 changes: 5 additions & 2 deletions src/organisms/Resources/Icons/Jpeg.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { FC } from 'react'
import { Icon } from '@chakra-ui/react'

import { uniqueId } from '@/services'

export const Jpeg: FC = () => {
const id = `clip${uniqueId()}`
return (
<Icon
width="32px"
Expand All @@ -10,7 +13,7 @@ export const Jpeg: FC = () => {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_2871_5685)">
<g clipPath={`url(#${id})`}>
<path d="M20 1V9H28" stroke="#B0CFE0" strokeWidth="2" strokeMiterlimit="10" />
<path
d="M28 13V9L20 1H4V13"
Expand Down Expand Up @@ -51,7 +54,7 @@ export const Jpeg: FC = () => {
/>
</g>
<defs>
<clipPath id="clip0_2871_5685">
<clipPath id={id}>
<rect width="32" height="32" fill="white" />
</clipPath>
</defs>
Expand Down
7 changes: 5 additions & 2 deletions src/organisms/Resources/Icons/Mkv.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { FC } from 'react'
import { Icon } from '@chakra-ui/react'

import { uniqueId } from '@/services'

export const Mkv: FC = () => {
const id = `clip${uniqueId()}`
return (
<Icon
width="32px"
Expand All @@ -10,7 +13,7 @@ export const Mkv: FC = () => {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_2871_5806)">
<g clipPath={`url(#${id})`}>
<path d="M20 1V9H28" stroke="#B0CFE0" strokeWidth="2" strokeMiterlimit="10" />
<path
d="M28 13V9L20 1H4V13"
Expand Down Expand Up @@ -47,7 +50,7 @@ export const Mkv: FC = () => {
/>
</g>
<defs>
<clipPath id="clip0_2871_5806">
<clipPath id={id}>
<rect width="32" height="32" fill="white" />
</clipPath>
</defs>
Expand Down
7 changes: 5 additions & 2 deletions src/organisms/Resources/Icons/Mp3.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { FC } from 'react'
import { Icon } from '@chakra-ui/react'

import { uniqueId } from '@/services'

export const Mp3: FC = () => {
const id = `clip${uniqueId()}`
return (
<Icon
width="32px"
Expand All @@ -10,7 +13,7 @@ export const Mp3: FC = () => {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_2871_5815)">
<g clipPath={`url(#${id})`}>
<path d="M20 1V9H28" stroke="#B0CFE0" strokeWidth="2" strokeMiterlimit="10" />
<path
d="M28 13V9L20 1H4V13"
Expand Down Expand Up @@ -47,7 +50,7 @@ export const Mp3: FC = () => {
/>
</g>
<defs>
<clipPath id="clip0_2871_5815">
<clipPath id={id}>
<rect width="32" height="32" fill="white" />
</clipPath>
</defs>
Expand Down
7 changes: 5 additions & 2 deletions src/organisms/Resources/Icons/Mp4.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { FC } from 'react'
import { Icon } from '@chakra-ui/react'

import { uniqueId } from '@/services'

export const Mp4: FC = () => {
const id = `clip${uniqueId()}`
return (
<Icon
width="32px"
Expand All @@ -10,7 +13,7 @@ export const Mp4: FC = () => {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_2871_5788)">
<g clipPath={`url(#${id})`}>
<path d="M20 1V9H28" stroke="#B0CFE0" strokeWidth="2" strokeMiterlimit="10" />
<path
d="M28 13V9L20 1H4V13"
Expand Down Expand Up @@ -47,7 +50,7 @@ export const Mp4: FC = () => {
/>
</g>
<defs>
<clipPath id="clip0_2871_5788">
<clipPath id={id}>
<rect width="32" height="32" fill="white" />
</clipPath>
</defs>
Expand Down
7 changes: 5 additions & 2 deletions src/organisms/Resources/Icons/Pdf.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { FC } from 'react'
import { Icon } from '@chakra-ui/react'

import { uniqueId } from '@/services'

export const Pdf: FC = () => {
const id = `clip${uniqueId()}`
return (
<Icon
width="32px"
Expand All @@ -10,7 +13,7 @@ export const Pdf: FC = () => {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_2871_5779)">
<g clipPath={`url(#${id})`}>
<path d="M20 1V9H28" stroke="#B0CFE0" strokeWidth="2" strokeMiterlimit="10" />
<path
d="M28 13V9L20 1H4V13"
Expand Down Expand Up @@ -47,7 +50,7 @@ export const Pdf: FC = () => {
/>
</g>
<defs>
<clipPath id="clip0_2871_5779">
<clipPath id={id}>
<rect width="32" height="32" fill="white" />
</clipPath>
</defs>
Expand Down
Loading

0 comments on commit 959f1da

Please sign in to comment.