Skip to content

Commit 0734dae

Browse files
committed
#687 Fix overlapping navbar and about buttons on small screen
1 parent f8e59b5 commit 0734dae

File tree

1 file changed

+11
-2
lines changed
  • browser/data-browser/src/components/SideBar

1 file changed

+11
-2
lines changed

browser/data-browser/src/components/SideBar/About.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import { styled } from 'styled-components';
22
import React from 'react';
33
import { FaGithub, FaDiscord, FaBook } from 'react-icons/fa';
44
import { IconButtonLink, IconButtonVariant } from '../IconButton/IconButton';
5+
import { useMediaQuery } from '../../hooks/useMediaQuery';
6+
import { useSettings } from '../../helpers/AppSettings';
7+
import { transition } from '../../helpers/transition';
58

69
interface AboutItem {
710
icon: React.ReactNode;
@@ -28,12 +31,16 @@ const aboutMenuItems: AboutItem[] = [
2831
];
2932

3033
export function About() {
34+
const narrow = useMediaQuery('(max-width: 920px)');
35+
const { navbarFloating } = useSettings();
36+
const elivate = narrow && navbarFloating;
37+
3138
return (
3239
<>
3340
{/* <SideBarHeader>
3441
<Logo style={{ height: '1.1rem', maxWidth: '100%' }} />
3542
</SideBarHeader> */}
36-
<AboutWrapper>
43+
<AboutWrapper $elivate={elivate}>
3744
{aboutMenuItems.map(({ href, icon, helper }) => (
3845
<IconButtonLink
3946
target='_blank'
@@ -53,10 +60,12 @@ export function About() {
5360
);
5461
}
5562

56-
const AboutWrapper = styled.div`
63+
const AboutWrapper = styled.div<{ $elivate: boolean }>`
5764
--inner-padding: 0.5rem;
5865
display: flex;
5966
align-items: center;
6067
gap: 0.5rem;
6168
margin-left: calc(1rem - var(--inner-padding));
69+
padding-bottom: ${p => (p.$elivate ? '3.5rem' : '0rem')};
70+
${transition('padding-bottom')}
6271
`;

0 commit comments

Comments
 (0)