From 994c7007c83eae62fc2bc8a577b3bb50a55dceeb Mon Sep 17 00:00:00 2001 From: AzizbekFayziyev Date: Thu, 28 Nov 2024 14:42:20 +0500 Subject: [PATCH] ui: converted --- .../UI/Button/{Button.jsx => Button.tsx} | 22 +++++++++++++++---- .../UI/NavLink/{NavLink.jsx => NavLink.tsx} | 8 ++++++- .../{RoutersNav.jsx => RoutersNav.tsx} | 9 ++++++-- 3 files changed, 32 insertions(+), 7 deletions(-) rename src/app/components/UI/Button/{Button.jsx => Button.tsx} (66%) rename src/app/components/UI/NavLink/{NavLink.jsx => NavLink.tsx} (67%) rename src/app/components/UI/RoutersNav/{RoutersNav.jsx => RoutersNav.tsx} (75%) diff --git a/src/app/components/UI/Button/Button.jsx b/src/app/components/UI/Button/Button.tsx similarity index 66% rename from src/app/components/UI/Button/Button.jsx rename to src/app/components/UI/Button/Button.tsx index 70620b9..665e963 100644 --- a/src/app/components/UI/Button/Button.jsx +++ b/src/app/components/UI/Button/Button.tsx @@ -2,13 +2,27 @@ import React, { memo } from "react"; import cls from "./Button.module.scss"; import { classNames } from "../../../utils/classNames"; -export const ButtonThemes = { +interface ButtonProps { + className?: string; + children: React.ReactNode; + theme?: ThemeProps; + href?: string; + fullWidth?: boolean; +} + +interface ThemeProps { + Primary: "primary"; + Outline: "outline"; + Clear: "clear"; +} + +export const ButtonThemes: ThemeProps = { Primary: "primary", Outline: "outline", Clear: "clear", }; -export const Button = memo((props) => { +export const Button = memo((props: ButtonProps) => { const { className, children, @@ -22,7 +36,7 @@ export const Button = memo((props) => { return ( {children} @@ -32,7 +46,7 @@ export const Button = memo((props) => { return (