Skip to content

Commit 0ec4a9f

Browse files
feat(tertiary): icono custom (#604)
1 parent 277787d commit 0ec4a9f

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/documentation/pages/Molecules/Buttons.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ListComponent, MyHeading, MyText, MyTittle, Code } from '@/documentation/components'
22
import { BtnPrimary, BtnSecondary, BtnTertiary, BtnLink } from '@/molecules'
3-
import { Password } from '@/atoms/Icons'
3+
import { GoAhead, Password } from '@/atoms/Icons'
44

55
export const Buttons = (): JSX.Element => {
66
return (
@@ -96,6 +96,11 @@ export const Buttons = (): JSX.Element => {
9696
<BtnTertiary iconStatus='download'>download</BtnTertiary>
9797
<BtnTertiary iconStatus='noIcon'>noIcon</BtnTertiary>"
9898
/>
99+
<MyTittle>Iconos Custom</MyTittle>
100+
<ListComponent>
101+
<BtnTertiary iconCustom={<GoAhead />}>custom</BtnTertiary>
102+
</ListComponent>
103+
<Code text="<BtnTertiary iconCustom={<GoAhead />} >custom</BtnTertiary>" />
99104
</>
100105
)
101106
}

src/molecules/Buttons/BtnTertiary.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ export interface propsTertiaryBtn {
2626
| 'record'
2727
| 'download'
2828
| 'noIcon'
29+
30+
/** Se permite agregar un nuevo icono, para casos en que no sirvan los de la lista definida */
31+
iconCustom?: JSX.Element
2932
children?: React.ReactNode
3033
rightIcon?: boolean
3134
withoutColor?: boolean
@@ -40,6 +43,7 @@ export interface propsTertiaryBtn {
4043
export function BtnTertiary({
4144
children,
4245
iconStatus = 'multimedia',
46+
iconCustom,
4347
rightIcon,
4448
withoutColor = false,
4549
m = '0',
@@ -68,7 +72,10 @@ export function BtnTertiary({
6872
noIcon: <></>,
6973
}
7074

71-
const icon = btnIcons[iconStatus] ?? btnIcons.multimedia
75+
let icon = btnIcons[iconStatus] ?? btnIcons.multimedia
76+
if (iconCustom) {
77+
icon = iconCustom
78+
}
7279
const rIcon = rightIcon ? icon : undefined
7380
const lIcon = !rightIcon ? icon : undefined
7481

0 commit comments

Comments
 (0)