このコミットが含まれているのは:
@@ -0,0 +1,28 @@
|
||||
import { createContext, useContext } from 'react'
|
||||
|
||||
export const MIN_COUNT_WIDTH = 64
|
||||
export const MAX_COUNT_WIDTH = 2000
|
||||
|
||||
export const defaultCountWidths: Record<string, number> = {
|
||||
thumbnail: 88, resource_id: 88, version_no: 88, is_latest: 104,
|
||||
title: 300, url: 300, thumbnail_base: 300, tags: 560, parents: 180,
|
||||
video_ms: 120, original_created_at: 260, original_created_from: 240,
|
||||
original_created_before: 240, name: 240, names: 480, category: 180,
|
||||
aliases: 360, deprecated: 240, user: 200, created_at: 240, group: 240, count: 160,
|
||||
id: 88, versionNo: 88, kind: 140, sections: 240, beginMs: 120, endMs: 120,
|
||||
languageCode: 180, scriptCode: 200, autoGenerated: 120 }
|
||||
|
||||
type Layout = {
|
||||
width: (family: string, key: string) => number
|
||||
resize: (family: string, key: string, width: number) => void }
|
||||
export const CountsLayoutContext = createContext<Layout | null> (null)
|
||||
export const CountsTableScope = createContext ('')
|
||||
|
||||
|
||||
export const useCountsTableLayout = (): Layout => {
|
||||
const context = useContext (CountsLayoutContext)
|
||||
if (context == null) throw new Error ('Counts table layout provider is missing')
|
||||
return context
|
||||
}
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする