Skip to content

Commit

Permalink
Merge branch 'fix/logo' into deploy/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
zxhlyh committed Oct 13, 2023
2 parents 84acff4 + aaba74c commit 8f967a0
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 47 deletions.
19 changes: 19 additions & 0 deletions web/app/components/base/logo/logo-embeded-chat-avatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { FC } from 'react'
import Image from 'next/image'

type LogoEmbededChatAvatarProps = {
className?: string
}
const LogoEmbededChatAvatar: FC<LogoEmbededChatAvatarProps> = ({
className,
}) => {
return (
<Image
src='/logo/logo-embeded-chat-avatar.png'
className={`w-10 h-10 ${className}`}
alt='logo'
/>
)
}

export default LogoEmbededChatAvatar
19 changes: 19 additions & 0 deletions web/app/components/base/logo/logo-embeded-chat-header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { FC } from 'react'
import Image from 'next/image'

type LogoEmbededChatHeaderProps = {
className?: string
}
const LogoEmbededChatHeader: FC<LogoEmbededChatHeaderProps> = ({
className,
}) => {
return (
<Image
src='/logo/logo-embeded-chat-header.png'
className={`w-auto h-6 ${className}`}
alt='logo'
/>
)
}

export default LogoEmbededChatHeader
19 changes: 19 additions & 0 deletions web/app/components/base/logo/logo-site.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { FC } from 'react'
import Image from 'next/image'

type LogoSiteProps = {
className?: string
}
const LogoSite: FC<LogoSiteProps> = ({
className,
}) => {
return (
<Image
src='/logo/logo-site.png'
className={`w-auto h-10 ${className}`}
alt='logo'
/>
)
}

export default LogoSite
9 changes: 2 additions & 7 deletions web/app/components/header/account-about/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
import { useTranslation } from 'react-i18next'
import classNames from 'classnames'
import Link from 'next/link'
import Image from 'next/image'
import { useContext } from 'use-context-selector'
import logoUrl from '../../../../public/logo/logo-site.png'
import s from './index.module.css'
import Modal from '@/app/components/base/modal'
import { XClose } from '@/app/components/base/icons/src/vender/line/general'
import type { LangGeniusVersionResponse } from '@/models/common'
import { IS_CE_EDITION } from '@/config'
import I18n from '@/context/i18n'
import LogoSite from '@/app/components/base/logo/logo-site'

