mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
chore(web): new lint setup (#30020)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
'use client'
|
||||
import type { FC } from 'react'
|
||||
import { cn } from '@/utils/classnames'
|
||||
import useTheme from '@/hooks/use-theme'
|
||||
import { cn } from '@/utils/classnames'
|
||||
import { basePath } from '@/utils/var'
|
||||
|
||||
export type LogoStyle = 'default' | 'monochromeWhite'
|
||||
|
||||
export const logoPathMap: Record<LogoStyle, string> = {
|
||||
@ -36,7 +37,7 @@ const DifyLogo: FC<DifyLogoProps> = ({
|
||||
<img
|
||||
src={`${basePath}${logoPathMap[themedStyle]}`}
|
||||
className={cn('block object-contain', logoSizeMap[size], className)}
|
||||
alt='Dify logo'
|
||||
alt="Dify logo"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import type { Meta, StoryObj } from '@storybook/nextjs'
|
||||
import { ThemeProvider } from 'next-themes'
|
||||
import type { ReactNode } from 'react'
|
||||
import { ThemeProvider } from 'next-themes'
|
||||
import DifyLogo from './dify-logo'
|
||||
import LogoSite from './logo-site'
|
||||
import LogoEmbeddedChatHeader from './logo-embedded-chat-header'
|
||||
import LogoEmbeddedChatAvatar from './logo-embedded-chat-avatar'
|
||||
import LogoEmbeddedChatHeader from './logo-embedded-chat-header'
|
||||
import LogoSite from './logo-site'
|
||||
|
||||
const meta = {
|
||||
title: 'Base/General/Logo',
|
||||
@ -37,11 +37,11 @@ const meta = {
|
||||
export default meta
|
||||
type Story = StoryObj<typeof meta>
|
||||
|
||||
const ThemePreview = ({ theme, children }: { theme: 'light' | 'dark'; children: ReactNode }) => {
|
||||
const ThemePreview = ({ theme, children }: { theme: 'light' | 'dark', children: ReactNode }) => {
|
||||
return (
|
||||
<ThemeProvider attribute="data-theme" forcedTheme={theme} enableSystem={false}>
|
||||
<div
|
||||
className={'min-w-[320px] rounded-2xl border border-divider-subtle bg-background-default-subtle p-6 shadow-sm'}
|
||||
className="min-w-[320px] rounded-2xl border border-divider-subtle bg-background-default-subtle p-6 shadow-sm"
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
|
||||
@ -11,7 +11,7 @@ const LogoEmbeddedChatAvatar: FC<LogoEmbeddedChatAvatarProps> = ({
|
||||
<img
|
||||
src={`${basePath}/logo/logo-embedded-chat-avatar.png`}
|
||||
className={`block h-10 w-10 ${className}`}
|
||||
alt='logo'
|
||||
alt="logo"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { cn } from '@/utils/classnames'
|
||||
import type { FC } from 'react'
|
||||
import { cn } from '@/utils/classnames'
|
||||
import { basePath } from '@/utils/var'
|
||||
|
||||
type LogoEmbeddedChatHeaderProps = {
|
||||
@ -9,16 +9,18 @@ type LogoEmbeddedChatHeaderProps = {
|
||||
const LogoEmbeddedChatHeader: FC<LogoEmbeddedChatHeaderProps> = ({
|
||||
className,
|
||||
}) => {
|
||||
return <picture>
|
||||
<source media="(resolution: 1x)" srcSet='/logo/logo-embedded-chat-header.png' />
|
||||
<source media="(resolution: 2x)" srcSet='/logo/logo-embedded-chat-header@2x.png' />
|
||||
<source media="(resolution: 3x)" srcSet='/logo/logo-embedded-chat-header@3x.png' />
|
||||
<img
|
||||
src={`${basePath}/logo/logo-embedded-chat-header.png`}
|
||||
alt='logo'
|
||||
className={cn('block h-6 w-auto', className)}
|
||||
/>
|
||||
</picture>
|
||||
return (
|
||||
<picture>
|
||||
<source media="(resolution: 1x)" srcSet="/logo/logo-embedded-chat-header.png" />
|
||||
<source media="(resolution: 2x)" srcSet="/logo/logo-embedded-chat-header@2x.png" />
|
||||
<source media="(resolution: 3x)" srcSet="/logo/logo-embedded-chat-header@3x.png" />
|
||||
<img
|
||||
src={`${basePath}/logo/logo-embedded-chat-header.png`}
|
||||
alt="logo"
|
||||
className={cn('block h-6 w-auto', className)}
|
||||
/>
|
||||
</picture>
|
||||
)
|
||||
}
|
||||
|
||||
export default LogoEmbeddedChatHeader
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
'use client'
|
||||
import type { FC } from 'react'
|
||||
import { basePath } from '@/utils/var'
|
||||
import { cn } from '@/utils/classnames'
|
||||
import { basePath } from '@/utils/var'
|
||||
|
||||
type LogoSiteProps = {
|
||||
className?: string
|
||||
@ -14,7 +14,7 @@ const LogoSite: FC<LogoSiteProps> = ({
|
||||
<img
|
||||
src={`${basePath}/logo/logo.png`}
|
||||
className={cn('block h-[24.5px] w-[22.651px]', className)}
|
||||
alt='logo'
|
||||
alt="logo"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user