Skip to content

Commit

Permalink
#687 Fix overlapping navbar and about buttons on small screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Polleps committed Nov 2, 2023
1 parent f8e59b5 commit 0734dae
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions browser/data-browser/src/components/SideBar/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { styled } from 'styled-components';
import React from 'react';
import { FaGithub, FaDiscord, FaBook } from 'react-icons/fa';
import { IconButtonLink, IconButtonVariant } from '../IconButton/IconButton';
import { useMediaQuery } from '../../hooks/useMediaQuery';
import { useSettings } from '../../helpers/AppSettings';
import { transition } from '../../helpers/transition';

interface AboutItem {
icon: React.ReactNode;
Expand All @@ -28,12 +31,16 @@ const aboutMenuItems: AboutItem[] = [
];

export function About() {
const narrow = useMediaQuery('(max-width: 920px)');
const { navbarFloating } = useSettings();
const elivate = narrow && navbarFloating;

return (
<>
{/* <SideBarHeader>
<Logo style={{ height: '1.1rem', maxWidth: '100%' }} />
</SideBarHeader> */}
<AboutWrapper>
<AboutWrapper $elivate={elivate}>
{aboutMenuItems.map(({ href, icon, helper }) => (
<IconButtonLink
target='_blank'
Expand All @@ -53,10 +60,12 @@ export function About() {
);
}

const AboutWrapper = styled.div`
const AboutWrapper = styled.div<{ $elivate: boolean }>`
--inner-padding: 0.5rem;
display: flex;
align-items: center;
gap: 0.5rem;
margin-left: calc(1rem - var(--inner-padding));
padding-bottom: ${p => (p.$elivate ? '3.5rem' : '0rem')};
${transition('padding-bottom')}
`;

0 comments on commit 0734dae

Please sign in to comment.