Files
Folo/apps/desktop/layer/renderer/src/modules/settings/utils.ts
T
Innei 01ed1c63b5 refactor: Progressive migration Client SDK (#4227)
* Implement code changes to enhance functionality and improve performance

Signed-off-by: Innei <tukon479@gmail.com>

* chore: update @follow-app/client-sdk to version 0.2.6 and add new dependencies
refactor: adjust types in server configs and features to use ExtractResponseData
feat: implement followApi for server configurations and API client context

Signed-off-by: Innei <tukon479@gmail.com>

* feat: move to client-sdk

Signed-off-by: Innei <tukon479@gmail.com>

* feat: update @follow-app/client-sdk to version 0.3.22 and add ShrinkingFocusBorder component

- Updated the version of @follow-app/client-sdk in pnpm-workspace.yaml from 0.3.15 to 0.3.22.
- Introduced a new ShrinkingFocusBorder component that animates a focus border effect using a canvas element.
- Implemented resize observer for persistent border and animation logic for visibility changes.

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2025-07-23 01:21:34 +08:00

33 lines
901 B
TypeScript

import type { UserRole } from "@follow/constants"
import type { ExtractResponseData, GetStatusConfigsResponse } from "@follow-app/client-sdk"
export interface SettingPageContext {
role: Nullable<UserRole>
isInMASReview: boolean
}
export enum DisableWhy {
Noop = "noop",
NotActivation = "not_activation",
}
export interface SettingPageConfig {
icon: string | React.ReactNode
name: I18nKeysForSettings
title?: I18nKeysForSettings
priority: number
headerIcon?: string | React.ReactNode
hideIf?: (
ctx: SettingPageContext,
serverConfigs?: ExtractResponseData<GetStatusConfigsResponse> | null,
) => boolean
disableIf?: (
ctx: SettingPageContext,
serverConfigs?: ExtractResponseData<GetStatusConfigsResponse> | null,
) => [boolean, DisableWhy]
viewportClassName?: string
}
export const defineSettingPageData = (config: SettingPageConfig) => ({
...config,
})