Skip to content

Commit

Permalink
Add another shrink button to the sidebar
Browse files Browse the repository at this point in the history
- this might cause confusion since its not in the same spot as the other one but fingers crossed
  • Loading branch information
mrdjohnson committed Nov 20, 2024
1 parent 36da238 commit ca81e77
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import Bars3 from '~/icons/Bars3'
import Search from '~/icons/Search'
import AppSettings from '~/icons/AppSettings'
import ChevronDown from '~/icons/ChevronDown'
import ShrinkHorizontal from '~/icons/ShrinkHorizontal'

import { connectionStore } from '~/core/connection/ConnectionStore'
import { personaStore } from '~/core/persona/PersonaStore'
import { settingStore } from '~/core/setting/SettingStore'

const KeyboardTooltip = ({
command,
Expand Down Expand Up @@ -45,8 +47,16 @@ const Navbar = observer(() => {

return (
<div className="navbar mb-2 flex h-auto min-h-0 flex-row justify-between gap-3 bg-base-300 p-1 md:mb-0 md:flex-col md:p-0">
<div className="ml-2 hidden pr-2 md:block md:text-xl">
<h1 className="hidden">LLM-X</h1>
<div className="ml-2 hidden items-center pr-2 md:flex md:text-xl">
<button
className="absolute left-2 text-base-content/30 transition-colors duration-100 ease-in-out hover:text-base-content/80"
onClick={() =>
settingStore.update({ isSidebarOpen: !settingStore.setting.isSidebarOpen })
}
>
<ShrinkHorizontal />
</button>

<FunTitle className="md:text-xl" />
</div>

Expand Down
12 changes: 12 additions & 0 deletions src/icons/ShrinkHorizontal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// https://icon-sets.iconify.design/tdesign/shrink-horizontal/

export default function ShrinkHorizontal() {
return (
<svg xmlns="http://www.w3.org/2000/svg" className="h-4 w-5" viewBox="0 0 24 24">
<path
fill="currentColor"
d="M1.5 11h5.086l-2.5-2.5L5.5 7.086L10.414 12L5.5 16.914L4.086 15.5l2.5-2.5H1.5zM13 3v18h-2V3zm.586 9L18.5 7.086L19.914 8.5l-2.5 2.5H22.5v2h-5.086l2.5 2.5l-1.414 1.414z"
></path>
</svg>
)
}

0 comments on commit ca81e77

Please sign in to comment.