Skip to content

Commit

Permalink
revert social media link
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Jan 4, 2024
1 parent 214739e commit c81f301
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 39 deletions.
38 changes: 30 additions & 8 deletions web/containers/CardSidebar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import { ReactNode, useState } from 'react'

import { useAtomValue } from 'jotai'
import {
ChevronDownIcon,
MoreVerticalIcon,
FolderOpenIcon,
Code2Icon,
PencilIcon,
} from 'lucide-react'
import { twMerge } from 'tailwind-merge'

import { useActiveModel } from '@/hooks/useActiveModel'
import { useClickOutside } from '@/hooks/useClickOutside'

import { activeThreadAtom } from '@/helpers/atoms/Thread.atom'

interface Props {
children: ReactNode
title: string
Expand All @@ -28,6 +33,8 @@ export default function CardSidebar({
const [more, setMore] = useState(false)
const [menu, setMenu] = useState<HTMLDivElement | null>(null)
const [toggle, setToggle] = useState<HTMLDivElement | null>(null)
const { activeModel } = useActiveModel()
const activeThread = useAtomValue(activeThreadAtom)

useClickOutside(() => setMore(false), null, [menu, toggle])

Expand Down Expand Up @@ -77,7 +84,7 @@ export default function CardSidebar({

{more && (
<div
className="absolute right-4 top-8 z-20 w-64 rounded-lg border border-border bg-background shadow-lg"
className="absolute right-4 top-8 z-20 w-72 rounded-lg border border-border bg-background shadow-lg"
ref={setMenu}
>
<div
Expand All @@ -101,15 +108,15 @@ export default function CardSidebar({
{title === 'Model' ? (
<div className="flex flex-col">
<span className="font-medium text-black dark:text-muted-foreground">
{openFolderTitle}
Show in Finder
</span>
<span className="mt-1 text-muted-foreground">
Opens thread.json. Changes affect this thread only.
</span>
</div>
) : (
<span className="text-bold text-black dark:text-muted-foreground">
{openFolderTitle}
Show in Finder
</span>
)}
</>
Expand All @@ -121,18 +128,33 @@ export default function CardSidebar({
setMore(false)
}}
>
<Code2Icon
<PencilIcon
size={16}
className="mt-0.5 flex-shrink-0 text-muted-foreground"
/>
<>
<div className="flex flex-col">
<span className="font-medium text-black dark:text-muted-foreground">
View as JSON
<span className="line-clamp-1 font-medium text-black dark:text-muted-foreground">
Edit Global Defaults for{' '}
<span
className="font-bold"
title={activeThread?.assistants[0].model.id}
>
{activeThread?.assistants[0].model.id}
</span>
</span>
<span className="mt-1 text-muted-foreground">
Opens <span className="lowercase">{title}.json.</span>&nbsp;
Changes affect all new threads.
{title === 'Model' ? (
<>
Opens <span className="lowercase">{title}.json.</span>
&nbsp;Changes affect all new assistants and threads.
</>
) : (
<>
Opens <span className="lowercase">{title}.json.</span>
&nbsp;Changes affect all new threads.
</>
)}
</span>
</div>
</>
Expand Down
51 changes: 20 additions & 31 deletions web/containers/Layout/Ribbon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import { useState } from 'react'

import {
Tooltip,
TooltipContent,
TooltipTrigger,
TooltipArrow,
Modal,
ModalTitle,
ModalContent,
ModalHeader,
ModalFooter,
ModalDescription,
ModalClose,
Button,
} from '@janhq/uikit'
import { motion as m } from 'framer-motion'

Expand All @@ -21,8 +11,8 @@ import {
SettingsIcon,
MonitorIcon,
LayoutGridIcon,
// Twitter,
// Github,
Twitter,
Github,
} from 'lucide-react'

import { twMerge } from 'tailwind-merge'
Expand Down Expand Up @@ -64,22 +54,22 @@ export default function RibbonNav() {
},
]

// const linksMenu = [
// {
// name: 'Twitter',
// icon: (
// <Twitter size={20} className="flex-shrink-0 text-muted-foreground" />
// ),
// link: 'https://twitter.com/janhq_',
// },
// {
// name: 'Github',
// icon: (
// <Github size={20} className="flex-shrink-0 text-muted-foreground" />
// ),
// link: 'https://github.com/janhq/jan',
// },
// ]
const linksMenu = [
{
name: 'Twitter',
icon: (
<Twitter size={20} className="flex-shrink-0 text-muted-foreground" />
),
link: 'https://twitter.com/janhq_',
},
{
name: 'Github',
icon: (
<Github size={20} className="flex-shrink-0 text-muted-foreground" />
),
link: 'https://github.com/janhq/jan',
},
]

const secondaryMenus = [
{
Expand Down Expand Up @@ -148,8 +138,7 @@ export default function RibbonNav() {
</div>

<div>
{/* Temporary hidden social media until we finalize design */}
{/* <>
<>
{linksMenu
.filter((link) => !!link)
.map((link, i) => {
Expand All @@ -174,7 +163,7 @@ export default function RibbonNav() {
</div>
)
})}
</> */}
</>

{secondaryMenus
.filter((secondary) => !!secondary)
Expand Down

0 comments on commit c81f301

Please sign in to comment.