mirror of https://github.com/langgenius/dify.git
refactor(web): replace MediaType enum with const object (#33834)
This commit is contained in:
parent
2c8322c7b9
commit
6be7ba2928
|
|
@ -9795,11 +9795,6 @@
|
|||
"count": 6
|
||||
}
|
||||
},
|
||||
"hooks/use-breakpoints.ts": {
|
||||
"erasable-syntax-only/enums": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"hooks/use-format-time-from-now.spec.ts": {
|
||||
"regexp/no-dupe-disjunctions": {
|
||||
"count": 5
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
'use client'
|
||||
import * as React from 'react'
|
||||
|
||||
export enum MediaType {
|
||||
mobile = 'mobile',
|
||||
tablet = 'tablet',
|
||||
pc = 'pc',
|
||||
}
|
||||
export const MediaType = {
|
||||
mobile: 'mobile',
|
||||
tablet: 'tablet',
|
||||
pc: 'pc',
|
||||
} as const
|
||||
|
||||
const useBreakpoints = () => {
|
||||
type MediaTypeValue = (typeof MediaType)[keyof typeof MediaType]
|
||||
|
||||
const useBreakpoints = (): MediaTypeValue => {
|
||||
const [width, setWidth] = React.useState(globalThis.innerWidth)
|
||||
const media = (() => {
|
||||
if (width <= 640)
|
||||
|
|
|
|||
Loading…
Reference in New Issue