mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-31 13:47:02 +02:00
chore: Use fixed-width sidebar instead of dynamic modal. (#10315)
Uses a fixed-width sidebar component instead of the dynamic sidebar component for the change request sidebar. This fixes a case where the modal would suddenly grow narrower when a change was sent to review (introduced in https://github.com/Unleash/unleash/pull/10307): Before submitting (in main)  After submission (in main)  Before submitting (on this branch)  After submission (on this branch)  I don't see any reason why the CR sidebar should be dynamic, so making it fixed width with the solution we already have seems pretty sensible to me. Keeps things consistent and prevents us from solving the same problem multiple times in multiple ways. Yes this change makes the sidebar a little wider, but I think that's fine. It's also closer to what it was previously, I think. Again, we can rethink this if necessary. And of course, the modal still smooshes together when it needs to: <img width="431" alt="image" src="https://github.com/user-attachments/assets/54f31284-75a4-4038-9943-c3b42363ecb4" />
This commit is contained in:
parent
3bb7426392
commit
8e0e9c834e
@ -1,6 +1,6 @@
|
||||
import { useState, type VFC } from 'react';
|
||||
import { Box, Button, styled, Typography } from '@mui/material';
|
||||
import { DynamicSidebarModal } from 'component/common/SidebarModal/SidebarModal';
|
||||
import { SidebarModal } from 'component/common/SidebarModal/SidebarModal';
|
||||
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||
import CheckCircle from '@mui/icons-material/CheckCircle';
|
||||
@ -22,7 +22,6 @@ interface IChangeRequestSidebarProps {
|
||||
const StyledPageContent = styled(PageContent)(({ theme }) => ({
|
||||
height: '100vh',
|
||||
overflow: 'auto',
|
||||
maxWidth: 'max(40vw, 1000px)',
|
||||
padding: theme.spacing(6),
|
||||
[theme.breakpoints.down('md')]: {
|
||||
padding: theme.spacing(4, 2),
|
||||
@ -106,11 +105,7 @@ export const ChangeRequestSidebar: VFC<IChangeRequestSidebarProps> = ({
|
||||
|
||||
if (!loading && !data) {
|
||||
return (
|
||||
<DynamicSidebarModal
|
||||
open={open}
|
||||
onClose={onClose}
|
||||
label='Review changes'
|
||||
>
|
||||
<SidebarModal open={open} onClose={onClose} label='Review changes'>
|
||||
<StyledPageContent
|
||||
disableBorder={true}
|
||||
header={<PageHeader titleElement='Review your changes' />}
|
||||
@ -119,16 +114,12 @@ export const ChangeRequestSidebar: VFC<IChangeRequestSidebarProps> = ({
|
||||
{/* FIXME: empty state */}
|
||||
<BackButton onClick={onClose}>Close</BackButton>
|
||||
</StyledPageContent>
|
||||
</DynamicSidebarModal>
|
||||
</SidebarModal>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<DynamicSidebarModal
|
||||
open={open}
|
||||
onClose={onClose}
|
||||
label='Review changes'
|
||||
>
|
||||
<SidebarModal open={open} onClose={onClose} label='Review changes'>
|
||||
<StyledPageContent
|
||||
disableBorder={true}
|
||||
header={<ReviewChangesHeader />}
|
||||
@ -159,6 +150,6 @@ export const ChangeRequestSidebar: VFC<IChangeRequestSidebarProps> = ({
|
||||
</ChangeRequestPlausibleProvider>
|
||||
))}
|
||||
</StyledPageContent>
|
||||
</DynamicSidebarModal>
|
||||
</SidebarModal>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user