postmerge-fixes
This commit is contained in:
parent
3fb8dde13c
commit
3353004f48
|
@ -1,6 +1,6 @@
|
|||
import { clsx } from 'clsx'
|
||||
import deepEqual from 'fast-deep-equal'
|
||||
import { Accessor, createMemo, createSignal, lazy, onCleanup, onMount, Show } from 'solid-js'
|
||||
import { Accessor, createMemo, createSignal, lazy, onCleanup, onMount, Show, Suspense } from 'solid-js'
|
||||
import { createStore } from 'solid-js/store'
|
||||
|
||||
import { ShoutForm, useEditorContext } from '../../context/editor'
|
||||
|
@ -410,7 +410,7 @@ export const EditView = (props: Props) => {
|
|||
</form>
|
||||
</div>
|
||||
<Show when={page().route === 'editSettings'}>
|
||||
<PublishSettings shoutId={props.shout.id} form={form} />
|
||||
<PublishSettings shoutId={props.shout.id} form={form}></PublishSettings>
|
||||
</Show>
|
||||
<Panel shoutId={props.shout.id} />
|
||||
</>
|
||||
|
|
|
@ -6,7 +6,6 @@ import { createStore } from 'solid-js/store'
|
|||
import { ShoutForm, useEditorContext } from '../../../context/editor'
|
||||
import { useLocalize } from '../../../context/localize'
|
||||
import { useSession } from '../../../context/session'
|
||||
import { apiClient } from '../../../graphql/client/core'
|
||||
import { Topic } from '../../../graphql/schema/core.gen'
|
||||
import { UploadedFile } from '../../../pages/types'
|
||||
import { router } from '../../../stores/router'
|
||||
|
@ -20,6 +19,7 @@ import { EMPTY_TOPIC } from '../Edit'
|
|||
|
||||
import styles from './PublishSettings.module.scss'
|
||||
import stylesBeside from '../../Feed/Beside.module.scss'
|
||||
import { useTopicsStore } from '../../../stores/zine/topics'
|
||||
|
||||
const SimplifiedEditor = lazy(() => import('../../Editor/SimplifiedEditor'))
|
||||
const GrowingTextarea = lazy(() => import('../../_shared/GrowingTextarea/GrowingTextarea'))
|
||||
|
@ -36,9 +36,10 @@ const shorten = (str: string, maxLen: number) => {
|
|||
return `${result}...`
|
||||
}
|
||||
|
||||
export const PublishSettings = async (props: Props) => {
|
||||
export const PublishSettings = (props: Props) => {
|
||||
const { t } = useLocalize()
|
||||
const { author } = useSession()
|
||||
const { sortedTopics } = useTopicsStore()
|
||||
|
||||
const composeDescription = () => {
|
||||
if (!props.form.description) {
|
||||
|
@ -64,7 +65,6 @@ export const PublishSettings = async (props: Props) => {
|
|||
} = useEditorContext()
|
||||
|
||||
const [settingsForm, setSettingsForm] = createStore(initialData)
|
||||
const [topics, setTopics] = createSignal<Topic[]>(null)
|
||||
|
||||
const handleUploadModalContentCloseSetCover = (image: UploadedFile) => {
|
||||
hideModal()
|
||||
|
@ -93,11 +93,6 @@ export const PublishSettings = async (props: Props) => {
|
|||
setForm('selectedTopics', newSelectedTopics)
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
const allTopics = await apiClient.getAllTopics()
|
||||
setTopics(allTopics)
|
||||
})
|
||||
|
||||
const handleBackClick = () => {
|
||||
redirectPage(router, 'edit', {
|
||||
shoutId: props.shoutId.toString(),
|
||||
|
@ -211,9 +206,9 @@ export const PublishSettings = async (props: Props) => {
|
|||
</p>
|
||||
<div class={styles.inputContainer}>
|
||||
<div class={clsx('pretty-form__item', styles.topicSelectContainer)}>
|
||||
<Show when={topics()}>
|
||||
<Show when={sortedTopics()}>
|
||||
<TopicSelect
|
||||
topics={topics()}
|
||||
topics={sortedTopics()}
|
||||
onChange={handleTopicSelectChange}
|
||||
selectedTopics={props.form.selectedTopics}
|
||||
onMainTopicChange={(mainTopic) => setForm('mainTopic', mainTopic)}
|
||||
|
|
|
@ -179,7 +179,15 @@ export const ImageSwiper = (props: Props) => {
|
|||
// @ts-ignore
|
||||
<swiper-slide lazy="true" virtual-index={index()}>
|
||||
<div class={styles.image}>
|
||||
<Image src={slide.url} alt={slide.title} width={800} />
|
||||
<Image
|
||||
src={
|
||||
slide.url.startsWith('https://cdn.discours')
|
||||
? `https://images.discours.io/${slide.url}`
|
||||
: slide.url
|
||||
}
|
||||
alt={slide.title}
|
||||
width={800}
|
||||
/>
|
||||
<Show when={props.editorMode}>
|
||||
<Popover content={t('Delete')}>
|
||||
{(triggerRef: (el) => void) => (
|
||||
|
|
Loading…
Reference in New Issue
Block a user