edit-new-wip
This commit is contained in:
parent
c79b0451cb
commit
19bae3b2dd
Before Width: | Height: | Size: 714 B After Width: | Height: | Size: 714 B |
Before Width: | Height: | Size: 350 B After Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 290 B After Width: | Height: | Size: 290 B |
|
@ -1,3 +1,4 @@
|
||||||
|
import { A } from '@solidjs/router'
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
import { createMemo } from 'solid-js'
|
import { createMemo } from 'solid-js'
|
||||||
import { useLocalize } from '~/context/localize'
|
import { useLocalize } from '~/context/localize'
|
||||||
|
@ -6,8 +7,6 @@ import type { Author } from '~/graphql/schema/core.gen'
|
||||||
import { Icon } from '../_shared/Icon'
|
import { Icon } from '../_shared/Icon'
|
||||||
import type { PopupProps } from '../_shared/Popup'
|
import type { PopupProps } from '../_shared/Popup'
|
||||||
import { Popup } from '../_shared/Popup'
|
import { Popup } from '../_shared/Popup'
|
||||||
|
|
||||||
import { A } from '@solidjs/router'
|
|
||||||
import styles from '../_shared/Popup/Popup.module.scss'
|
import styles from '../_shared/Popup/Popup.module.scss'
|
||||||
|
|
||||||
type ProfilePopupProps = Omit<PopupProps, 'children'>
|
type ProfilePopupProps = Omit<PopupProps, 'children'>
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
"Are you sure you want to delete this draft?": "Уверены, что хотите удалить этот черновик?",
|
"Are you sure you want to delete this draft?": "Уверены, что хотите удалить этот черновик?",
|
||||||
"Are you sure you want to to proceed the action?": "Вы уверены, что хотите продолжить?",
|
"Are you sure you want to to proceed the action?": "Вы уверены, что хотите продолжить?",
|
||||||
"Art": "Искусство",
|
"Art": "Искусство",
|
||||||
"article": "статья",
|
"Article": "Статья",
|
||||||
"Artist": "Исполнитель",
|
"Artist": "Исполнитель",
|
||||||
"Artist...": "Исполнитель...",
|
"Artist...": "Исполнитель...",
|
||||||
"Artworks": "Артворки",
|
"Artworks": "Артворки",
|
||||||
|
@ -219,7 +219,7 @@
|
||||||
"I have no account yet": "У меня еще нет аккаунта",
|
"I have no account yet": "У меня еще нет аккаунта",
|
||||||
"I know the password": "Я знаю пароль!",
|
"I know the password": "Я знаю пароль!",
|
||||||
"Image format not supported": "Тип изображения не поддерживается",
|
"Image format not supported": "Тип изображения не поддерживается",
|
||||||
"images": "изображения",
|
"Image": "Изображение",
|
||||||
"In bookmarks, you can save favorite discussions and materials that you want to return to": "В закладках можно сохранять избранные дискуссии и материалы, к которым хочется вернуться",
|
"In bookmarks, you can save favorite discussions and materials that you want to return to": "В закладках можно сохранять избранные дискуссии и материалы, к которым хочется вернуться",
|
||||||
"Inbox": "Входящие",
|
"Inbox": "Входящие",
|
||||||
"Incorrect new password confirm": "Неверное подтверждение нового пароля",
|
"Incorrect new password confirm": "Неверное подтверждение нового пароля",
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { useNavigate } from '@solidjs/router'
|
import { useNavigate } from '@solidjs/router'
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
|
import { For } from 'solid-js'
|
||||||
import { AuthGuard } from '~/components/AuthGuard'
|
import { AuthGuard } from '~/components/AuthGuard'
|
||||||
import { Button } from '~/components/_shared/Button'
|
import { Button } from '~/components/_shared/Button'
|
||||||
import { Icon } from '~/components/_shared/Icon'
|
import { Icon } from '~/components/_shared/Icon'
|
||||||
|
@ -15,7 +16,7 @@ export default () => {
|
||||||
const client = useGraphQL()
|
const client = useGraphQL()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
const handleCreate = async (layout: LayoutType) => {
|
const handleCreate = async (layout: LayoutType) => {
|
||||||
const result = await client.mutation(createShoutMutation, { article: { layout: layout } }).toPromise()
|
const result = await client.mutation(createShoutMutation, { shout: { layout: layout } }).toPromise()
|
||||||
if (result) {
|
if (result) {
|
||||||
const shout = result.data.create_shout
|
const shout = result.data.create_shout
|
||||||
if (shout?.id) navigate(`/edit/${shout.id}`)
|
if (shout?.id) navigate(`/edit/${shout.id}`)
|
||||||
|
@ -31,36 +32,16 @@ export default () => {
|
||||||
<article class={clsx('wide-container', 'container--static-page', styles.Create)}>
|
<article class={clsx('wide-container', 'container--static-page', styles.Create)}>
|
||||||
<h1>{t('Choose a post type')}</h1>
|
<h1>{t('Choose a post type')}</h1>
|
||||||
<ul class={clsx('nodash', styles.list)}>
|
<ul class={clsx('nodash', styles.list)}>
|
||||||
<li>
|
<For each={['Article', 'Literature', 'Image', 'Audio', 'Video']}>
|
||||||
<div class={styles.link} onClick={() => handleCreate('article')}>
|
{(layout: string) => (
|
||||||
<Icon name="create-article" class={styles.icon} />
|
<li>
|
||||||
<div>{t('Article').toLocaleLowerCase()}</div>
|
<div class={styles.link} onClick={() => handleCreate(layout.toLowerCase() as LayoutType)}>
|
||||||
</div>
|
<Icon name={`create-${layout.toLowerCase()}`} class={styles.icon} />
|
||||||
</li>
|
<div>{t(layout)}</div>
|
||||||
<li>
|
</div>
|
||||||
<div class={styles.link} onClick={() => handleCreate('literature')}>
|
</li>
|
||||||
<Icon name="create-books" class={styles.icon} />
|
)}
|
||||||
<div>{t('Literature').toLocaleLowerCase()}</div>
|
</For>
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<div class={styles.link} onClick={() => handleCreate('image')}>
|
|
||||||
<Icon name="create-images" class={styles.icon} />
|
|
||||||
<div>{t('Images').toLocaleLowerCase()}</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<div class={styles.link} onClick={() => handleCreate('audio')}>
|
|
||||||
<Icon name="create-music" class={styles.icon} />
|
|
||||||
<div>{t('Music').toLocaleLowerCase()}</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<div class={styles.link} onClick={() => handleCreate('video')}>
|
|
||||||
<Icon name="create-video" class={styles.icon} />
|
|
||||||
<div>{t('Video').toLocaleLowerCase()}</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<Button value={t('Back')} onClick={() => window?.history.back()} />
|
<Button value={t('Back')} onClick={() => window?.history.back()} />
|
||||||
</article>
|
</article>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user