-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table.Row: add verticalSpacing props #171
Conversation
* set padding-top & padding-bottom (same as `<DataTable />` )
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.
そんなに大きな変更はないのでLGTMしておきます!
再来週一緒にリリースしましょう!
src/components/Table/Table.tsx
Outdated
children: React.ReactNode; | ||
}; | ||
export type Props = React.ComponentPropsWithRef<"table"> & | ||
Partial<{ verticalSpacing: VerticalSpacing }>; |
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.
Partial<{ verticalSpacing: VerticalSpacing }>; | |
{ verticalSpacing?: VerticalSpacting }; |
他のコンポーネントと合わせるとこの書き方が良さそうですね!
src/components/Table/Table.tsx
Outdated
export type Props = { | ||
children: React.ReactNode; | ||
}; | ||
export type Props = React.ComponentPropsWithRef<"table"> & |
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.
なるべく型もexportして、利用者がimportしやすい形にしています(このままでもimportできるけどfrom "ingred-ui/dist/Table"
みたいな感じになる)
なので
export type TableProps = ...
みたいに書いて、同階層のindex.ts
にもexport { default, TableProps } from ..."
と書いておくと良さそうです!
<Typography>verticalSpacing = small</Typography> | ||
{table("small")} |
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.
ドキュメントのどこかにあったような気がするけど探せなかった。。。。
table("small")
でコンポーネントをreturnさせるならJSXで書いた方が良いみたいな話をどこかで聞きました。(DATASTRAPにはこの書き方がないのでそうだったはず)
{["small", "medium", "large"].map(spacing => (....)}
みたいに書いた方が良さそうです!
あ、あと、 |
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.
LGTMです!
ありがとう〜 |
<DataTable />
)