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

feat(Portal): take in consideration parent theme #1506

Merged
merged 4 commits into from
Apr 24, 2024

Conversation

ValeraS
Copy link
Collaborator

@ValeraS ValeraS commented Apr 11, 2024

No description provided.

@ValeraS ValeraS requested review from amje and korvin89 as code owners April 11, 2024 10:31
@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@gravity-ui-bot
Copy link
Contributor

Playwright Test Component is ready.

@ValeraS ValeraS force-pushed the feat/portal-theme-provider branch from 94e7969 to 22980f3 Compare April 15, 2024 17:58
@ValeraS ValeraS force-pushed the feat/portal-theme-provider branch from 22980f3 to 886c785 Compare April 22, 2024 13:51
@ValeraS ValeraS force-pushed the feat/portal-theme-provider branch from 886c785 to 380ffbe Compare April 23, 2024 11:25
@ValeraS ValeraS requested a review from IsaevAlexandr April 23, 2024 15:47
// don't support runtime breakpoint redefinition. Breakpoints defined only one at LayoutTheme
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
}, [breakpointsMap]);
Copy link
Contributor

Choose a reason for hiding this comment

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

if user pass layout theme object like

<ThemeProvider layout={{
  config: {
    breakpoints: {...}
  }
}} >...</ThemeProvider>

and App will have some state upper ThemeProvider it will cause this function to be constantly recalculated.

We need good reasons to be able to set breakpoints dynamically in runtime

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if config never changes, the user can move its creation outside the component. Otherwise, he can expect the changes to be taken into account.

@@ -8,4 +8,5 @@ export interface ThemeContextProps {
theme: Theme;
themeValue: RealTheme;
direction: Direction;
scoped?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

may be some comment here?
why is this property needed?

@ValeraS ValeraS merged commit 8c7ca2d into main Apr 24, 2024
4 checks passed
@ValeraS ValeraS deleted the feat/portal-theme-provider branch April 24, 2024 14:43
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.

5 participants