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

Badgeコンポーネントの追加 #24

Merged
merged 7 commits into from
May 18, 2020
Merged

Badgeコンポーネントの追加 #24

merged 7 commits into from
May 18, 2020

Conversation

youchann
Copy link
Contributor

No description provided.

@youchann youchann added the enhancement New feature or request label May 12, 2020
@youchann youchann self-assigned this May 12, 2020
@youchann
Copy link
Contributor Author

あー、命名は検討余地あるかも。

Badgeって、こっちのイメージもある。
https://material-ui.com/components/badges/

@youchann
Copy link
Contributor Author

TODO: padding変える。

@youchann
Copy link
Contributor Author

Badgeって、こっちのイメージもある。

Material-UI文脈のBadgeは別コンポーネントで提供すると良いかも。

@youchann
Copy link
Contributor Author

↑あとで作ろうねという話に

@youchann
Copy link
Contributor Author

  • fontWeight
  • fontSize

を自由に決められるようにする

@youchann youchann requested a review from kinokoruumu May 14, 2020 02:52

export const Container = styled.span<Props>`
display: inline-block;
padding: 0.25em 0.7em;
Copy link
Contributor

Choose a reason for hiding this comment

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

themeのspace基準で当てて欲しい!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

当てました!(noroさんとdesign確認済み)

export const Container = styled.span<Props>`
display: inline-block;
padding: ${({ theme }) => `${theme.spacing / 2}px ${theme.spacing}px`};
border-radius: ${({ type }) => type === "pill" ? "10rem" : "4px"};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

pill型の場合は極端に大きな値を埋めることで、要素の大きさに依存することなく形を表示するようにした。with noroさん

@youchann youchann requested a review from kinokoruumu May 15, 2020 05:55
color,
type = "normal",
component = "span",
fontSize = "0.65em",
Copy link
Contributor

Choose a reason for hiding this comment

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

htmlに当たってるfont-size依存になるのでpx指定がいいかと!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://getbootstrap.com/docs/4.4/components/badge/

  • bootstrapのように親要素からよしなにサイズを決めたい
  • とはいえど細かい調整をしたいときもあるよね

みたいな流れでfontSizepropsが誕生したのですが、em指定に大きなデメリットとかってあったりしますかね...?

Copy link
Contributor

Choose a reason for hiding this comment

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

なるほど!!そういう意図だったのか!
storybook見たらいい感じになってたので大丈夫そう!

Copy link
Contributor

@kinokoruumu kinokoruumu left a comment

Choose a reason for hiding this comment

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

LGTMです!

@youchann youchann merged commit 975c4f0 into master May 18, 2020
@youchann youchann deleted the add-badge branch May 18, 2020 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants