Merge branch 'dev' into feedback
This commit is contained in:
commit
e686738d34
|
@ -174,7 +174,6 @@ export const FullArticle = (props: ArticleProps) => {
|
||||||
title={props.article.title}
|
title={props.article.title}
|
||||||
description={getDescription(props.article.body)}
|
description={getDescription(props.article.body)}
|
||||||
imageUrl={props.article.cover}
|
imageUrl={props.article.cover}
|
||||||
shareUrl={getShareUrl()}
|
|
||||||
containerCssClass={stylesHeader.control}
|
containerCssClass={stylesHeader.control}
|
||||||
trigger={<Icon name="share-outline" class={styles.icon} />}
|
trigger={<Icon name="share-outline" class={styles.icon} />}
|
||||||
/>
|
/>
|
||||||
|
|
8
src/components/Pages/CreateSettingsPage.tsx
Normal file
8
src/components/Pages/CreateSettingsPage.tsx
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { PageWrap } from '../_shared/PageWrap'
|
||||||
|
|
||||||
|
export const CreateSettingsPage = () => {
|
||||||
|
return <PageWrap>Настройки публикации</PageWrap>
|
||||||
|
}
|
||||||
|
|
||||||
|
// for lazy loading
|
||||||
|
export default CreateSettingsPage
|
|
@ -35,6 +35,7 @@ import { SessionProvider } from '../context/session'
|
||||||
import { ProfileSettingsPage } from './Pages/profile/ProfileSettingsPage'
|
import { ProfileSettingsPage } from './Pages/profile/ProfileSettingsPage'
|
||||||
import { ProfileSecurityPage } from './Pages/profile/ProfileSecurityPage'
|
import { ProfileSecurityPage } from './Pages/profile/ProfileSecurityPage'
|
||||||
import { ProfileSubscriptionsPage } from './Pages/profile/ProfileSubscriptionsPage'
|
import { ProfileSubscriptionsPage } from './Pages/profile/ProfileSubscriptionsPage'
|
||||||
|
import CreateSettingsPage from './Pages/CreateSettingsPage'
|
||||||
|
|
||||||
// TODO: lazy load
|
// TODO: lazy load
|
||||||
// const SomePage = lazy(() => import('./Pages/SomePage'))
|
// const SomePage = lazy(() => import('./Pages/SomePage'))
|
||||||
|
@ -44,6 +45,7 @@ const pagesMap: Record<keyof Routes, Component<PageProps>> = {
|
||||||
expo: LayoutShoutsPage,
|
expo: LayoutShoutsPage,
|
||||||
connect: ConnectPage,
|
connect: ConnectPage,
|
||||||
create: CreatePage,
|
create: CreatePage,
|
||||||
|
createSettings: CreateSettingsPage,
|
||||||
home: HomePage,
|
home: HomePage,
|
||||||
topics: AllTopicsPage,
|
topics: AllTopicsPage,
|
||||||
topic: TopicPage,
|
topic: TopicPage,
|
||||||
|
|
|
@ -2,7 +2,7 @@ import styles from './styles/CommentEditor.module.scss'
|
||||||
import './styles/ProseMirrorOverrides.scss'
|
import './styles/ProseMirrorOverrides.scss'
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
import Button from '../Button'
|
import Button from '../Button'
|
||||||
import { createEffect, createMemo, onMount } from 'solid-js'
|
import { createEffect, onMount, Show } from 'solid-js'
|
||||||
import { t } from '../../../utils/intl'
|
import { t } from '../../../utils/intl'
|
||||||
//ProseMirror deps
|
//ProseMirror deps
|
||||||
import { schema } from './schema'
|
import { schema } from './schema'
|
||||||
|
@ -16,6 +16,8 @@ import { baseKeymap } from 'prosemirror-commands'
|
||||||
import { customKeymap } from '../../EditorNew/prosemirror/plugins/customKeymap'
|
import { customKeymap } from '../../EditorNew/prosemirror/plugins/customKeymap'
|
||||||
import { placeholder } from '../../EditorNew/prosemirror/plugins/placeholder'
|
import { placeholder } from '../../EditorNew/prosemirror/plugins/placeholder'
|
||||||
import { undo, redo, history } from 'prosemirror-history'
|
import { undo, redo, history } from 'prosemirror-history'
|
||||||
|
import { useSession } from '../../../context/session'
|
||||||
|
import { showModal } from '../../../stores/ui'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
initialValue: string
|
initialValue: string
|
||||||
|
@ -31,6 +33,7 @@ const getHtml = (state: EditorState) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const CommentEditor = (props: Props) => {
|
const CommentEditor = (props: Props) => {
|
||||||
|
const { session } = useSession()
|
||||||
const editorElRef: { current: HTMLDivElement } = { current: null }
|
const editorElRef: { current: HTMLDivElement } = { current: null }
|
||||||
const menuElRef: { current: HTMLDivElement } = { current: null }
|
const menuElRef: { current: HTMLDivElement } = { current: null }
|
||||||
const editorViewRef: { current: EditorView } = { current: null }
|
const editorViewRef: { current: EditorView } = { current: null }
|
||||||
|
@ -65,7 +68,9 @@ const CommentEditor = (props: Props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
if (props.clear) clearEditor()
|
if (props.clear) {
|
||||||
|
clearEditor()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -78,12 +83,28 @@ const CommentEditor = (props: Props) => {
|
||||||
<div class={styles.actions}>
|
<div class={styles.actions}>
|
||||||
<div class={styles.menu} ref={(el) => (menuElRef.current = el)} />
|
<div class={styles.menu} ref={(el) => (menuElRef.current = el)} />
|
||||||
<div class={styles.buttons}>
|
<div class={styles.buttons}>
|
||||||
<Button value={t('Send')} variant="primary" onClick={handleSubmitButtonClick} />
|
<Show when={session()?.user?.slug}>
|
||||||
<Button value="Cancel" variant="secondary" onClick={clearEditor} />
|
<Button value={t('Send')} variant="primary" onClick={handleSubmitButtonClick} />
|
||||||
|
</Show>
|
||||||
|
<Button value={t('cancel')} variant="secondary" onClick={clearEditor} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class={styles.helpText}>{'"Cmd-Z": Undo, "Cmd-Y": Redo'}</div>
|
<div class={styles.helpText}>{'"Cmd-Z": Undo, "Cmd-Y": Redo'}</div>
|
||||||
|
<Show when={!session()?.user?.slug}>
|
||||||
|
<div class={styles.signInMessage} id="comments">
|
||||||
|
{t('To write a comment, you must')}
|
||||||
|
<span
|
||||||
|
class={styles.link}
|
||||||
|
onClick={(evt) => {
|
||||||
|
evt.preventDefault()
|
||||||
|
showModal('auth')
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t('sign up or sign in')}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</Show>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,3 +30,21 @@
|
||||||
margin: 12px 0;
|
margin: 12px 0;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.signInMessage {
|
||||||
|
background: #f1f2f3;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 16px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 20px;
|
||||||
|
|
||||||
|
.link {
|
||||||
|
color: #2638d9;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: 0.3s ease-in-out;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: unset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
---
|
|
||||||
import { Root } from '../components/Root'
|
|
||||||
import Prerendered from '../main.astro'
|
|
||||||
import { initRouter } from '../stores/router'
|
|
||||||
|
|
||||||
const { pathname, search } = Astro.url
|
|
||||||
initRouter(pathname, search)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<Prerendered>
|
|
||||||
<Root client:load />
|
|
||||||
</Prerendered>
|
|
13
src/pages/create/[page].astro
Normal file
13
src/pages/create/[page].astro
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
import { Root } from '../../components/Root'
|
||||||
|
import Prerendered from '../../main.astro'
|
||||||
|
import { initRouter } from '../../stores/router'
|
||||||
|
|
||||||
|
const { pathname, search } = Astro.url
|
||||||
|
initRouter(pathname, search)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<Prerendered>
|
||||||
|
<Root client:load />
|
||||||
|
</Prerendered>
|
|
@ -8,6 +8,7 @@ export interface Routes {
|
||||||
home: void
|
home: void
|
||||||
connect: void
|
connect: void
|
||||||
create: void
|
create: void
|
||||||
|
createSettings: void
|
||||||
topics: void
|
topics: void
|
||||||
topic: 'slug'
|
topic: 'slug'
|
||||||
authors: void
|
authors: void
|
||||||
|
@ -39,6 +40,7 @@ const routerStore = createRouter<Routes>(
|
||||||
inbox: '/inbox',
|
inbox: '/inbox',
|
||||||
connect: '/connect',
|
connect: '/connect',
|
||||||
create: '/create',
|
create: '/create',
|
||||||
|
createSettings: '/create/settings',
|
||||||
topics: '/topics',
|
topics: '/topics',
|
||||||
topic: '/topic/:slug',
|
topic: '/topic/:slug',
|
||||||
authors: '/authors',
|
authors: '/authors',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user