fixed-reset-template

This commit is contained in:
Untone 2024-02-16 22:11:04 +03:00
parent 59db2c598d
commit 52b2a6d16c
9 changed files with 24 additions and 24 deletions

View File

@ -311,7 +311,7 @@ export const AuthorCard = (props: Props) => {
<TopicBadge <TopicBadge
isFollowed={{ isFollowed={{
loaded: Boolean(authorSubs()), loaded: Boolean(authorSubs()),
value: isOwnerSubscribed(subscription.id), value: isOwnerSubscribed(subscription.id)
}} }}
topic={subscription} topic={subscription}
/> />

View File

@ -93,7 +93,7 @@ export const Editor = (props: Props) => {
url: 'wss://hocuspocus.discours.io', url: 'wss://hocuspocus.discours.io',
name: docName, name: docName,
document: yDocs[docName], document: yDocs[docName],
token: session()?.access_token || '', token: session()?.access_token || ''
}) })
} }

View File

@ -171,7 +171,7 @@ export const LoginForm = () => {
class="link" class="link"
onClick={() => onClick={() =>
changeSearchParams({ changeSearchParams({
mode: 'send-reset-link', mode: 'send-reset-link'
}) })
} }
> >

View File

@ -99,7 +99,7 @@ export const RegisterForm = () => {
email: cleanEmail, email: cleanEmail,
password: password(), password: password(),
confirm_password: password(), confirm_password: password(),
redirect_uri: window.location.origin, redirect_uri: window.location.origin
} }
const { errors } = await signUp(opts) const { errors } = await signUp(opts)
if (errors) return if (errors) return
@ -114,7 +114,7 @@ export const RegisterForm = () => {
const handleResendLink = async (_ev) => { const handleResendLink = async (_ev) => {
const response: GenericResponse = await resendVerifyEmail({ const response: GenericResponse = await resendVerifyEmail({
email: email(), email: email(),
identifier: 'basic_signup', identifier: 'basic_signup'
}) })
setIsSuccess(response?.message === 'Verification email has been sent. Please check your inbox') setIsSuccess(response?.message === 'Verification email has been sent. Please check your inbox')
} }
@ -131,7 +131,7 @@ export const RegisterForm = () => {
{t('resend confirmation link')} {t('resend confirmation link')}
</span> </span>
</> </>
), )
})) }))
break break
@ -144,7 +144,7 @@ export const RegisterForm = () => {
{t('enter')} {t('enter')}
</span> </span>
</> </>
), )
})) }))
break break
case 'registered': case 'registered':
@ -157,7 +157,7 @@ export const RegisterForm = () => {
{t('Set the new password').toLocaleLowerCase()} {t('Set the new password').toLocaleLowerCase()}
</span> </span>
</> </>
), )
})) }))
break break
default: default:
@ -187,7 +187,7 @@ export const RegisterForm = () => {
</Show> </Show>
<div <div
class={clsx('pretty-form__item', { class={clsx('pretty-form__item', {
'pretty-form__item--error': validationErrors().fullName, 'pretty-form__item--error': validationErrors().fullName
})} })}
> >
<input <input
@ -206,7 +206,7 @@ export const RegisterForm = () => {
<div <div
class={clsx('pretty-form__item', { class={clsx('pretty-form__item', {
'pretty-form__item--error': validationErrors().email && !emailStatus(), 'pretty-form__item--error': validationErrors().email && !emailStatus()
})} })}
> >
<input <input
@ -250,7 +250,7 @@ export const RegisterForm = () => {
class={styles.authLink} class={styles.authLink}
onClick={() => onClick={() =>
changeSearchParams({ changeSearchParams({
mode: 'login', mode: 'login'
}) })
} }
> >

View File

@ -155,7 +155,7 @@ export const HeaderAuth = (props: Props) => {
{renderIconedButton({ {renderIconedButton({
value: t('Publish'), value: t('Publish'),
icon: 'publish', icon: 'publish',
action: () => publishShout(form), action: () => publishShout(form)
})} })}
</div> </div>

View File

@ -46,8 +46,8 @@ export const TopicBadge = (props: Props) => {
() => props.isFollowed, () => props.isFollowed,
() => { () => {
setIsFollowed(props.isFollowed.value) setIsFollowed(props.isFollowed.value)
}, }
), )
) )
const title = () => const title = () =>
@ -61,11 +61,11 @@ export const TopicBadge = (props: Props) => {
href={`/topic/${props.topic.slug}`} href={`/topic/${props.topic.slug}`}
class={clsx(styles.picture, { class={clsx(styles.picture, {
[styles.withImage]: props.topic.pic, [styles.withImage]: props.topic.pic,
[styles.smallSize]: isMobileView(), [styles.smallSize]: isMobileView()
})} })}
style={ style={
props.topic.pic && { props.topic.pic && {
'background-image': `url('${getImageUrl(props.topic.pic, { width: 40, height: 40 })}')`, 'background-image': `url('${getImageUrl(props.topic.pic, { width: 40, height: 40 })}')`
} }
} }
/> />

View File

@ -193,7 +193,7 @@ export const AllTopics = (props: Props) => {
topic={topic} topic={topic}
isFollowed={{ isFollowed={{
loaded: filteredResults().length > 0, loaded: filteredResults().length > 0,
value: isOwnerSubscribed(topic.slug), value: isOwnerSubscribed(topic.slug)
}} }}
showStat={true} showStat={true}
/> />

View File

@ -327,7 +327,7 @@ export const SessionProvider = (props: {
console.debug('[context.session] calling is_registered for ', email) console.debug('[context.session] calling is_registered for ', email)
try { try {
const response = await authorizer().graphqlQuery({ const response = await authorizer().graphqlQuery({
query: `query { is_registered(email: "${email}") { message }}`, query: `query { is_registered(email: "${email}") { message }}`
}) })
// console.log(response) // console.log(response)
return response?.data?.is_registered?.message return response?.data?.is_registered?.message
@ -376,7 +376,7 @@ export const SessionProvider = (props: {
forgotPassword, forgotPassword,
changePassword, changePassword,
oauth, oauth,
isRegistered, isRegistered
} }
const value: SessionContextType = { const value: SessionContextType = {
authError, authError,
@ -386,7 +386,7 @@ export const SessionProvider = (props: {
author, author,
...actions, ...actions,
isAuthenticated, isAuthenticated,
resendVerifyEmail, resendVerifyEmail
} }
return <SessionContext.Provider value={value}>{props.children}</SessionContext.Provider> return <SessionContext.Provider value={value}>{props.children}</SessionContext.Provider>

View File

@ -8,7 +8,7 @@
font-family: Helvetica, Arial, sans-serif; font-family: Helvetica, Arial, sans-serif;
font-size: 24px; font-size: 24px;
"> ">
{{username}}, здравствуйте! Приветствуем!
</span> </span>
</h1> </h1>
</td> </td>
@ -27,10 +27,10 @@
</p> </p>
<p style="margin: 15px 0"> <p style="margin: 15px 0">
Чтобы сменить пароль для входа в Дискурс, перейдите по Чтобы задать пароль для входа в Дискурс, перейдите по
<a href="{{verification_url}}" style="color: #2638d9; font-weight: bold"> <a href="{{verification_url}}" style="color: #2638d9; font-weight: bold">
этой ссылке</a>. Она сработает всего один раз и приведет вас на страницу, где вы сможете этой ссылке</a>. Она сработает всего один раз и приведет вас на страницу, где вы сможете
установить новый пароль. задать новый пароль.
</p> </p>
<p style="margin: 15px 0"> <p style="margin: 15px 0">