Files
qwqcode dcde53f8ad refactor(ui/auth): ensure compatibility with new client types (#1009)
- Bump to new Artalk client export types
- Add `AuthContext` type definition for improved clarity
- Replace `ContextApi` with `AuthContext` for reducing the scope of variables
- Bump version to 0.0.2 for release

(The prerequisite PR is #1007)
2024-10-18 17:09:15 +08:00

26 lines
575 B
TypeScript

import { createSignal } from 'solid-js'
import { Dialog } from './Dialog'
import type { AuthContext } from './types'
interface DialogExampleProps {
ctx: AuthContext
onClose: () => void
}
export const DialogExample = (props: DialogExampleProps) => {
const { ctx, onClose, ...others } = props
const pages = {
methods: () => <>Tool</>,
}
const homePage = 'methods'
const [page, setPage] = createSignal<keyof typeof pages>(homePage)
return (
<Dialog onClose={onClose} title={() => ctx.$t('signIn')}>
{() => pages[page()]()}
</Dialog>
)
}