mirror of
https://github.com/strapi/strapi.git
synced 2025-10-11 08:02:55 +00:00
fix: scroll in sidenav (#24521)
* fix: scroll in sidenav * fix: update snapshot
This commit is contained in:
parent
16642119fa
commit
3ae249212a
@ -7,6 +7,7 @@ import {
|
|||||||
Typography,
|
Typography,
|
||||||
IconButton,
|
IconButton,
|
||||||
Badge,
|
Badge,
|
||||||
|
ScrollArea,
|
||||||
} from '@strapi/design-system';
|
} from '@strapi/design-system';
|
||||||
import { ChevronDown, Plus } from '@strapi/icons';
|
import { ChevronDown, Plus } from '@strapi/icons';
|
||||||
import { NavLink } from 'react-router-dom';
|
import { NavLink } from 'react-router-dom';
|
||||||
@ -349,8 +350,13 @@ const PageWrapper = styled(Box)`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const Content = ({ children }: { children: React.ReactNode }) => {
|
||||||
|
return <ScrollArea>{children}</ScrollArea>;
|
||||||
|
};
|
||||||
|
|
||||||
export const SubNav = {
|
export const SubNav = {
|
||||||
Main,
|
Main,
|
||||||
|
Content,
|
||||||
Header,
|
Header,
|
||||||
Link,
|
Link,
|
||||||
Sections,
|
Sections,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Badge, Divider, ScrollArea } from '@strapi/design-system';
|
import { Badge, Divider } from '@strapi/design-system';
|
||||||
import { Lightning } from '@strapi/icons';
|
import { Lightning } from '@strapi/icons';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
import { useLocation } from 'react-router-dom';
|
import { useLocation } from 'react-router-dom';
|
||||||
@ -78,7 +78,7 @@ const SettingsNav = ({ isFullPage = false }: { isFullPage?: boolean }) => {
|
|||||||
<Divider />
|
<Divider />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<ScrollArea>
|
<SubNav.Content>
|
||||||
{isFullPage && <SubNav.Header label={label} />}
|
{isFullPage && <SubNav.Header label={label} />}
|
||||||
<SubNav.Sections>
|
<SubNav.Sections>
|
||||||
{sections.map((section) => (
|
{sections.map((section) => (
|
||||||
@ -124,7 +124,7 @@ const SettingsNav = ({ isFullPage = false }: { isFullPage?: boolean }) => {
|
|||||||
</SubNav.Section>
|
</SubNav.Section>
|
||||||
))}
|
))}
|
||||||
</SubNav.Sections>
|
</SubNav.Sections>
|
||||||
</ScrollArea>
|
</SubNav.Content>
|
||||||
</SubNav.Main>
|
</SubNav.Main>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,15 +1,7 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
import { useQueryParams, SubNav } from '@strapi/admin/strapi-admin';
|
import { useQueryParams, SubNav } from '@strapi/admin/strapi-admin';
|
||||||
import {
|
import { Flex, Searchbar, useCollator, useFilter, Divider, Loader } from '@strapi/design-system';
|
||||||
Flex,
|
|
||||||
Searchbar,
|
|
||||||
useCollator,
|
|
||||||
useFilter,
|
|
||||||
Divider,
|
|
||||||
ScrollArea,
|
|
||||||
Loader,
|
|
||||||
} from '@strapi/design-system';
|
|
||||||
import { parse, stringify } from 'qs';
|
import { parse, stringify } from 'qs';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
|
|
||||||
@ -143,7 +135,7 @@ const LeftMenu = ({ isFullPage = false }: { isFullPage?: boolean }) => {
|
|||||||
<Divider />
|
<Divider />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<ScrollArea>
|
<SubNav.Content>
|
||||||
{isFullPage && <SubNav.Header label={label} />}
|
{isFullPage && <SubNav.Header label={label} />}
|
||||||
<Flex
|
<Flex
|
||||||
paddingLeft={{
|
paddingLeft={{
|
||||||
@ -209,7 +201,7 @@ const LeftMenu = ({ isFullPage = false }: { isFullPage?: boolean }) => {
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</SubNav.Sections>
|
</SubNav.Sections>
|
||||||
</ScrollArea>
|
</SubNav.Content>
|
||||||
</SubNav.Main>
|
</SubNav.Main>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -99,6 +99,7 @@ export const ContentTypeBuilderNav = () => {
|
|||||||
<SubNav.Main aria-label={pluginName}>
|
<SubNav.Main aria-label={pluginName}>
|
||||||
<SubNav.Header label={pluginName} />
|
<SubNav.Header label={pluginName} />
|
||||||
<Divider background="neutral150" />
|
<Divider background="neutral150" />
|
||||||
|
<SubNav.Content>
|
||||||
<Flex padding={5} gap={3} direction={'column'} alignItems={'stretch'}>
|
<Flex padding={5} gap={3} direction={'column'} alignItems={'stretch'}>
|
||||||
<tours.contentTypeBuilder.Save>
|
<tours.contentTypeBuilder.Save>
|
||||||
<Flex gap={2}>
|
<Flex gap={2}>
|
||||||
@ -260,6 +261,7 @@ export const ContentTypeBuilderNav = () => {
|
|||||||
</Fragment>
|
</Fragment>
|
||||||
))}
|
))}
|
||||||
</SubNav.Sections>
|
</SubNav.Sections>
|
||||||
|
</SubNav.Content>
|
||||||
<Dialog.Root
|
<Dialog.Root
|
||||||
open={discardConfirmationModalIsOpen}
|
open={discardConfirmationModalIsOpen}
|
||||||
onOpenChange={setDiscardConfirmationModalIsOpen}
|
onOpenChange={setDiscardConfirmationModalIsOpen}
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user