mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-15 13:05:59 +08:00
fix: Decouple login page logo component to avoid conflict with internal logo
This commit is contained in:
parent
b6bc1f8bc4
commit
f02b77b99f
@ -20,7 +20,7 @@ const LogoSite: FC<LogoSiteProps> = ({
|
|||||||
|
|
||||||
let src = theme === 'light' ? '/logo/logo-site.png' : `/logo/logo-site-${theme}.png`
|
let src = theme === 'light' ? '/logo/logo-site.png' : `/logo/logo-site-${theme}.png`
|
||||||
if (systemFeatures.branding.enabled)
|
if (systemFeatures.branding.enabled)
|
||||||
src = systemFeatures.branding.login_page_logo
|
src = systemFeatures.branding.workspace_logo
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<img
|
<img
|
||||||
|
34
web/app/signin/LoginLogo.tsx
Normal file
34
web/app/signin/LoginLogo.tsx
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
'use client'
|
||||||
|
import type { FC } from 'react'
|
||||||
|
import classNames from '@/utils/classnames'
|
||||||
|
import { useSelector } from '@/context/app-context'
|
||||||
|
import { useGlobalPublicStore } from '@/context/global-public-context'
|
||||||
|
|
||||||
|
type LoginLogoProps = {
|
||||||
|
className?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const LoginLogo: FC<LoginLogoProps> = ({
|
||||||
|
className,
|
||||||
|
}) => {
|
||||||
|
const { systemFeatures } = useGlobalPublicStore()
|
||||||
|
const { theme } = useSelector((s) => {
|
||||||
|
return {
|
||||||
|
theme: s.theme,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
let src = theme === 'light' ? '/logo/logo-site.png' : `/logo/logo-site-${theme}.png`
|
||||||
|
if (systemFeatures.branding.enabled)
|
||||||
|
src = systemFeatures.branding.login_page_logo
|
||||||
|
|
||||||
|
return (
|
||||||
|
<img
|
||||||
|
src={src}
|
||||||
|
className={classNames('block w-auto h-10', className)}
|
||||||
|
alt='logo'
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default LoginLogo
|
@ -1,17 +1,17 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { useContext } from 'use-context-selector'
|
import { useContext } from 'use-context-selector'
|
||||||
|
import LoginLogo from './LoginLogo'
|
||||||
import Select from '@/app/components/base/select/locale'
|
import Select from '@/app/components/base/select/locale'
|
||||||
import { languages } from '@/i18n/language'
|
import { languages } from '@/i18n/language'
|
||||||
import { type Locale } from '@/i18n'
|
import { type Locale } from '@/i18n'
|
||||||
import I18n from '@/context/i18n'
|
import I18n from '@/context/i18n'
|
||||||
import LogoSite from '@/app/components/base/logo/logo-site'
|
|
||||||
|
|
||||||
const Header = () => {
|
const Header = () => {
|
||||||
const { locale, setLocaleOnClient } = useContext(I18n)
|
const { locale, setLocaleOnClient } = useContext(I18n)
|
||||||
|
|
||||||
return <div className='flex items-center justify-between p-6 w-full'>
|
return <div className='flex items-center justify-between p-6 w-full'>
|
||||||
<LogoSite />
|
<LoginLogo />
|
||||||
<Select
|
<Select
|
||||||
value={locale}
|
value={locale}
|
||||||
items={languages.filter(item => item.supported)}
|
items={languages.filter(item => item.supported)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user