[WIP] init

This commit is contained in:
ilya-bkv 2023-05-08 21:23:51 +03:00
parent 8bc9d4d592
commit 39c99091f9
6 changed files with 66 additions and 16 deletions

View File

@ -3,6 +3,7 @@
"About myself": "About myself", "About myself": "About myself",
"About the project": "About the project", "About the project": "About the project",
"Add comment": "Comment", "Add comment": "Comment",
"Add image": "Add image",
"Address on Discourse": "Address on Discourse", "Address on Discourse": "Address on Discourse",
"All": "All", "All": "All",
"All authors": "All authors", "All authors": "All authors",
@ -32,6 +33,7 @@
"By views": "By views", "By views": "By views",
"Characters": "Знаков", "Characters": "Знаков",
"Chat Title": "Chat Title", "Chat Title": "Chat Title",
"Choose a title image for the article. You can immediately see how the publication card will look like.": "Choose a title image for the article. You can immediately see how the publication card will look like.",
"Choose who you want to write to": "Choose who you want to write to", "Choose who you want to write to": "Choose who you want to write to",
"Collaborate": "Help Edit", "Collaborate": "Help Edit",
"Comments": "Comments", "Comments": "Comments",
@ -119,6 +121,7 @@
"Logout": "Logout", "Logout": "Logout",
"Manifest": "Manifest", "Manifest": "Manifest",
"Many files, choose only one": "Many files, choose only one", "Many files, choose only one": "Many files, choose only one",
"Material card": "Material card",
"More": "More", "More": "More",
"Most commented": "Commented", "Most commented": "Commented",
"Most read": "Readable", "Most read": "Readable",
@ -162,6 +165,7 @@
"Recent": "Fresh", "Recent": "Fresh",
"Reply": "Reply", "Reply": "Reply",
"Report": "Complain", "Report": "Complain",
"Required": "Required",
"Resend code": "Send confirmation", "Resend code": "Send confirmation",
"Restore password": "Restore password", "Restore password": "Restore password",
"Save draft": "Save draft", "Save draft": "Save draft",
@ -272,5 +276,5 @@
"user already exist": "user already exists", "user already exist": "user already exists",
"view": "view", "view": "view",
"zine": "zine", "zine": "zine",
"Required": "Required" "Publish Settings": "Publish Settings"
} }

View File

@ -4,6 +4,7 @@
"About myself": "О себе", "About myself": "О себе",
"About the project": "О проекте", "About the project": "О проекте",
"Add comment": "Комментировать", "Add comment": "Комментировать",
"Add image": "Добавить изображение",
"Add to bookmarks": "Добавить в закладки", "Add to bookmarks": "Добавить в закладки",
"Address on Discourse": "Адрес на Дискурсе", "Address on Discourse": "Адрес на Дискурсе",
"All": "Все", "All": "Все",
@ -34,6 +35,7 @@
"By views": "По просмотрам", "By views": "По просмотрам",
"Characters": "Знаков", "Characters": "Знаков",
"Chat Title": "Тема дискурса", "Chat Title": "Тема дискурса",
"Choose a title image for the article. You can immediately see how the publication card will look like.": "Выберите заглавное изображение для статьи. Тут же сразу можно увидеть как будет выглядеть карточка публикации.",
"Choose who you want to write to": "Выберите кому хотите написать", "Choose who you want to write to": "Выберите кому хотите написать",
"Collaborate": "Помочь редактировать", "Collaborate": "Помочь редактировать",
"Comments": "Комментарии", "Comments": "Комментарии",
@ -126,6 +128,7 @@
"Logout": "Выход", "Logout": "Выход",
"Manifest": "Манифест", "Manifest": "Манифест",
"Many files, choose only one": "Много файлов, выберете один", "Many files, choose only one": "Много файлов, выберете один",
"Material card": "Карточка материала",
"More": "Ещё", "More": "Ещё",
"Most commented": "Комментируемое", "Most commented": "Комментируемое",
"Most read": "Читаемое", "Most read": "Читаемое",
@ -173,11 +176,13 @@
"Recent": "Свежее", "Recent": "Свежее",
"Reply": "Ответить", "Reply": "Ответить",
"Report": "Пожаловаться", "Report": "Пожаловаться",
"Required": "Поле обязательно для заполнения",
"Resend code": "Выслать подтверждение", "Resend code": "Выслать подтверждение",
"Restore password": "Восстановить пароль", "Restore password": "Восстановить пароль",
"Save": "Сохранить", "Save": "Сохранить",
"Save draft": "Сохранить черновик", "Save draft": "Сохранить черновик",
"Save settings": "Сохранить настройки", "Save settings": "Сохранить настройки",
"Scroll up": "Наверх",
"Search": "Поиск", "Search": "Поиск",
"Search author": "Поиск автора", "Search author": "Поиск автора",
"Search topic": "Поиск темы", "Search topic": "Поиск темы",
@ -187,7 +192,6 @@
"Send": "Отправить", "Send": "Отправить",
"Send link again": "Прислать ссылку ещё раз", "Send link again": "Прислать ссылку ещё раз",
"Settings": "Настройки", "Settings": "Настройки",
"Scroll up": "Наверх",
"Share": "Поделиться", "Share": "Поделиться",
"Short opening": "Небольшое вступление, чтобы заинтересовать читателя", "Short opening": "Небольшое вступление, чтобы заинтересовать читателя",
"Show": "Показать", "Show": "Показать",
@ -293,5 +297,5 @@
"user already exist": "пользователь уже существует", "user already exist": "пользователь уже существует",
"view": "просмотр", "view": "просмотр",
"zine": "журнал", "zine": "журнал",
"Required": "Поле обязательно для заполнения" "Publish Settings": "Настройки публикации"
} }

View File

