引入 husky,并全局重新格式化
This commit is contained in:
@@ -13,7 +13,6 @@ type ApiResponse<T = undefined> = {
|
||||
data: T
|
||||
}
|
||||
|
||||
|
||||
type PageRecord<T = unknown> = {
|
||||
total: number
|
||||
page: number
|
||||
|
||||
@@ -37,9 +37,9 @@ export type Resource<T extends 1 | 2 = 1 | 2> = {
|
||||
updated_at: Date
|
||||
} & (
|
||||
T extends 1 ? {
|
||||
type: 1
|
||||
short: ResourceShort
|
||||
} :
|
||||
type: 1
|
||||
short: ResourceShort
|
||||
} :
|
||||
T extends 2 ? {
|
||||
type: 2
|
||||
long: ResourceLong
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import {useState} from 'react'
|
||||
|
||||
export function useStatus() {
|
||||
return useState<'done'|'fail'|'load'>('load')
|
||||
return useState<'done' | 'fail' | 'load'>('load')
|
||||
}
|
||||
|
||||
@@ -14,10 +14,10 @@ export type LayoutActions = {
|
||||
export const createLayoutStore = () => {
|
||||
return createStore<LayoutStore>()(setState => ({
|
||||
navbar: true,
|
||||
toggleNavbar: () => setState(state => {
|
||||
toggleNavbar: () => setState((state) => {
|
||||
return {navbar: !state.navbar}
|
||||
}),
|
||||
setNavbar: (navbar) => setState(_ => {
|
||||
setNavbar: navbar => setState((_) => {
|
||||
return {navbar}
|
||||
}),
|
||||
}))
|
||||
|
||||
@@ -2,7 +2,6 @@ import {User} from '@/lib/models'
|
||||
import {createStore} from 'zustand/vanilla'
|
||||
import {getProfile} from '@/actions/auth'
|
||||
|
||||
|
||||
export type ProfileStore = ProfileState & ProfileActions
|
||||
|
||||
export type ProfileState = {
|
||||
@@ -10,10 +9,10 @@ export type ProfileState = {
|
||||
}
|
||||
|
||||
export type ProfileActions = {
|
||||
refreshProfile: () => Promise<void>
|
||||
refreshProfile: () => Promise<void>
|
||||
}
|
||||
|
||||
export const createProfileStore = (init: User|null) => {
|
||||
export const createProfileStore = (init: User | null) => {
|
||||
return createStore<ProfileStore>()(setState => ({
|
||||
profile: init,
|
||||
refreshProfile: async () => {
|
||||
@@ -24,4 +23,3 @@ export const createProfileStore = (init: User|null) => {
|
||||
},
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
@@ -3,4 +3,3 @@ import {ClassNameValue, twMerge} from 'tailwind-merge'
|
||||
export function merge(...inputs: ClassNameValue[]) {
|
||||
return twMerge(inputs)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user