- 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)
26 lines
575 B
TypeScript
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>
|
|
)
|
|
}
|