Skip to content

Commit

Permalink
refactor: defining the type for component props
Browse files Browse the repository at this point in the history
  • Loading branch information
rarlala committed Sep 16, 2024
1 parent c3504f5 commit 96faae4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/components/footer/csButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React, { memo } from 'react';
import { Icons } from '../icons';

const CsButton = memo(function Button({ title }: { title: string }) {
type Props = {
title: string;
};

const CsButton = memo(function Button({ title }: Props) {
return (
<button
type="button"
Expand Down
10 changes: 4 additions & 6 deletions src/components/header/myMenuItem.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { MyMenuItemType } from '@/types/header';
import Link from 'next/link';
import { memo } from 'react';

type MyMenuItem = {
icon: JSX.Element;
title: string;
link: string;
style?: string;
type Props = {
menu: MyMenuItemType;
};

const MyMenuItem = memo(function MyMenuItem({ menu }: { menu: MyMenuItem }) {
const MyMenuItem = memo(function MyMenuItem({ menu }: Props) {
return (
<li className={`hidden md:block ${menu?.style}`}>
<Link href={menu.link} className="flex gap-1 items-center">
Expand Down

0 comments on commit 96faae4

Please sign in to comment.