feat : remove all files props types and add 1 file props.s.ts for all props types
This commit is contained in:
7
src/types/alertProps.d.ts
vendored
7
src/types/alertProps.d.ts
vendored
@@ -1,7 +0,0 @@
|
|||||||
export type MessageType = "info" | "danger" | "success" | "warning" | "dark";
|
|
||||||
|
|
||||||
export interface AlertProps {
|
|
||||||
children: React.ReactNode;
|
|
||||||
type?: "info" | "danger" | "success" | "warning" | "dark";
|
|
||||||
message: string;
|
|
||||||
}
|
|
||||||
5
src/types/buttonProps.d.ts
vendored
5
src/types/buttonProps.d.ts
vendored
@@ -1,5 +0,0 @@
|
|||||||
export interface ButtonProps {
|
|
||||||
children: React.ReactNode;
|
|
||||||
onClick?: () => void;
|
|
||||||
extra?: React.CSSProperties;
|
|
||||||
}
|
|
||||||
7
src/types/mobileMenu.d.ts
vendored
7
src/types/mobileMenu.d.ts
vendored
@@ -1,7 +0,0 @@
|
|||||||
import { Route } from "./routes";
|
|
||||||
|
|
||||||
export interface MobileMenuProps {
|
|
||||||
isOpen: boolean;
|
|
||||||
toggleMenu: () => void;
|
|
||||||
routes: Route[];
|
|
||||||
}
|
|
||||||
4
src/types/mobileMenuButton.d.ts
vendored
4
src/types/mobileMenuButton.d.ts
vendored
@@ -1,4 +0,0 @@
|
|||||||
export interface MobileMenuButtonProps {
|
|
||||||
isOpen: boolean;
|
|
||||||
onClick: () => void;
|
|
||||||
}
|
|
||||||
12
src/types/navbarLink.d.ts
vendored
12
src/types/navbarLink.d.ts
vendored
@@ -1,12 +0,0 @@
|
|||||||
import { NavLinkProps } from "react-router-dom";
|
|
||||||
|
|
||||||
export interface NavbarLinkProps {
|
|
||||||
to: string;
|
|
||||||
children: React.ReactNode;
|
|
||||||
onClick?: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface NavData {
|
|
||||||
isActive: boolean;
|
|
||||||
isPending: boolean;
|
|
||||||
}
|
|
||||||
65
src/types/props.d.ts
vendored
Normal file
65
src/types/props.d.ts
vendored
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
// begin Alert.tsx
|
||||||
|
export type MessageType = "info" | "danger" | "success" | "warning" | "dark";
|
||||||
|
|
||||||
|
export interface AlertProps {
|
||||||
|
children: React.ReactNode;
|
||||||
|
type?: "info" | "danger" | "success" | "warning" | "dark";
|
||||||
|
message: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// begin Button.tsx
|
||||||
|
export interface ButtonProps {
|
||||||
|
children: React.ReactNode;
|
||||||
|
onClick?: () => void;
|
||||||
|
extra?: React.CSSProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
// begin Route
|
||||||
|
export interface Route {
|
||||||
|
id: number;
|
||||||
|
path: string;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// begin MobileMenu.tsx
|
||||||
|
export interface MobileMenuProps {
|
||||||
|
isOpen: boolean;
|
||||||
|
toggleMenu: () => void;
|
||||||
|
routes: Route[];
|
||||||
|
}
|
||||||
|
|
||||||
|
// begin MobileMenuButton.tsx
|
||||||
|
export interface MobileMenuButtonProps {
|
||||||
|
isOpen: boolean;
|
||||||
|
onClick: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
// begin NavbarLink.tsx
|
||||||
|
import { NavLinkProps } from "react-router-dom";
|
||||||
|
|
||||||
|
export interface NavbarLinkProps {
|
||||||
|
to: string;
|
||||||
|
children: React.ReactNode;
|
||||||
|
onClick?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface NavData {
|
||||||
|
isActive: boolean;
|
||||||
|
isPending: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
// begin ListTutorial.tsx
|
||||||
|
import { SetStateAction } from "react";
|
||||||
|
|
||||||
|
export type TutorialList = { id: number; name: string }[];
|
||||||
|
|
||||||
|
export interface ListTutorialsProps {
|
||||||
|
tutorialList: TutorialList;
|
||||||
|
activeTutorial: number;
|
||||||
|
setActiveTutorial: SetStateAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type LearnProps = {
|
||||||
|
activeTutorial: number;
|
||||||
|
tutorialList: TutorialList;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user