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: added default size to Panel and remove default title #910

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Vidit-Kushwaha
Copy link
Contributor

Notes for Reviewers

This PR added feature of default size in panel and removed the default title from component

Signed commits

  • Yes, I signed my commits.

Comment on lines +59 to +119
<SistentThemeProviderWithoutBaseLine initialMode={mode}>
<Draggable handle=".drag-handle">
<PanelContainer theme={theme} intitialPosition={intitialPosition} sx={sx}>
<Resizable
defaultSize={{
width: defaultSize?.width || '18rem',
height: defaultSize?.height || 'auto'
}}
onResize={() => {
window.dispatchEvent(new Event('panel-resize'));
}}
enable={{
top: true,
right: true,
bottom: true,
left: true,
topRight: true,
bottomRight: true,
bottomLeft: true,
topLeft: true
}}
>
<ResizableContent>
<ErrorBoundary>
<div className="drag-handle">
<DrawerHeader>
<Box display="flex" justifyContent="flex-end" padding="8px">
{toggleExpandAll && (
<Tooltip title={areAllExpanded ? 'Collapse All' : 'Expand All'}>
<CustomIconButton onClick={toggleExpandAll}>
{areAllExpanded ? <CollapseAllIcon /> : <ExpandAllIcon />}
</CustomIconButton>
</Tooltip>
)}
</Box>
<DragHandle />
<HeaderContainer>
<HeaderActionsContainer
id={`${id}-panel-header-actions-container`}
></HeaderActionsContainer>
<PanelTitle>{title}</PanelTitle>
{minimizePanel && (
<CustomIconButton onClick={minimizePanel}>
<FullScreenIcon fill={theme.palette.common.white} />
</CustomIconButton>
</Tooltip>
)}
</Box>
<DragHandle />
<HeaderContainer>
<HeaderActionsContainer
id={`${id}-panel-header-actions-container`}
></HeaderActionsContainer>
<PanelTitle>{title}</PanelTitle>
{minimizePanel && (
<CustomIconButton onClick={minimizePanel}>
<FullScreenIcon fill={theme.palette.common.white} />
)}
<CustomIconButton onClick={handleClose}>
<CloseIcon fill={theme.palette.common.white} />
</CustomIconButton>
)}
<CustomIconButton onClick={handleClose}>
<CloseIcon fill={theme.palette.common.white} />
</CustomIconButton>
</HeaderContainer>
</DrawerHeader>
</div>
<PanelBody className="panel-body">{children}</PanelBody>
</ErrorBoundary>
</ResizableContent>
</Resizable>
</PanelContainer>
</Draggable>
</HeaderContainer>
</DrawerHeader>
</div>
<PanelBody className="panel-body" theme={theme}>
{children}
</PanelBody>
</ErrorBoundary>
</ResizableContent>
</Resizable>
</PanelContainer>
</Draggable>
</SistentThemeProviderWithoutBaseLine>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you don't need to add the SistentThemeProviderWithoutBaseLine

Copy link
Contributor

Choose a reason for hiding this comment

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

Check if it doesn't required than remove it.

Copy link
Contributor

Choose a reason for hiding this comment

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

You created 3 PR in sistent for migrating the panel component. This is the reason why I suggested you create a PR of meshery-extensions first and after that create a PR in sistent so no need to go back and forth with the small changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

is it required SistentThemeProviderWithoutBaseLine? @Vidit-Kushwaha

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have to test it again. I will let you know whether it is requested or not.

@amitamrutiya
Copy link
Contributor

One more request before I merge this PR. Can you create a documentation for the newly added panel component here -> https://layer5.io/projects/sistent

@Vidit-Kushwaha
Copy link
Contributor Author

Sure I will add a document component in layer5

@amitamrutiya
Copy link
Contributor

It is okay if you don't add now there is more important work is in your plate compared to adding documentation. Just confirm one thing that I asked eariler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants