web: Add style CI workflow to enforce eslint checks on web module (#1910)

This commit is contained in:
Bowen Liang
2024-01-04 15:37:51 +08:00
committed by GitHub
parent b4a170cb8a
commit a798dcfae9
29 changed files with 141 additions and 102 deletions

View File

@@ -1,8 +1,9 @@
'use client'
import React, { FC } from 'react'
import type { FC } from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next'
interface IAppUnavailableProps {
type IAppUnavailableProps = {
code?: number
isUnknwonReason?: boolean
unknownReason?: string

View File

@@ -1,11 +1,11 @@
'use client'
import React, { FC, useEffect } from 'react'
import type { FC } from 'react'
import React, { useEffect } from 'react'
import cn from 'classnames'
import { useBoolean } from 'ahooks'
import { ChevronRightIcon } from '@heroicons/react/24/outline'
export interface IPanelProps {
export type IPanelProps = {
className?: string
headerIcon: React.ReactNode
title: React.ReactNode
@@ -30,23 +30,21 @@ const Panel: FC<IPanelProps> = ({
foldDisabled = false,
onFoldChange,
controlUnFold,
controlFold
controlFold,
}) => {
const [fold, { setTrue: setFold, setFalse: setUnFold, toggle: toggleFold }] = useBoolean(keepUnFold ? false : true)
const [fold, { setTrue: setFold, setFalse: setUnFold, toggle: toggleFold }] = useBoolean(!keepUnFold)
useEffect(() => {
onFoldChange?.(fold)
}, [fold])
useEffect(() => {
if (controlUnFold) {
if (controlUnFold)
setUnFold()
}
}, [controlUnFold])
useEffect(() => {
if (controlFold) {
if (controlFold)
setFold()
}
}, [controlFold])
// overflow-hidden