Skip to content

Commit

Permalink
common imports
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravsinhaweb committed Oct 28, 2023
1 parent a6ffc91 commit 1057569
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
10 changes: 1 addition & 9 deletions src/components/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import { ButtonProps } from '@/types/button.types';
import React from 'react';

interface ButtonProps {
type?: 'button' | 'submit' | 'reset';
className: string;
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
children: React.ReactNode;
disabled?: boolean;
testId?: string;
}

const Button: React.FC<ButtonProps> = ({ type, className, onClick, children, disabled, testId }) => {
return (
<button data-testid={testId} type={type} className={className} onClick={onClick} disabled={disabled}>
Expand Down
7 changes: 1 addition & 6 deletions src/components/ProfileIcon/ProfileIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { ProfileIconProps } from '@/types/profileIcon.types';
import React from 'react';

interface ProfileIconProps {
firstName: string;
lastName: string;
size: number;
}

const ProfileIcon: React.FC<ProfileIconProps> = ({ firstName, lastName, size }) => {
const initials = (firstName[0] + lastName[0]).toUpperCase();
const randomColor = Math.floor(Math.random() * 16777215).toString(16);
Expand Down
8 changes: 8 additions & 0 deletions src/types/button.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export interface ButtonProps {
type?: 'button' | 'submit' | 'reset';
className: string;
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
children: React.ReactNode;
disabled?: boolean;
testId?: string;
}
5 changes: 5 additions & 0 deletions src/types/profileIcon.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface ProfileIconProps {
firstName: string;
lastName: string;
size: number;
}

0 comments on commit 1057569

Please sign in to comment.