Skip to content
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

Merged
merged 4 commits into from
Sep 17, 2020
Merged

Table.Row: add verticalSpacing props #171

merged 4 commits into from
Sep 17, 2020

Conversation

suzuken
Copy link
Contributor

@suzuken suzuken commented Sep 4, 2020

  • set padding-top & padding-bottom (same as <DataTable /> )

* set padding-top & padding-bottom (same as `<DataTable />` )
Copy link
Contributor

@youchann youchann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そんなに大きな変更はないのでLGTMしておきます!

再来週一緒にリリースしましょう!

children: React.ReactNode;
};
export type Props = React.ComponentPropsWithRef<"table"> &
Partial<{ verticalSpacing: VerticalSpacing }>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Partial<{ verticalSpacing: VerticalSpacing }>;
{ verticalSpacing?: VerticalSpacting };

他のコンポーネントと合わせるとこの書き方が良さそうですね!

export type Props = {
children: React.ReactNode;
};
export type Props = React.ComponentPropsWithRef<"table"> &
Copy link
Contributor

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 ..."と書いておくと良さそうです!

Comment on lines 63 to 64
<Typography>verticalSpacing = small</Typography>
{table("small")}
Copy link
Contributor

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 => (....)}みたいに書いた方が良さそうです!

@youchann
Copy link
Contributor

youchann commented Sep 7, 2020

あ、あと、Cell.tsxHeaderCell.tsxのほうにあるpaddingは消して良さそうです!

Copy link
Contributor

@youchann youchann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMです!

@suzuken
Copy link
Contributor Author

suzuken commented Sep 17, 2020

ありがとう〜

@suzuken suzuken merged commit f79def4 into master Sep 17, 2020
@suzuken suzuken deleted the table-small branch September 17, 2020 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants