cbc7cd0808
* Add fontScale, gate it, fix some computes * Add inter, integrate * Clean up * Apply to old Text component * Use numeric weight * Cleanup * Clean up appearance settings * Global tracking * Fix regular italic variant * Refactor settings and fontScale values * Remove flags * Get rid of lower weight font usage * Remove gate from settings * Refactor appearance settings for reuse * Add neue type nux * Update defaults * Load fonts, add fallback families * Load fonts via plugin in production * Fixes * Fix for web * Nits --------- Co-authored-by: Hailey <me@haileyok.com>
19 lines
435 B
TypeScript
19 lines
435 B
TypeScript
import React from 'react'
|
|
|
|
import {DialogControlProps} from '#/components/Dialog/types'
|
|
|
|
export function useAutoOpen(control: DialogControlProps, showTimeout?: number) {
|
|
React.useEffect(() => {
|
|
if (showTimeout) {
|
|
const timeout = setTimeout(() => {
|
|
control.open()
|
|
}, showTimeout)
|
|
return () => {
|
|
clearTimeout(timeout)
|
|
}
|
|
} else {
|
|
control.open()
|
|
}
|
|
}, [control, showTimeout])
|
|
}
|