This is an automated email from the ASF dual-hosted git repository.
enzomartellucci pushed a commit to branch enxdev/refactor/antd5/create-wrappers
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to
refs/heads/enxdev/refactor/antd5/create-wrappers by this push:
new 02f81e9bf3 refactor(storybook): remove constants in favor of static
values in layout stories
02f81e9bf3 is described below
commit 02f81e9bf326a50178aeaa8d3cebec795850b697
Author: Enzo Martellucci <[email protected]>
AuthorDate: Thu Mar 20 21:51:02 2025 +0100
refactor(storybook): remove constants in favor of static values in layout
stories
---
.../src/components/Layout/Layout.stories.tsx | 50 ++++++++--------------
1 file changed, 19 insertions(+), 31 deletions(-)
diff --git a/superset-frontend/src/components/Layout/Layout.stories.tsx
b/superset-frontend/src/components/Layout/Layout.stories.tsx
index ac5563456c..202c162ffe 100644
--- a/superset-frontend/src/components/Layout/Layout.stories.tsx
+++ b/superset-frontend/src/components/Layout/Layout.stories.tsx
@@ -51,28 +51,20 @@ export const LayoutStory: Story = {
hasSider: true,
},
render: args => {
- const theme: 'light' | 'dark' = 'dark';
- const collapsible = true;
- const collapsedWidth = 80;
- const width = 200;
- const reverseArrow = false;
- const breakpoint: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' = 'md';
- const headerVisible = true;
- const footerVisible = true;
- const [collapsed, setCollapsed] = useState(false); // Solo questa rimane
con useState
+ const [collapsed, setCollapsed] = useState(false);
return (
<Layout style={{ minHeight: '100vh' }}>
{args.hasSider && (
<Sider
- collapsible={collapsible}
+ collapsible
collapsed={collapsed}
onCollapse={setCollapsed}
- theme={theme}
- width={width}
- collapsedWidth={collapsedWidth}
- reverseArrow={reverseArrow}
- breakpoint={breakpoint}
+ theme="dark"
+ width="200"
+ collapsedWidth="80"
+ reverseArrow={false}
+ breakpoint="md"
>
<div
className="logo"
@@ -93,17 +85,15 @@ export const LayoutStory: Story = {
</Sider>
)}
<Layout>
- {headerVisible && (
- <Header
- style={{
- background: '#fff',
- padding: '0 16px',
- textAlign: 'center',
- }}
- >
- Header
- </Header>
- )}
+ <Header
+ style={{
+ background: '#fff',
+ padding: '0 16px',
+ textAlign: 'center',
+ }}
+ >
+ Header
+ </Header>
<Content
style={{
margin: '16px',
@@ -114,11 +104,9 @@ export const LayoutStory: Story = {
>
Content Area
</Content>
- {footerVisible && (
- <Footer style={{ textAlign: 'center' }}>
- Ant Design Layout Footer
- </Footer>
- )}
+ <Footer style={{ textAlign: 'center' }}>
+ Ant Design Layout Footer
+ </Footer>
</Layout>
</Layout>
);