From 4898fa7dcfeaec26d3e128d50741ee704c14417c Mon Sep 17 00:00:00 2001 From: jeffvli Date: Tue, 13 Jun 2023 18:08:42 -0700 Subject: [PATCH] Add responsive styling for min-width sidebar --- .../sidebar/components/action-bar.tsx | 99 ++++++++++++++----- 1 file changed, 75 insertions(+), 24 deletions(-) diff --git a/src/renderer/features/sidebar/components/action-bar.tsx b/src/renderer/features/sidebar/components/action-bar.tsx index c9f4794a..519d0312 100644 --- a/src/renderer/features/sidebar/components/action-bar.tsx +++ b/src/renderer/features/sidebar/components/action-bar.tsx @@ -7,11 +7,10 @@ import { AppMenu } from '/@/renderer/features/titlebar/components/app-menu'; import { useContainerQuery } from '/@/renderer/hooks'; import { useCommandPalette } from '/@/renderer/store'; -const ActionsContainer = styled(Grid)` +const ActionsContainer = styled.div` display: flex; align-items: center; height: 70px; - padding: 0 1rem; -webkit-app-region: drag; input { @@ -20,35 +19,87 @@ const ActionsContainer = styled(Grid)` `; export const ActionBar = () => { - const cq = useContainerQuery({ sm: 300 }); + const cq = useContainerQuery({ md: 300 }); const navigate = useNavigate(); const { open } = useCommandPalette(); return ( - - - } - placeholder="Search" - size="md" - onClick={open} - onKeyDown={(e) => { - if (e.key === 'Enter' || e.key === ' ') { - open(); - } - }} - /> - - + + {cq.isMd ? ( + + + } + placeholder="Search" + size="md" + onClick={open} + onKeyDown={(e) => { + if (e.key === 'Enter' || e.key === ' ') { + open(); + } + }} + /> + + + + + + + + + + + + + + + + + ) : ( + - + )} ); };