|
1 | 1 | <script lang="ts"> |
2 | | - import Form from "@gradio/form"; |
| 2 | + import { BaseForm } from "@gradio/form"; |
3 | 3 | import { BaseTextbox as Textbox } from "@gradio/textbox"; |
4 | 4 | import { BaseButton } from "@gradio/button"; |
5 | | - import Column from "@gradio/column"; |
| 5 | + import { BaseColumn } from "@gradio/column"; |
6 | 6 | import { Block } from "@gradio/atoms"; |
7 | | - import { _ } from "svelte-i18n"; |
8 | 7 | export let root: string; |
9 | 8 | export let auth_message: string | null; |
10 | 9 | export let app_mode: boolean; |
11 | 10 | export let space_id: string | null; |
| 11 | + export let i18n: (s: string) => string; |
12 | 12 |
|
13 | 13 | let username = ""; |
14 | 14 | let password = ""; |
|
34 | 34 | </script> |
35 | 35 |
|
36 | 36 | <div class="wrap" class:min-h-screen={app_mode}> |
37 | | - <Column variant="panel" min_width={480}> |
38 | | - <h2>{$_("login.login")}</h2> |
| 37 | + <BaseColumn variant="panel" min_width={480}> |
| 38 | + <h2>{i18n("login.login")}</h2> |
39 | 39 | {#if auth_message} |
40 | 40 | <p class="auth">{@html auth_message}</p> |
41 | 41 | {/if} |
42 | 42 | {#if space_id} |
43 | 43 | <p class="auth"> |
44 | | - {$_("login.enable_cookies")} |
| 44 | + {i18n("login.enable_cookies")} |
45 | 45 | </p> |
46 | 46 | {/if} |
47 | 47 | {#if incorrect_credentials} |
48 | | - <p class="creds">{$_("login.incorrect_credentials")}</p> |
| 48 | + <p class="creds">{i18n("login.incorrect_credentials")}</p> |
49 | 49 | {/if} |
50 | | - <Form> |
| 50 | + <BaseForm> |
51 | 51 | <Block> |
52 | 52 | <Textbox |
53 | | - label={$_("login.username")} |
| 53 | + label={i18n("login.username")} |
54 | 54 | lines={1} |
55 | 55 | show_label={true} |
56 | 56 | max_lines={1} |
|
61 | 61 |
|
62 | 62 | <Block> |
63 | 63 | <Textbox |
64 | | - label={$_("login.password")} |
| 64 | + label={i18n("login.password")} |
65 | 65 | lines={1} |
66 | 66 | show_label={true} |
67 | 67 | max_lines={1} |
|
70 | 70 | bind:value={password} |
71 | 71 | /> |
72 | 72 | </Block> |
73 | | - </Form> |
| 73 | + </BaseForm> |
74 | 74 |
|
75 | 75 | <BaseButton size="lg" variant="primary" on:click={submit} |
76 | | - >{$_("login.login")}</BaseButton |
| 76 | + >{i18n("login.login")}</BaseButton |
77 | 77 | > |
78 | | - </Column> |
| 78 | + </BaseColumn> |
79 | 79 | </div> |
80 | 80 |
|
81 | 81 | <style> |
|
0 commit comments