Skip to content

Commit

Permalink
fix: remove global side-sheet style to custom wrapper for portal side…
Browse files Browse the repository at this point in the history
… sheets
  • Loading branch information
Noggling committed Aug 5, 2024
1 parent 9029eb4 commit eaa8adb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { PortalAction, usePortalActions } from '@equinor/portal-core';

import { useEffect, useState } from 'react';
import styled from 'styled-components';

const SideSheetWrapper = styled.div`
--custom-header-height: 0px;
`;

export function PortalSideSheet() {
const [portalAction, setPortalAction] = useState<PortalAction | undefined>();
Expand All @@ -16,7 +21,11 @@ export function PortalSideSheet() {

const Component = portalAction?.component;
if (portalAction && Component) {
return <Component action={portalAction} onClose={closeActiveAction} open={!!portalAction} />;
return (
<SideSheetWrapper>
<Component action={portalAction} onClose={closeActiveAction} open={!!portalAction} />{' '}
</SideSheetWrapper>
);
}
return null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const GlobalStyle = createGlobalStyle`
--custom-header-height: 0px;
--custom-side-sheet-height: 100%
--portal-header-height: 48px;
}
}
body {
font-family: Equinor, sans-serif;
Expand Down

0 comments on commit eaa8adb

Please sign in to comment.