Sticky publish footer (#179)
This commit is contained in:
parent
3b0c3789df
commit
caac88deb7
|
@ -1,5 +1,7 @@
|
||||||
.TopicSelect .solid-select-list {
|
.TopicSelect .solid-select-list {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
position: relative;
|
||||||
|
z-index: 13;
|
||||||
}
|
}
|
||||||
|
|
||||||
.TopicSelect .solid-select-option[data-disabled='true'] {
|
.TopicSelect .solid-select-option[data-disabled='true'] {
|
||||||
|
|
|
@ -347,9 +347,6 @@ export const EditView = (props: Props) => {
|
||||||
</Show>
|
</Show>
|
||||||
</>
|
</>
|
||||||
</Show>
|
</Show>
|
||||||
<Show when={page().route === 'editSettings'}>
|
|
||||||
<PublishSettings shoutId={props.shout.id} form={form} />
|
|
||||||
</Show>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Show when={page().route === 'edit'}>
|
<Show when={page().route === 'edit'}>
|
||||||
|
@ -362,7 +359,9 @@ export const EditView = (props: Props) => {
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<Show when={page().route === 'editSettings'}>
|
||||||
|
<PublishSettings shoutId={props.shout.id} form={form} />
|
||||||
|
</Show>
|
||||||
<Panel shoutId={props.shout.id} />
|
<Panel shoutId={props.shout.id} />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
|
@ -138,15 +138,22 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.formActions {
|
.formActions {
|
||||||
display: flex;
|
background: var(--background-color);
|
||||||
align-items: center;
|
position: sticky;
|
||||||
justify-content: flex-end;
|
z-index: 12;
|
||||||
flex-direction: row;
|
bottom: 0;
|
||||||
padding: 1rem 0;
|
|
||||||
gap: 1rem;
|
|
||||||
margin-top: 80px;
|
|
||||||
border-top: 2px solid var(--black-100);
|
border-top: 2px solid var(--black-100);
|
||||||
|
margin-top: 80px;
|
||||||
|
margin-bottom: -40px;
|
||||||
|
|
||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
flex-direction: row;
|
||||||
|
padding: 1rem 0;
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
.cancel {
|
.cancel {
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,139 +110,159 @@ export const PublishSettings = (props: Props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class={styles.PublishSettings}>
|
<form class={clsx(styles.PublishSettings, 'inputs-wrapper')}>
|
||||||
<div>
|
<div class="wide-container">
|
||||||
<button type="button" class={styles.goBack} onClick={handleBackClick}>
|
<div class="row">
|
||||||
<Icon name="arrow-left" class={stylesBeside.icon} />
|
<div class="col-md-19 col-lg-18 col-xl-16 offset-md-5">
|
||||||
{t('Back to editor')}
|
<div>
|
||||||
</button>
|
<button type="button" class={styles.goBack} onClick={handleBackClick}>
|
||||||
</div>
|
<Icon name="arrow-left" class={stylesBeside.icon} />
|
||||||
<h1>{t('Publish Settings')}</h1>
|
{t('Back to editor')}
|
||||||
<h4>{t('Material card')}</h4>
|
</button>
|
||||||
<div class={styles.articlePreview}>
|
|
||||||
<div class={styles.actions}>
|
|
||||||
<Button
|
|
||||||
variant="primary"
|
|
||||||
onClick={() => showModal('uploadCoverImage')}
|
|
||||||
value={settingsForm.coverImageUrl ? t('Add another image') : t('Add image')}
|
|
||||||
/>
|
|
||||||
<Show when={settingsForm.coverImageUrl}>
|
|
||||||
<Button variant="secondary" onClick={handleDeleteCoverImage} value={t('Delete cover')} />
|
|
||||||
</Show>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class={clsx(styles.shoutCardCoverContainer, { [styles.hasImage]: settingsForm.coverImageUrl })}
|
|
||||||
>
|
|
||||||
<Show when={settingsForm.coverImageUrl ?? initialData.coverImageUrl}>
|
|
||||||
<div class={styles.shoutCardCover}>
|
|
||||||
<img src={imageProxy(settingsForm.coverImageUrl)} alt={initialData.title} loading="lazy" />
|
|
||||||
</div>
|
</div>
|
||||||
</Show>
|
<h1>{t('Publish Settings')}</h1>
|
||||||
<div class={styles.text}>
|
<h4>{t('Material card')}</h4>
|
||||||
<Show when={settingsForm.mainTopic}>
|
<div class={styles.articlePreview}>
|
||||||
<div class={styles.mainTopic}>{settingsForm.mainTopic.title}</div>
|
<div class={styles.actions}>
|
||||||
</Show>
|
<Button
|
||||||
<div class={styles.shoutCardTitle}>{settingsForm.title}</div>
|
variant="primary"
|
||||||
<div class={styles.shoutCardSubtitle}>{settingsForm.subtitle}</div>
|
onClick={() => showModal('uploadCoverImage')}
|
||||||
<div class={styles.shoutAuthor}>{user().name}</div>
|
value={settingsForm.coverImageUrl ? t('Add another image') : t('Add image')}
|
||||||
|
/>
|
||||||
|
<Show when={settingsForm.coverImageUrl}>
|
||||||
|
<Button variant="secondary" onClick={handleDeleteCoverImage} value={t('Delete cover')} />
|
||||||
|
</Show>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class={clsx(styles.shoutCardCoverContainer, {
|
||||||
|
[styles.hasImage]: settingsForm.coverImageUrl
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<Show when={settingsForm.coverImageUrl ?? initialData.coverImageUrl}>
|
||||||
|
<div class={styles.shoutCardCover}>
|
||||||
|
<img
|
||||||
|
src={imageProxy(settingsForm.coverImageUrl)}
|
||||||
|
alt={initialData.title}
|
||||||
|
loading="lazy"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Show>
|
||||||
|
<div class={styles.text}>
|
||||||
|
<Show when={settingsForm.mainTopic}>
|
||||||
|
<div class={styles.mainTopic}>{settingsForm.mainTopic.title}</div>
|
||||||
|
</Show>
|
||||||
|
<div class={styles.shoutCardTitle}>{settingsForm.title}</div>
|
||||||
|
<div class={styles.shoutCardSubtitle}>{settingsForm.subtitle}</div>
|
||||||
|
<div class={styles.shoutAuthor}>{user().name}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p class="description">
|
||||||
|
{t(
|
||||||
|
'Choose a title image for the article. You can immediately see how the publication card will look like.'
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class={styles.commonSettings}>
|
||||||
|
<GrowingTextarea
|
||||||
|
class={styles.settingInput}
|
||||||
|
variant="bordered"
|
||||||
|
placeholder={t('Come up with a title for your story')}
|
||||||
|
initialValue={settingsForm.title}
|
||||||
|
value={(value) => setSettingsForm('title', value)}
|
||||||
|
allowEnterKey={false}
|
||||||
|
maxLength={100}
|
||||||
|
/>
|
||||||
|
<GrowingTextarea
|
||||||
|
class={styles.settingInput}
|
||||||
|
variant="bordered"
|
||||||
|
placeholder={t('Come up with a subtitle for your story')}
|
||||||
|
initialValue={settingsForm.subtitle}
|
||||||
|
value={(value) => setSettingsForm('subtitle', value)}
|
||||||
|
allowEnterKey={false}
|
||||||
|
maxLength={100}
|
||||||
|
/>
|
||||||
|
<GrowingTextarea
|
||||||
|
class={styles.settingInput}
|
||||||
|
variant="bordered"
|
||||||
|
placeholder={t('Write a short introduction')}
|
||||||
|
initialValue={`${settingsForm.lead}`}
|
||||||
|
value={(value) => setSettingsForm('lead', value)}
|
||||||
|
allowEnterKey={false}
|
||||||
|
maxLength={MAX_LEAD_LIMIT}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h4>{t('Slug')}</h4>
|
||||||
|
<div class="pretty-form__item">
|
||||||
|
<input type="text" name="slug" id="slug" value={settingsForm.slug} />
|
||||||
|
<label for="slug">{t('Slug')}</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h4>{t('Topics')}</h4>
|
||||||
|
<p class="description">
|
||||||
|
{t(
|
||||||
|
'Add a few topics so that the reader knows what your content is about and can find it on pages of topics that interest them. Topics can be swapped, the first topic becomes the title'
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
<div class={styles.inputContainer}>
|
||||||
|
<div class={clsx('pretty-form__item', styles.topicSelectContainer)}>
|
||||||
|
<Show when={topics()}>
|
||||||
|
<TopicSelect
|
||||||
|
topics={topics()}
|
||||||
|
onChange={handleTopicSelectChange}
|
||||||
|
selectedTopics={props.form.selectedTopics}
|
||||||
|
onMainTopicChange={(mainTopic) => setForm('mainTopic', mainTopic)}
|
||||||
|
mainTopic={props.form.mainTopic}
|
||||||
|
/>
|
||||||
|
</Show>
|
||||||
|
</div>
|
||||||
|
<Show when={formErrors.selectedTopics}>
|
||||||
|
<div class={styles.validationError}>{formErrors.selectedTopics}</div>
|
||||||
|
</Show>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/*<h4>Соавторы</h4>*/}
|
||||||
|
{/*<p class="description">У каждого соавтора можно добавить роль</p>*/}
|
||||||
|
{/*<div class="pretty-form__item--with-button">*/}
|
||||||
|
{/* <div class="pretty-form__item">*/}
|
||||||
|
{/* <input type="text" name="authors" id="authors" placeholder="Введите имя или e-mail" />*/}
|
||||||
|
{/* <label for="authors">Введите имя или e-mail</label>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <button class="button button--submit">Добавить</button>*/}
|
||||||
|
{/*</div>*/}
|
||||||
|
|
||||||
|
{/*<div class="row">*/}
|
||||||
|
{/* <div class="col-md-6">Михаил Драбкин</div>*/}
|
||||||
|
{/* <div class="col-md-6">*/}
|
||||||
|
{/* <input type="text" name="coauthor" id="coauthor1" class="nolabel" />*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/*</div>*/}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="description">
|
|
||||||
{t(
|
|
||||||
'Choose a title image for the article. You can immediately see how the publication card will look like.'
|
|
||||||
)}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div class={styles.commonSettings}>
|
|
||||||
<GrowingTextarea
|
|
||||||
class={styles.settingInput}
|
|
||||||
variant="bordered"
|
|
||||||
placeholder={t('Come up with a title for your story')}
|
|
||||||
initialValue={settingsForm.title}
|
|
||||||
value={(value) => setSettingsForm('title', value)}
|
|
||||||
allowEnterKey={false}
|
|
||||||
maxLength={100}
|
|
||||||
/>
|
|
||||||
<GrowingTextarea
|
|
||||||
class={styles.settingInput}
|
|
||||||
variant="bordered"
|
|
||||||
placeholder={t('Come up with a subtitle for your story')}
|
|
||||||
initialValue={settingsForm.subtitle}
|
|
||||||
value={(value) => setSettingsForm('subtitle', value)}
|
|
||||||
allowEnterKey={false}
|
|
||||||
maxLength={100}
|
|
||||||
/>
|
|
||||||
<GrowingTextarea
|
|
||||||
class={styles.settingInput}
|
|
||||||
variant="bordered"
|
|
||||||
placeholder={t('Write a short introduction')}
|
|
||||||
initialValue={`${settingsForm.lead}`}
|
|
||||||
value={(value) => setSettingsForm('lead', value)}
|
|
||||||
allowEnterKey={false}
|
|
||||||
maxLength={MAX_LEAD_LIMIT}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h4>{t('Slug')}</h4>
|
|
||||||
<div class="pretty-form__item">
|
|
||||||
<input type="text" name="slug" id="slug" value={settingsForm.slug} />
|
|
||||||
<label for="slug">{t('Slug')}</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h4>{t('Topics')}</h4>
|
|
||||||
<p class="description">
|
|
||||||
{t(
|
|
||||||
'Add a few topics so that the reader knows what your content is about and can find it on pages of topics that interest them. Topics can be swapped, the first topic becomes the title'
|
|
||||||
)}
|
|
||||||
</p>
|
|
||||||
<div class={styles.inputContainer}>
|
|
||||||
<div class={clsx('pretty-form__item', styles.topicSelectContainer)}>
|
|
||||||
<Show when={topics()}>
|
|
||||||
<TopicSelect
|
|
||||||
topics={topics()}
|
|
||||||
onChange={handleTopicSelectChange}
|
|
||||||
selectedTopics={props.form.selectedTopics}
|
|
||||||
onMainTopicChange={(mainTopic) => setForm('mainTopic', mainTopic)}
|
|
||||||
mainTopic={props.form.mainTopic}
|
|
||||||
/>
|
|
||||||
</Show>
|
|
||||||
</div>
|
|
||||||
<Show when={formErrors.selectedTopics}>
|
|
||||||
<div class={styles.validationError}>{formErrors.selectedTopics}</div>
|
|
||||||
</Show>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/*<h4>Соавторы</h4>*/}
|
|
||||||
{/*<p class="description">У каждого соавтора можно добавить роль</p>*/}
|
|
||||||
{/*<div class="pretty-form__item--with-button">*/}
|
|
||||||
{/* <div class="pretty-form__item">*/}
|
|
||||||
{/* <input type="text" name="authors" id="authors" placeholder="Введите имя или e-mail" />*/}
|
|
||||||
{/* <label for="authors">Введите имя или e-mail</label>*/}
|
|
||||||
{/* </div>*/}
|
|
||||||
{/* <button class="button button--submit">Добавить</button>*/}
|
|
||||||
{/*</div>*/}
|
|
||||||
|
|
||||||
{/*<div class="row">*/}
|
|
||||||
{/* <div class="col-md-6">Михаил Драбкин</div>*/}
|
|
||||||
{/* <div class="col-md-6">*/}
|
|
||||||
{/* <input type="text" name="coauthor" id="coauthor1" class="nolabel" />*/}
|
|
||||||
{/* </div>*/}
|
|
||||||
{/*</div>*/}
|
|
||||||
|
|
||||||
<div class={styles.formActions}>
|
<div class={styles.formActions}>
|
||||||
<Button
|
<div class="wide-container">
|
||||||
variant="light"
|
<div class="row">
|
||||||
value={t('Cancel changes')}
|
<div class="col-md-19 col-lg-18 col-xl-16 offset-md-5">
|
||||||
class={styles.cancel}
|
<div class={styles.content}>
|
||||||
onClick={handleCancelClick}
|
<Button
|
||||||
/>
|
variant="light"
|
||||||
<Button variant="secondary" onClick={handleSaveDraft} value={t('Save draft')} />
|
value={t('Cancel changes')}
|
||||||
<Button onClick={handlePublishSubmit} variant="primary" value={t('Publish')} />
|
class={styles.cancel}
|
||||||
|
onClick={handleCancelClick}
|
||||||
|
/>
|
||||||
|
<Button variant="secondary" onClick={handleSaveDraft} value={t('Save draft')} />
|
||||||
|
<Button onClick={handlePublishSubmit} variant="primary" value={t('Publish')} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Modal variant="narrow" name="uploadCoverImage">
|
<Modal variant="narrow" name="uploadCoverImage">
|
||||||
<UploadModalContent onClose={(value) => handleUploadModalContentCloseSetCover(value)} />
|
<UploadModalContent onClose={(value) => handleUploadModalContentCloseSetCover(value)} />
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</form>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user