From ba0609874ef8e8b0cd16cfe182bf09399edd35ea Mon Sep 17 00:00:00 2001 From: Defectink Date: Fri, 29 Apr 2022 17:19:13 +0800 Subject: [PATCH] Fix tab style Add miss style --- components/RUA/tab/TabItem.tsx | 21 +++++++++++++++ components/RUA/tab/index.tsx | 29 +++++++-------------- components/post/PostComment.tsx | 2 +- pages/about.tsx | 3 --- pages/p/setting-up-docsearch-for-nextjs.mdx | 11 ++++++++ 5 files changed, 42 insertions(+), 24 deletions(-) create mode 100644 components/RUA/tab/TabItem.tsx diff --git a/components/RUA/tab/TabItem.tsx b/components/RUA/tab/TabItem.tsx new file mode 100644 index 0000000..a44bc07 --- /dev/null +++ b/components/RUA/tab/TabItem.tsx @@ -0,0 +1,21 @@ +import classNames from 'classnames'; +import React from 'react'; + +export type ItemProps = { + value: string | number; + label: string | number; + showContent?: boolean; + children?: React.ReactNode; +}; + +const TabItem = ({ showContent, children }: ItemProps) => { + return ( + <> +
+ {children} +
+ + ); +}; + +export default TabItem; diff --git a/components/RUA/tab/index.tsx b/components/RUA/tab/index.tsx index 5db7a83..36f039e 100644 --- a/components/RUA/tab/index.tsx +++ b/components/RUA/tab/index.tsx @@ -1,6 +1,7 @@ import classNames from 'classnames'; import React, { useState } from 'react'; import { useCallback } from 'react'; +import { ItemProps } from './TabItem'; type Props = { defaultValue: string | number; @@ -26,7 +27,11 @@ const Tab = ({ defaultValue, children }: Props) => { return ( <>
-