-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add ClassNameTable for some component docs.
- created ClassNameTable component for docs website.
- Loading branch information
Showing
8 changed files
with
116 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { useRouter } from 'next/router'; | ||
import React from 'react'; | ||
import i18n from '../util/i18next'; | ||
|
||
interface Props { | ||
className?: string; | ||
component: string; | ||
} | ||
|
||
export const ClassNameTable = ({ className = '', component }: Props) => { | ||
const { locale } = useRouter(); | ||
const t = (k: string) => i18n.t(k, { ns: 'classNameTable', lng: locale }); | ||
|
||
const classNames = i18n.t(`component.${component}`, { ns: 'classNameTable', lng: locale, returnObjects: true }); | ||
|
||
return ( | ||
<> | ||
<div className={`${className} py-2`}> | ||
<table className="table bw bordered"> | ||
<thead> | ||
<tr> | ||
<th>{t('header.className')}</th> | ||
<th>{t('header.description')}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{Object.entries(classNames).map(([name, description]) => ( | ||
<tr> | ||
<th>{name}</th> | ||
<td>{description}</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
</div> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"header": { | ||
"className": "Class Name", | ||
"description": "Description" | ||
}, | ||
"component": { | ||
"accordion": { | ||
"accordion-group": "Wrapper htmlFor accordion group", | ||
"accordion": "Wrapper htmlFor the title and content", | ||
"bordered": "Set Bordered Style", | ||
"toggle": "Toggle htmlFor accordion", | ||
"title": "Title section of the accordion", | ||
"content": "Content section of the accordion", | ||
"open": "The accordion will be opened by default" | ||
}, | ||
"avatar": { | ||
"avatar": "Wrapper htmlFor avatar img", | ||
"square": "Set square shape(default: circle)", | ||
"ring": "Set ring style", | ||
"avatar-group": "Wrapper htmlFor avatar group", | ||
"xs": "Set extra small size", | ||
"sm": "Set small size", | ||
"md": "Set medium size", | ||
"lg": "Set large size", | ||
"xl": "Set extra large size" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"header": { | ||
"className": "类名", | ||
"description": "描述" | ||
}, | ||
"component": { | ||
"accordion": { | ||
"accordion-group": "用于手风琴组的包装", | ||
"accordion": "用于手风琴项目的包装", | ||
"bordered": "设置带边框样式", | ||
"toggle": "设置手风琴触发器", | ||
"title": "手风琴项目标题", | ||
"content": "手风琴项目隐藏的内容", | ||
"open": "设置手风琴项目默认开启" | ||
}, | ||
"avatar": { | ||
"avatar": "用于头像 img 的包装", | ||
"square": "设置方形(默认为圆形)", | ||
"ring": "设置外环样式", | ||
"avatar-group": "用于头像组的包装", | ||
"xs": "设置超小尺寸", | ||
"sm": "设置较小尺寸", | ||
"md": "设置中等尺寸", | ||
"lg": "设置较大尺寸", | ||
"xl": "设置超大尺寸" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
521dfb2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
sira-website – ./
sira.vercel.app
sira-website-riccox.vercel.app
sira-website-git-main-riccox.vercel.app
sira-design.party
www.sira-design.party