Skip to content

Commit d16764d

Browse files
authored
fix: children type and umami-tags (#1076)
* fix: children type and umami-tags * fix: property name
1 parent be300bb commit d16764d

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/Main/Main.stories.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { CirclePlusIcon, SnowflakeIcon, SparklesIcon } from 'lucide-react';
33

44
import { Avatar, Box, Link, Typography } from '@mui/material';
55

6+
import { ReactNode } from 'react';
7+
68
import { Context } from '@graasp/sdk';
79

810
import MainMenu from '@/MainMenu/MainMenu.js';
@@ -30,11 +32,7 @@ export default meta;
3032

3133
type Story = StoryObj<typeof meta>;
3234

33-
const LinkComponent = ({
34-
children,
35-
}: {
36-
children: JSX.Element;
37-
}): JSX.Element => (
35+
const LinkComponent = ({ children }: { children: ReactNode }): JSX.Element => (
3836
<Link
3937
sx={{ textDecoration: 'none' }}
4038
color='inherit'

src/Main/Main.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
styled,
1414
} from '@mui/material';
1515

16-
import { useEffect } from 'react';
16+
import { ReactNode, useEffect } from 'react';
1717

1818
import { Context } from '@graasp/sdk';
1919

@@ -77,24 +77,24 @@ type Props = {
7777
/**
7878
* Content to display inside the drawer / sidebar
7979
*/
80-
drawerContent: JSX.Element;
80+
drawerContent: ReactNode;
8181
/**
8282
* Content to display inside the footer
8383
*/
84-
footerContent?: JSX.Element;
84+
footerContent?: ReactNode;
8585
/**
8686
* Content to display inside the main area.
8787
* This is usually the page content
8888
*/
89-
children: JSX.Element | JSX.Element[];
89+
children: ReactNode;
9090
/**
9191
* Left content presented in the header
9292
*/
93-
headerLeftContent?: JSX.Element;
93+
headerLeftContent?: ReactNode;
9494
/**
9595
* Right content presented in the header
9696
*/
97-
headerRightContent?: JSX.Element;
97+
headerRightContent?: ReactNode;
9898
/**
9999
* Override the state of the drawer
100100
* defaults to `false`
@@ -103,7 +103,7 @@ type Props = {
103103
/**
104104
* Wrapper component that supplies a link facility wrapping the logo
105105
*/
106-
LinkComponent?: (props: { children: JSX.Element }) => JSX.Element;
106+
LinkComponent?: (props: { children: ReactNode }) => JSX.Element;
107107
/**
108108
* Component that should be rendered to show the platform switch
109109
*/
@@ -187,6 +187,9 @@ const MainWithDrawerContent = ({
187187
aria-label={drawerOpenAriaLabel}
188188
onClick={handleDrawerToggle}
189189
edge='start'
190+
data-umami-event='header-drawer-toggle'
191+
data-umami-event-context={context}
192+
data-umami-event-open={open}
190193
>
191194
{open ? <MenuOpen /> : <MenuIcon />}
192195
</IconButton>

0 commit comments

Comments
 (0)