type IAccountSettingProps = {
langeniusVersionInfo: LangGeniusVersionResponse
Expand Down Expand Up @@ -39,11 +38,7 @@ export default function AccountAbout({
<XClose className='w-4 h-4 text-gray-500' />
</div>
<div>
<Image
alt='logo'
src={logoUrl}
className='mx-auto mb-2 w-auto h-10'
/>
<LogoSite className='mx-auto mb-2' />
<div className='mb-3 text-center text-xs font-normal text-gray-500'>Version {langeniusVersionInfo?.current_version}</div>
<div className='mb-4 text-center text-xs font-normal text-gray-700'>
<div>© 2023 LangGenius, Inc., Contributors.</div>
Expand Down
22 changes: 13 additions & 9 deletions web/app/components/header/account-dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,19 @@ export default function AppSelector() {
<ArrowUpRight className='hidden w-[14px] h-[14px] text-gray-500 group-hover:flex' />
</Link>
</Menu.Item>
<Menu.Item>
<div className={classNames(itemClassName, 'justify-between')} onClick={() => setAboutVisible(true)}>
<div>{t('common.userProfile.about')}</div>
<div className='flex items-center'>
<div className='mr-2 text-xs font-normal text-gray-500'>{langeniusVersionInfo.current_version}</div>
<Indicator color={langeniusVersionInfo.current_version === langeniusVersionInfo.latest_version ? 'green' : 'orange'} />
</div>
</div>
</Menu.Item>
{
document?.body?.getAttribute('data-public-site-about') !== 'hide' && (
<Menu.Item>
<div className={classNames(itemClassName, 'justify-between')} onClick={() => setAboutVisible(true)}>
<div>{t('common.userProfile.about')}</div>
<div className='flex items-center'>
<div className='mr-2 text-xs font-normal text-gray-500'>{langeniusVersionInfo.current_version}</div>
<Indicator color={langeniusVersionInfo.current_version === langeniusVersionInfo.latest_version ? 'green' : 'orange'} />
</div>
</div>
</Menu.Item>
)
}
</div>
<Menu.Item>
<div className='p-1' onClick={() => handleLogout()}>
Expand Down
9 changes: 2 additions & 7 deletions web/app/components/header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use client'

import Link from 'next/link'
import Image from 'next/image'
import logoUrl from '../../../public/logo/logo-site.png'
import AccountDropdown from './account-dropdown'
import AppNav from './app-nav'
import DatasetNav from './dataset-nav'
Expand All @@ -12,6 +10,7 @@ import GithubStar from './github-star'
import PluginNav from './plugin-nav'
import { WorkspaceProvider } from '@/context/workspace-context'
import { useAppContext } from '@/context/app-context'
import LogoSite from '@/app/components/base/logo/logo-site'

const navClassName = `
flex items-center relative mr-3 px-3 h-8 rounded-xl
Expand All @@ -25,11 +24,7 @@ const Header = () => {
<>
<div className='flex items-center'>
<Link href="/apps" className='flex items-center mr-4'>
<Image
src={logoUrl}
className='w-auto h-10'
alt='logo'
/>
<LogoSite />
</Link>
<GithubStar />
</div>
Expand Down
9 changes: 2 additions & 7 deletions web/app/components/share/chat/welcome/massive-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import type { FC } from 'react'
import React from 'react'
import cn from 'classnames'
import { useTranslation } from 'react-i18next'
import Image from 'next/image'
import {
PencilIcon,
} from '@heroicons/react/24/solid'
import logoUrl from '../../../../../public/logo/logo-site.png'
import s from './style.module.css'
import type { SiteInfo } from '@/models/share'
import Button from '@/app/components/base/button'
import LogoSite from '@/app/components/base/logo/logo-site'

export const AppInfo: FC<{ siteInfo: SiteInfo }> = ({ siteInfo }) => {
return (
Expand Down Expand Up @@ -71,9 +70,5 @@ export const EditBtn = ({ className, onClick }: { className?: string; onClick: (
}

export const FootLogo = () => (
<Image
src={logoUrl}
className='w-auto h-5'
alt='logo'
/>
<LogoSite className='!h-5' />
)
9 changes: 2 additions & 7 deletions web/app/components/share/chatbot/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import type { FC } from 'react'
import React, { useEffect, useRef, useState } from 'react'
import cn from 'classnames'
import { useTranslation } from 'react-i18next'
import Image from 'next/image'
import { useContext } from 'use-context-selector'
import produce from 'immer'
import { useBoolean, useGetState } from 'ahooks'
import logoUrl from '../../../../public/logo/logo-embeded-chat-header.png'
import { checkOrSetAccessToken } from '../utils'
import AppUnavailable from '../../base/app-unavailable'
import useConversation from './hooks/use-conversation'
Expand All @@ -28,6 +26,7 @@ import { replaceStringWithValues } from '@/app/components/app/configuration/prom
import { userInputsFormToPromptVariables } from '@/utils/model-config'
import type { InstalledApp } from '@/models/explore'
import { AlertTriangle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback'
import LogoHeader from '@/app/components/base/logo/logo-embeded-chat-header'

export type IMainProps = {
isInstalledApp?: boolean
Expand Down Expand Up @@ -490,11 +489,7 @@ const Main: FC<IMainProps> = ({
}

const difyIcon = (
<Image
src={logoUrl}
className='w-auto h-6'
alt='logo'
/>
<LogoHeader />
)

if (appUnavailable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import type { FC } from 'react'
import React from 'react'
import cn from 'classnames'
import { useTranslation } from 'react-i18next'
import Image from 'next/image'
import {
PencilIcon,
} from '@heroicons/react/24/solid'
import logoUrl from '../../../../../public/logo/logo-site.png'
import s from './style.module.css'
import type { SiteInfo } from '@/models/share'
import Button from '@/app/components/base/button'
import LogoSite from '@/app/components/base/logo/logo-site'

export const AppInfo: FC<{ siteInfo: SiteInfo }> = ({ siteInfo }) => {
const { t } = useTranslation()
Expand Down Expand Up @@ -72,9 +71,5 @@ export const EditBtn = ({ className, onClick }: { className?: string; onClick: (
}

export const FootLogo = () => (
<Image
src={logoUrl}
className='w-auto h-5'
alt='logo'
/>
<LogoSite className='!h-5' />
)
1 change: 1 addition & 0 deletions web/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const LocaleLayout = ({
data-public-edition={process.env.NEXT_PUBLIC_EDITION}
data-public-sentry-dsn={process.env.NEXT_PUBLIC_SENTRY_DSN}
data-public-maintenance-notice={process.env.NEXT_PUBLIC_MAINTENANCE_NOTICE}
data-public-site-about={process.env.NEXT_PUBLIC_SITE_ABOUT}
>
<BrowerInitor>
<SentryInitor>
Expand Down
5 changes: 2 additions & 3 deletions web/app/signin/_header.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
'use client'
import React from 'react'
import { useContext } from 'use-context-selector'
import Image from 'next/image'
import logoUrl from '../../public/logo/logo-site.png'
import Select, { LOCALES } from '@/app/components/base/select/locale'
import { type Locale } from '@/i18n'
import I18n from '@/context/i18n'
import LogoSite from '@/app/components/base/logo/logo-site'

const Header = () => {
const { locale, setLocaleOnClient } = useContext(I18n)
Expand All @@ -14,7 +13,7 @@ const Header = () => {
localStorage.removeItem('console_token')

return <div className='flex items-center justify-between p-6 w-full'>
<Image alt='logo' src={logoUrl} className='w-auto h-10' />
<LogoSite />
<Select
value={locale}
items={LOCALES}
Expand Down
1 change: 1 addition & 0 deletions web/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ else
fi

export NEXT_PUBLIC_SENTRY_DSN=${SENTRY_DSN}
export NEXT_PUBLIC_SITE_ABOUT=${SITE_ABOUT}

node ./server.js

0 comments on commit 8f967a0

Please sign in to comment.