Skip to content

Commit

Permalink
chore: save some lines
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrantz committed Feb 7, 2025
1 parent c5ff4e5 commit 861c23f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/paste-core/components/side-panel/src/SidePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ interface SidePanelContentsProps extends SidePanelProps {
isMobile: boolean;
}

const getAs = (isMobile: boolean): any => {
if (isMobile) return ModalDialogPrimitiveContent as any;
return "div";
};

const SidePanelContents = React.forwardRef<HTMLDivElement, SidePanelContentsProps>(
({ label, element, sidePanelId, styles, isMobile, children, ...props }, ref) => {
// Get the offset of the side panel from the top of the viewport
Expand All @@ -89,7 +84,7 @@ const SidePanelContents = React.forwardRef<HTMLDivElement, SidePanelContentsProp
{...safelySpreadBoxProps(props)}
position="absolute"
role="dialog"
as={getAs(isMobile)}
as={isMobile ? (ModalDialogPrimitiveContent as any) : "div"}
aria-label={label}
top={0}
right={0}
Expand Down

0 comments on commit 861c23f

Please sign in to comment.