apps/web: pass children to buttons
This commit is contained in:
parent
3bdfbbbfb1
commit
cc8b59011c
@ -14,12 +14,12 @@ export function DefaultForm() {
|
||||
} = useContext(FormStateContext);
|
||||
|
||||
if (step === 'login' && user) {
|
||||
return <ButtonLoading />;
|
||||
return <ButtonLoading>Подождите...</ButtonLoading>;
|
||||
}
|
||||
|
||||
return (
|
||||
<BaseForm onSubmit={(data) => handleLogin(data)}>
|
||||
<ButtonLogin />
|
||||
<ButtonLogin>Войти</ButtonLogin>
|
||||
</BaseForm>
|
||||
);
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ type Props = ButtonHTMLAttributes<HTMLButtonElement>;
|
||||
export function ButtonLogin(props: Props) {
|
||||
return (
|
||||
<button className={styles['button-submit']} type="submit" {...props}>
|
||||
Войти
|
||||
{props.children}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@ -19,7 +19,7 @@ export function ButtonLoading(props: Props) {
|
||||
<button disabled type="button" className={styles['button-submit']} {...props}>
|
||||
<div className={styles['loading-wrapper']}>
|
||||
<Spinner alt="spinner" className={styles['spinner-icon']} />
|
||||
Подождите...
|
||||
{props.children}
|
||||
</div>
|
||||
</button>
|
||||
);
|
||||
@ -50,7 +50,7 @@ export function ButtonTelegramLogin(props: Props) {
|
||||
height={22}
|
||||
alt="Telegram icon"
|
||||
/>
|
||||
Ожидаем подтверждения...
|
||||
{props.children}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
@ -16,13 +16,13 @@ export function TelegramForm() {
|
||||
} = useContext(FormStateContext);
|
||||
|
||||
if (step === 'login' && user) {
|
||||
return <ButtonLoading />;
|
||||
return <ButtonLoading>Подождите...</ButtonLoading>;
|
||||
}
|
||||
|
||||
if (step === 'telegram') {
|
||||
return (
|
||||
<BaseForm onSubmit={() => handleTelegramLogin()}>
|
||||
<ButtonTelegram>Войти как {user?.displayName}</ButtonTelegram>
|
||||
<ButtonTelegram>Войти через Telegram</ButtonTelegram>
|
||||
</BaseForm>
|
||||
);
|
||||
}
|
||||
@ -30,14 +30,14 @@ export function TelegramForm() {
|
||||
if (step === 'telegram-login') {
|
||||
return (
|
||||
<BaseForm onSubmit={() => {}}>
|
||||
<ButtonTelegramLogin />
|
||||
<ButtonTelegramLogin>Ожидаем подтверждения...</ButtonTelegramLogin>
|
||||
</BaseForm>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<BaseForm onSubmit={(data) => handleLogin(data)}>
|
||||
<ButtonLogin />
|
||||
<ButtonLogin>Далее</ButtonLogin>
|
||||
</BaseForm>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user