diff --git a/public/icons/create-article.svg b/public/icons/create-article.svg new file mode 100644 index 00000000..016af99c --- /dev/null +++ b/public/icons/create-article.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/public/icons/create-books.svg b/public/icons/create-books.svg new file mode 100644 index 00000000..dd941724 --- /dev/null +++ b/public/icons/create-books.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/icons/create-images.svg b/public/icons/create-images.svg new file mode 100644 index 00000000..fffa583e --- /dev/null +++ b/public/icons/create-images.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/icons/create-music.svg b/public/icons/create-music.svg new file mode 100644 index 00000000..6c390f08 --- /dev/null +++ b/public/icons/create-music.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/icons/create-video.svg b/public/icons/create-video.svg new file mode 100644 index 00000000..450eba0e --- /dev/null +++ b/public/icons/create-video.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 3050281b..8a0b11c0 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -22,6 +22,7 @@ "Author": "Author", "Authors": "Authors", "Autotypograph": "Autotypograph", + "Back": "Back", "Back to main page": "Back to main page", "Become an author": "Become an author", "Bold": "Bold", @@ -42,6 +43,7 @@ "By views": "By views", "Characters": "Знаков", "Chat Title": "Chat Title", + "Choose a post type": "Choose a post type", "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", "Collaborate": "Help Edit", @@ -276,6 +278,7 @@ "actions": "actions", "add link": "add link", "all topics": "all topics", + "article": "article", "author": "author", "authors": "authors", "back to menu": "back to menu", @@ -297,9 +300,12 @@ "header 1": "header 1", "header 2": "header 2", "header 3": "header 3", + "images": "images", "invalid password": "invalid password", "italic": "italic", + "literature": "literature", "marker list": "marker list", + "music": "music", "my feed": "my ribbon", "notifications": "notifications", "number list": "number list", @@ -313,6 +319,7 @@ "terms of use": "terms of use", "topics": "topics", "user already exist": "user already exists", + "video": "video", "view": "view", "zine": "zine" } diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json index f07db3e2..cf8af412 100644 --- a/public/locales/ru/translation.json +++ b/public/locales/ru/translation.json @@ -24,6 +24,7 @@ "Author": "Автор", "Authors": "Авторы", "Autotypograph": "Автотипограф", + "Back": "Назад", "Back to main page": "Вернуться на главную", "Become an author": "Стать автором", "Bold": "Жирный", @@ -44,6 +45,7 @@ "By views": "По просмотрам", "Characters": "Знаков", "Chat Title": "Тема дискурса", + "Choose a post type": "Выберите тип публикации", "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": "Выберите кому хотите написать", "Collaborate": "Помочь редактировать", @@ -291,6 +293,7 @@ "actions": "действия", "add link": "добавить ссылку", "all topics": "все темы", + "article": "статья", "author": "автор", "authors": "авторы", "back to menu": "назад в меню", @@ -315,9 +318,12 @@ "header 1": "заголовок 1", "header 2": "заголовок 2", "header 3": "заголовок 3", + "images": "изображения", "invalid password": "некорректный пароль", "italic": "курсив", + "literature": "литература", "marker list": "маркир. список", + "music": "музыка", "my feed": "моя лента", "notifications": "уведомления", "number list": "нумер. список", @@ -335,6 +341,7 @@ "terms of use": "правилами пользования сайтом", "topics": "темы", "user already exist": "пользователь уже существует", + "video": "видео", "view": "просмотр", "zine": "журнал" } diff --git a/src/components/Nav/HeaderAuth.tsx b/src/components/Nav/HeaderAuth.tsx index 46c1ea19..2d6eb8b4 100644 --- a/src/components/Nav/HeaderAuth.tsx +++ b/src/components/Nav/HeaderAuth.tsx @@ -49,9 +49,7 @@ export const HeaderAuth = (props: HeaderAuthProps) => { toggleWarnings() } - const isEditorPage = createMemo( - () => page().route === 'create' || page().route === 'edit' || page().route === 'editSettings' - ) + const isEditorPage = createMemo(() => page().route === 'edit' || page().route === 'editSettings') const showNotifications = createMemo(() => isAuthenticated() && !isEditorPage()) const showSaveButton = createMemo(() => isAuthenticated() && isEditorPage()) diff --git a/src/pages/create.page.tsx b/src/pages/create.page.tsx index c59318f6..8077a5d4 100644 --- a/src/pages/create.page.tsx +++ b/src/pages/create.page.tsx @@ -1,19 +1,58 @@ import { PageLayout } from '../components/_shared/PageLayout' -import { Loading } from '../components/_shared/Loading' -import { onMount } from 'solid-js' +import { useLocalize } from '../context/localize' +import { Button } from '../components/_shared/Button' +import { Icon } from '../components/_shared/Icon' +import { clsx } from 'clsx' +import styles from '../styles/Create.module.scss' import { apiClient } from '../utils/apiClient' -import { router } from '../stores/router' import { redirectPage } from '@nanostores/router' +import { router } from '../stores/router' + +const handleCreateArticle = async () => { + const shout = await apiClient.createArticle({ article: {} }) + redirectPage(router, 'edit', { shoutId: shout.id.toString() }) +} export const CreatePage = () => { - onMount(async () => { - const shout = await apiClient.createArticle({ article: {} }) - redirectPage(router, 'edit', { shoutId: shout.id.toString() }) - }) - + const { t } = useLocalize() return ( - + ) } diff --git a/src/styles/Create.module.scss b/src/styles/Create.module.scss new file mode 100644 index 00000000..f6c9b1b2 --- /dev/null +++ b/src/styles/Create.module.scss @@ -0,0 +1,47 @@ +.Create { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + min-height: 50vh; + + .list { + display: flex; + align-items: center; + justify-content: space-around; + gap: 24px; + + li { + a, + .link { + cursor: pointer; + text-align: center; + padding: 16px; + justify-content: center; + display: flex; + flex-direction: column; + font-weight: bold; + text-decoration: none; + border: none; + + &:hover { + background: var(--link-hover-background); + color: var(--link-hover-color); + + .icon { + filter: invert(1); + } + } + } + } + + .icon { + margin: auto 21px auto; + + img { + height: 54px; + max-width: 64px; + } + } + } +}