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
[Dialog] Add optional Title
and Description
parts
#741
Conversation
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.
Some initial feedback to discuss. I'll finish reviewing when we've decided the outcome of this in case things change.
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.
👍 looking good. Just one little nit that I'll leave up to you 😛
packages/react/dialog/src/Dialog.tsx
Outdated
Close, | ||
// | ||
LabelWarningContext, |
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.
nit: Can we expose just LabelWarningProvider
instead please? It looks like we only need the provider externally and we could also simplify consumption then:
const LabelWarningProvider: React.FC<LabelWarningContextValue> = props => {
return <LabelWarningContext.Provider value={props} />;
}
<Dialog.LabelWarningProvider contentName="" titleName="" docsSlug="">
</Dialog.LabelWarningProvider>
vs
<Dialog.LabelWarningContext.Provider value={React.useMemo(() => ({ contentName: '', titleName: '', docsSlug: '' ), [])}>
</Dialog.LabelWarningContext.Provider>
I'm not too bothered about doing the memoization internally though, it was more Dialog.LabelWarningProvider
vs Dialog.LabelWarningContext.Provider
that was bothering me so the following would suffice if you prefer 😅
const LabelWarningProvider = LabelWarningContext.Provider;
export { LabelWarningProvider };
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.
I went with the latter, because the former was missing the fact it should render children
which brings us back in the same situation as createContext
.
Closes #729
This PR:
Title
andDescription
fromAlertDialog
intoDialog
itselfDialog
but required forAlertDialog
so that's reflected in the warnings