|
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next'
|
|
import { Fragment, useState } from 'react'
|
|
import { Fragment, useState } from 'react'
|
|
import { useRouter } from 'next/navigation'
|
|
import { useRouter } from 'next/navigation'
|
|
import { useContext } from 'use-context-selector'
|
|
import { useContext } from 'use-context-selector'
|
|
-import { RiArrowDownSLine } from '@remixicon/react'
|
|
|
|
|
|
+import { RiArrowDownSLine, RiLogoutBoxRLine } from '@remixicon/react'
|
|
import Link from 'next/link'
|
|
import Link from 'next/link'
|
|
import { Menu, Transition } from '@headlessui/react'
|
|
import { Menu, Transition } from '@headlessui/react'
|
|
import Indicator from '../indicator'
|
|
import Indicator from '../indicator'
|
|
@@ -16,7 +16,6 @@ import Avatar from '@/app/components/base/avatar'
|
|
import { logout } from '@/service/common'
|
|
import { logout } from '@/service/common'
|
|
import { useAppContext } from '@/context/app-context'
|
|
import { useAppContext } from '@/context/app-context'
|
|
import { ArrowUpRight } from '@/app/components/base/icons/src/vender/line/arrows'
|
|
import { ArrowUpRight } from '@/app/components/base/icons/src/vender/line/arrows'
|
|
-import { LogOut01 } from '@/app/components/base/icons/src/vender/line/general'
|
|
|
|
import { useModalContext } from '@/context/modal-context'
|
|
import { useModalContext } from '@/context/modal-context'
|
|
import { LanguagesSupported } from '@/i18n/language'
|
|
import { LanguagesSupported } from '@/i18n/language'
|
|
import { useProviderContext } from '@/context/provider-context'
|
|
import { useProviderContext } from '@/context/provider-context'
|
|
@@ -28,8 +27,8 @@ export type IAppSelector = {
|
|
|
|
|
|
export default function AppSelector({ isMobile }: IAppSelector) {
|
|
export default function AppSelector({ isMobile }: IAppSelector) {
|
|
const itemClassName = `
|
|
const itemClassName = `
|
|
- flex items-center w-full h-9 px-3 text-gray-700 text-[14px]
|
|
|
|
- rounded-lg font-normal hover:bg-gray-50 cursor-pointer
|
|
|
|
|
|
+ flex items-center w-full h-9 px-3 text-text-secondary system-md-regular
|
|
|
|
+ rounded-lg hover:bg-state-base-hover cursor-pointer
|
|
`
|
|
`
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
const [aboutVisible, setAboutVisible] = useState(false)
|
|
const [aboutVisible, setAboutVisible] = useState(false)
|
|
@@ -89,7 +88,7 @@ export default function AppSelector({ isMobile }: IAppSelector) {
|
|
<Menu.Items
|
|
<Menu.Items
|
|
className="
|
|
className="
|
|
absolute right-0 mt-1.5 w-60 max-w-80
|
|
absolute right-0 mt-1.5 w-60 max-w-80
|
|
- divide-y divide-gray-100 origin-top-right rounded-lg bg-white
|
|
|
|
|
|
+ divide-y divide-divider-subtle origin-top-right rounded-lg bg-components-panel-bg-blur
|
|
shadow-lg
|
|
shadow-lg
|
|
"
|
|
"
|
|
>
|
|
>
|
|
@@ -97,13 +96,13 @@ export default function AppSelector({ isMobile }: IAppSelector) {
|
|
<div className='flex flex-nowrap items-center px-4 py-[13px]'>
|
|
<div className='flex flex-nowrap items-center px-4 py-[13px]'>
|
|
<Avatar name={userProfile.name} size={36} className='mr-3' />
|
|
<Avatar name={userProfile.name} size={36} className='mr-3' />
|
|
<div className='grow'>
|
|
<div className='grow'>
|
|
- <div className='leading-5 font-normal text-[14px] text-gray-800 break-all'>{userProfile.name}</div>
|
|
|
|
- <div className='leading-[18px] text-xs font-normal text-gray-500 break-all'>{userProfile.email}</div>
|
|
|
|
|
|
+ <div className='system-md-medium text-text-primary break-all'>{userProfile.name}</div>
|
|
|
|
+ <div className='system-xs-regular text-text-tertiary break-all'>{userProfile.email}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
<div className='px-1 py-1'>
|
|
<div className='px-1 py-1'>
|
|
- <div className='mt-2 px-3 text-xs font-medium text-gray-500'>{t('common.userProfile.workspace')}</div>
|
|
|
|
|
|
+ <div className='mt-2 px-3 text-xs font-medium text-text-tertiary'>{t('common.userProfile.workspace')}</div>
|
|
<WorkplaceSelector />
|
|
<WorkplaceSelector />
|
|
</div>
|
|
</div>
|
|
<div className="px-1 py-1">
|
|
<div className="px-1 py-1">
|
|
@@ -113,7 +112,7 @@ export default function AppSelector({ isMobile }: IAppSelector) {
|
|
href='/account'
|
|
href='/account'
|
|
target='_self' rel='noopener noreferrer'>
|
|
target='_self' rel='noopener noreferrer'>
|
|
<div>{t('common.account.account')}</div>
|
|
<div>{t('common.account.account')}</div>
|
|
- <ArrowUpRight className='hidden w-[14px] h-[14px] text-gray-500 group-hover:flex' />
|
|
|
|
|
|
+ <ArrowUpRight className='hidden w-[14px] h-[14px] text-text-tertiary group-hover:flex' />
|
|
</Link>
|
|
</Link>
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
<Menu.Item>
|
|
<Menu.Item>
|
|
@@ -127,7 +126,7 @@ export default function AppSelector({ isMobile }: IAppSelector) {
|
|
href={mailToSupport(userProfile.email, plan.type, langeniusVersionInfo.current_version)}
|
|
href={mailToSupport(userProfile.email, plan.type, langeniusVersionInfo.current_version)}
|
|
target='_blank' rel='noopener noreferrer'>
|
|
target='_blank' rel='noopener noreferrer'>
|
|
<div>{t('common.userProfile.emailSupport')}</div>
|
|
<div>{t('common.userProfile.emailSupport')}</div>
|
|
- <ArrowUpRight className='hidden w-[14px] h-[14px] text-gray-500 group-hover:flex' />
|
|
|
|
|
|
+ <ArrowUpRight className='hidden w-[14px] h-[14px] text-text-tertiary group-hover:flex' />
|
|
</a>
|
|
</a>
|
|
</Menu.Item>}
|
|
</Menu.Item>}
|
|
<Menu.Item>
|
|
<Menu.Item>
|
|
@@ -136,7 +135,7 @@ export default function AppSelector({ isMobile }: IAppSelector) {
|
|
href='https://github.com/langgenius/dify/discussions/categories/feedbacks'
|
|
href='https://github.com/langgenius/dify/discussions/categories/feedbacks'
|
|
target='_blank' rel='noopener noreferrer'>
|
|
target='_blank' rel='noopener noreferrer'>
|
|
<div>{t('common.userProfile.communityFeedback')}</div>
|
|
<div>{t('common.userProfile.communityFeedback')}</div>
|
|
- <ArrowUpRight className='hidden w-[14px] h-[14px] text-gray-500 group-hover:flex' />
|
|
|
|
|
|
+ <ArrowUpRight className='hidden w-[14px] h-[14px] text-text-tertiary group-hover:flex' />
|
|
</Link>
|
|
</Link>
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
<Menu.Item>
|
|
<Menu.Item>
|
|
@@ -145,7 +144,7 @@ export default function AppSelector({ isMobile }: IAppSelector) {
|
|
href='https://discord.gg/5AEfbxcd9k'
|
|
href='https://discord.gg/5AEfbxcd9k'
|
|
target='_blank' rel='noopener noreferrer'>
|
|
target='_blank' rel='noopener noreferrer'>
|
|
<div>{t('common.userProfile.community')}</div>
|
|
<div>{t('common.userProfile.community')}</div>
|
|
- <ArrowUpRight className='hidden w-[14px] h-[14px] text-gray-500 group-hover:flex' />
|
|
|
|
|
|
+ <ArrowUpRight className='hidden w-[14px] h-[14px] text-text-tertiary group-hover:flex' />
|
|
</Link>
|
|
</Link>
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
<Menu.Item>
|
|
<Menu.Item>
|
|
@@ -156,7 +155,7 @@ export default function AppSelector({ isMobile }: IAppSelector) {
|
|
}
|
|
}
|
|
target='_blank' rel='noopener noreferrer'>
|
|
target='_blank' rel='noopener noreferrer'>
|
|
<div>{t('common.userProfile.helpCenter')}</div>
|
|
<div>{t('common.userProfile.helpCenter')}</div>
|
|
- <ArrowUpRight className='hidden w-[14px] h-[14px] text-gray-500 group-hover:flex' />
|
|
|
|
|
|
+ <ArrowUpRight className='hidden w-[14px] h-[14px] text-text-tertiary group-hover:flex' />
|
|
</Link>
|
|
</Link>
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
<Menu.Item>
|
|
<Menu.Item>
|
|
@@ -165,7 +164,7 @@ export default function AppSelector({ isMobile }: IAppSelector) {
|
|
href='https://roadmap.dify.ai'
|
|
href='https://roadmap.dify.ai'
|
|
target='_blank' rel='noopener noreferrer'>
|
|
target='_blank' rel='noopener noreferrer'>
|
|
<div>{t('common.userProfile.roadmap')}</div>
|
|
<div>{t('common.userProfile.roadmap')}</div>
|
|
- <ArrowUpRight className='hidden w-[14px] h-[14px] text-gray-500 group-hover:flex' />
|
|
|
|
|
|
+ <ArrowUpRight className='hidden w-[14px] h-[14px] text-text-tertiary group-hover:flex' />
|
|
</Link>
|
|
</Link>
|
|
</Menu.Item>
|
|
</Menu.Item>
|
|
{
|
|
{
|
|
@@ -174,7 +173,7 @@ export default function AppSelector({ isMobile }: IAppSelector) {
|
|
<div className={classNames(itemClassName, 'justify-between')} onClick={() => setAboutVisible(true)}>
|
|
<div className={classNames(itemClassName, 'justify-between')} onClick={() => setAboutVisible(true)}>
|
|
<div>{t('common.userProfile.about')}</div>
|
|
<div>{t('common.userProfile.about')}</div>
|
|
<div className='flex items-center'>
|
|
<div className='flex items-center'>
|
|
- <div className='mr-2 text-xs font-normal text-gray-500'>{langeniusVersionInfo.current_version}</div>
|
|
|
|
|
|
+ <div className='mr-2 system-xs-regular text-text-tertiary'>{langeniusVersionInfo.current_version}</div>
|
|
<Indicator color={langeniusVersionInfo.current_version === langeniusVersionInfo.latest_version ? 'green' : 'orange'} />
|
|
<Indicator color={langeniusVersionInfo.current_version === langeniusVersionInfo.latest_version ? 'green' : 'orange'} />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -185,10 +184,10 @@ export default function AppSelector({ isMobile }: IAppSelector) {
|
|
<Menu.Item>
|
|
<Menu.Item>
|
|
<div className='p-1' onClick={() => handleLogout()}>
|
|
<div className='p-1' onClick={() => handleLogout()}>
|
|
<div
|
|
<div
|
|
- className='flex items-center justify-between h-9 px-3 rounded-lg cursor-pointer group hover:bg-gray-50'
|
|
|
|
|
|
+ className='flex items-center justify-between h-9 px-3 rounded-lg cursor-pointer group hover:bg-state-base-hover'
|
|
>
|
|
>
|
|
- <div className='font-normal text-[14px] text-gray-700'>{t('common.userProfile.logout')}</div>
|
|
|
|
- <LogOut01 className='hidden w-[14px] h-[14px] text-gray-500 group-hover:flex' />
|
|
|
|
|
|
+ <div className='system-md-regular text-text-secondary'>{t('common.userProfile.logout')}</div>
|
|
|
|
+ <RiLogoutBoxRLine className='hidden w-4 h-4 text-text-tertiary group-hover:flex' />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</Menu.Item>
|
|
</Menu.Item>
|