Skip to content

Commit

Permalink
fix(ui) Fix entity profile sidebar width issues (#5305)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Collins <[email protected]>
  • Loading branch information
chriscollins3456 and Chris Collins authored Jul 1, 2022
1 parent f08c3f7 commit 1ce4349
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ const HeaderAndTabsFlex = styled.div`
const Sidebar = styled.div<{ $width: number }>`
max-height: 100%;
overflow: auto;
flex-basis: ${(props) => props.$width}px;
width: ${(props) => props.$width}px;
min-width: ${(props) => props.$width}px;
padding-left: 20px;
padding-right: 20px;
`;
Expand All @@ -117,7 +118,6 @@ const defaultSidebarSection = {
visible: (_, _1) => true,
};

const INITIAL_SIDEBAR_WIDTH = 400;
const MAX_SIDEBAR_WIDTH = 800;
const MIN_SIDEBAR_WIDTH = 200;

Expand Down Expand Up @@ -147,7 +147,7 @@ export const EntityProfile = <T, U>({
display: { ...defaultSidebarSection, ...sidebarSection.display },
}));

const [sidebarWidth, setSidebarWidth] = useState(INITIAL_SIDEBAR_WIDTH);
const [sidebarWidth, setSidebarWidth] = useState(window.innerWidth * 0.25);
const [browserWidth, setBrowserWith] = useState(window.innerWidth * 0.2);
const [shouldUpdateBrowser, setShouldUpdateBrowser] = useState(false);

Expand Down

0 comments on commit 1ce4349

Please sign in to comment.