-
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
Feat isOutsideRange
prop
#1375
Feat isOutsideRange
prop
#1375
Conversation
🦋 Changeset detectedLatest commit: 574b04d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for ingred-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
export const DayContainer = styled.button<{ selected: boolean }>` | ||
const DayContainerBase = styled.button<{ selected?: boolean }>` |
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.
元々使っていた DayContainer
をベースにして、DayContainer
と DisableDayContainer
の共通部分として定義
const isOutsideRange = (day: dayjs.Dayjs) => | ||
day.isBefore(dayjs().subtract(1, "day")); |
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.
story では1日前から選択できないようにしている
996e914
to
574b04d
Compare
dayjs(new Date(m.year(), m.month(), day)), | ||
); | ||
|
||
return ( |
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.
nits
return
でネストしちゃうならインラインで書いちゃえ派だった。
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.
条件が若干複雑に見えるので分けてしまいました。
まあこういう派閥の領域を縛るなら lint かな。
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.
一旦ここはこのままでmm
#975
isOutsideRange
prop の追加。react-dates の
isOutsideRange
prop と同じ挙動をする。以下のコンポーネントに追加。