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