This commit is contained in:
tonyrewin 2022-12-02 09:40:26 +03:00
parent c5906a2762
commit 39b0160cf4
3 changed files with 36 additions and 29 deletions

View File

@ -70,35 +70,36 @@ export const ProfileSettingsPage = (props: PageProps) => {
onChange={(event) => updateFormField('name', event.currentTarget.value)}
value={form.name}
/>
<label for="username">Имя</label>
<label for="username">{t('Name')}</label>
</div>
{/*Не готов бекенд*/}
{/*<h4>{t('Address on Discourse')}</h4>*/}
{/*<div class="pretty-form__item">*/}
{/* <div class={styles.discoursName}>*/}
{/* <label for="user-address">https://discours.io/user/</label>*/}
{/* <div class={styles.discoursNameField}>*/}
{/* <input*/}
{/* type="text"*/}
{/* name="user-address"*/}
{/* id="user-address"*/}
{/* onChange={(event) => updateFormField('slug', event.currentTarget.value)}*/}
{/* value={form.slug}*/}
{/* class="nolabel"*/}
{/* />*/}
{/* <p class="form-message form-message--error">*/}
{/* {t('Sorry, this address is already taken, please choose another one.')}*/}
{/* </p>*/}
{/* </div>*/}
{/* </div>*/}
{/*</div>*/}
{/*Нет реализации полей на бэке*/}
{/*<h4>{t('Introduce')}</h4>*/}
{/*<div class="pretty-form__item">*/}
{/* <textarea name="presentation" id="presentation" placeholder={t('Introduce')} />*/}
{/* <label for="presentation">{t('Introduce')}</label>*/}
{/*</div>*/}
<h4>{t('Address on Discourse')}</h4>
<div class="pretty-form__item">
<div class={styles.discoursName}>
<label for="user-address">https://new.discours.io/author/</label>
<div class={styles.discoursNameField}>
<input
type="text"
name="user-address"
id="user-address"
onChange={(event) => updateFormField('slug', event.currentTarget.value)}
value={form.slug}
class="nolabel"
/>
<p class="form-message form-message--error">
{t('Sorry, this address is already taken, please choose another one.')}
</p>
</div>
</div>
</div>
<h4>{t('Introduce')}</h4>
<div class="pretty-form__item">
<textarea name="presentation" id="presentation" placeholder={t('Introduce')}>
{form.bio}
</textarea>
<label for="presentation">{t('Introduce')}</label>
</div>
<h4>{t('About myself')}</h4>
<div class="pretty-form__item">
@ -106,8 +107,8 @@ export const ProfileSettingsPage = (props: PageProps) => {
name="about"
id="about"
placeholder={t('About myself')}
value={form.bio}
onChange={(event) => updateFormField('bio', event.currentTarget.value)}
value={form.about}
onChange={(event) => updateFormField('about', event.currentTarget.value)}
/>
<label for="about">{t('About myself')}</label>
</div>

View File

@ -22,6 +22,8 @@ const useProfileForm = () => {
const [form, setForm] = createStore<ProfileInput>({
name: '',
bio: '',
about: '',
slug: '',
userpic: '',
links: []
})
@ -34,6 +36,7 @@ const useProfileForm = () => {
setForm({
name: currentAuthor()?.name,
bio: currentAuthor()?.bio,
about: currentAuthor()?.about,
userpic: currentAuthor()?.userpic,
links: currentAuthor()?.links
})

View File

@ -23,6 +23,7 @@ export type AuthResult = {
export type Author = {
bio?: Maybe<Scalars['String']>
about?: Maybe<Scalars['String']>
caption?: Maybe<Scalars['String']>
id: Scalars['Int']
lastSeen?: Maybe<Scalars['DateTime']>
@ -327,6 +328,8 @@ export type Permission = {
export type ProfileInput = {
bio?: InputMaybe<Scalars['String']>
slug?: InputMaybe<Scalars['String']>
about?: InputMaybe<Scalars['String']>
links?: InputMaybe<Array<InputMaybe<Scalars['String']>>>
name?: InputMaybe<Scalars['String']>
userpic?: InputMaybe<Scalars['String']>