@ -0,0 +1 @@
export { TopicSelect } from './TopicSelect'

View File

@ -0,0 +1,3 @@
export { Editor } from './Editor'
export { Panel } from './Panel'
export { TopicSelect } from './TopicSelect'

View File

@ -4,8 +4,37 @@
.articlePreview { .articlePreview {
border: 2px solid #e8e8e8; border: 2px solid #e8e8e8;
min-height: 10em;
padding: 1rem 1.2rem; padding: 1rem 1.2rem;
display: flex;
flex-direction: column;
min-height: 300px;
align-items: flex-start;
box-sizing: border-box;
.shoutCardTitle {
@include font-size(2.2rem);
font-weight: 700;
line-height: 1.25;
margin: auto 0 0.8rem;
}
.shoutCardSubtitle {
@include font-size(1.7rem);
color: #696969;
font-weight: 400;
line-height: 1.3;
margin-bottom: 0.8rem;
transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.shoutAuthor {
@include font-size(1.2rem);
margin-right: 1.6rem;
color: rgb(0 0 0 / 70%);
}
} }
.formHolder { .formHolder {

View File

@ -1,16 +1,16 @@
import { createSignal, onCleanup, onMount, Show } from 'solid-js' import { createSignal, onCleanup, onMount, Show } from 'solid-js'
import { useLocalize } from '../../context/localize' import { useLocalize } from '../../context/localize'
import { clsx } from 'clsx' import { clsx } from 'clsx'
import styles from './Edit.module.scss'
import { Title } from '@solidjs/meta' import { Title } from '@solidjs/meta'
import type { Shout, Topic } from '../../graphql/types.gen' import type { Shout, Topic } from '../../graphql/types.gen'
import { apiClient } from '../../utils/apiClient' import { apiClient } from '../../utils/apiClient'
import { TopicSelect } from '../Editor/TopicSelect/TopicSelect'
import { useRouter } from '../../stores/router' import { useRouter } from '../../stores/router'
import { Editor } from '../Editor/Editor'
import { Panel } from '../Editor/Panel'
import { useEditorContext } from '../../context/editor' import { useEditorContext } from '../../context/editor'
import { Editor, Panel, TopicSelect } from '../Editor'
import { Icon } from '../_shared/Icon' import { Icon } from '../_shared/Icon'
import { Button } from '../_shared/Button'
import styles from './Edit.module.scss'
import { useSession } from '../../context/session'
type EditViewProps = { type EditViewProps = {
shout: Shout shout: Shout
@ -18,6 +18,7 @@ type EditViewProps = {
export const EditView = (props: EditViewProps) => { export const EditView = (props: EditViewProps) => {
const { t } = useLocalize() const { t } = useLocalize()
const { user } = useSession()
const [isScrolled, setIsScrolled] = createSignal(false) const [isScrolled, setIsScrolled] = createSignal(false)
const [topics, setTopics] = createSignal<Topic[]>(null) const [topics, setTopics] = createSignal<Topic[]>(null)
@ -87,7 +88,7 @@ export const EditView = (props: EditViewProps) => {
behavior: 'smooth' behavior: 'smooth'
}) })
} }
console.log('!!! :')
return ( return (
<> <>
<button <button
@ -101,6 +102,7 @@ export const EditView = (props: EditViewProps) => {
</button> </button>
<div class={styles.container}> <div class={styles.container}>
<h1>ЙФЙФЙФЙФЙЫЙ &nbsp;</h1>
<Title>{t('Write an article')}</Title> <Title>{t('Write an article')}</Title>
<form> <form>
<div class="wide-container"> <div class="wide-container">
@ -117,7 +119,7 @@ export const EditView = (props: EditViewProps) => {
type="text" type="text"
name="title" name="title"
id="title" id="title"
placeholder="Заголовок" placeholder={t('Header')}
autocomplete="off" autocomplete="off"
value={form.title} value={form.title}
onInput={handleTitleInputChange} onInput={handleTitleInputChange}
@ -133,7 +135,7 @@ export const EditView = (props: EditViewProps) => {
name="subtitle" name="subtitle"
id="subtitle" id="subtitle"
autocomplete="off" autocomplete="off"
placeholder="Подзаголовок" placeholder={t('Subheader')}
value={form.subtitle} value={form.subtitle}
onChange={(e) => setForm('subtitle', e.currentTarget.value)} onChange={(e) => setForm('subtitle', e.currentTarget.value)}
/> />
@ -148,7 +150,7 @@ export const EditView = (props: EditViewProps) => {
[styles.visible]: page().route === 'editSettings' [styles.visible]: page().route === 'editSettings'
})} })}
> >
<h1>Настройки публикации</h1> <h1>{t('Publish Settings')}</h1>
<h4>Slug</h4> <h4>Slug</h4>
<div class="pretty-form__item"> <div class="pretty-form__item">
@ -214,12 +216,19 @@ export const EditView = (props: EditViewProps) => {
{/* </div>*/} {/* </div>*/}
{/*</div>*/} {/*</div>*/}
<h4>Карточка материала на&nbsp;главной</h4> <h4>{t('Material card')}</h4>
<p class="description"> <p class="description">
Выберите заглавное изображение для статьи, тут сразу можно увидеть как карточка будет {t(
выглядеть на&nbsp;главной странице 'Choose a title image for the article. You can immediately see how the publication card will look like.'
)}
</p> </p>
<div class={styles.articlePreview} /> <div class={styles.articlePreview}>
<Button variant="primary" onClick={() => ''} value={t('Add image')} />
<div class={styles.shoutCardTitle}>{form.title}</div>
<div class={styles.shoutCardSubtitle}>{form.subtitle}</div>
<div class={styles.shoutAuthor}>{user().name}</div>
</div>
</div> </div>
</div> </div>
</div> </div>