diff --git a/src/components/Article/FullArticle.tsx b/src/components/Article/FullArticle.tsx index 9b5093a2..247248af 100644 --- a/src/components/Article/FullArticle.tsx +++ b/src/components/Article/FullArticle.tsx @@ -174,7 +174,6 @@ export const FullArticle = (props: ArticleProps) => { title={props.article.title} description={getDescription(props.article.body)} imageUrl={props.article.cover} - shareUrl={getShareUrl()} containerCssClass={stylesHeader.control} trigger={} /> diff --git a/src/components/Pages/CreateSettingsPage.tsx b/src/components/Pages/CreateSettingsPage.tsx new file mode 100644 index 00000000..69478fb5 --- /dev/null +++ b/src/components/Pages/CreateSettingsPage.tsx @@ -0,0 +1,8 @@ +import { PageWrap } from '../_shared/PageWrap' + +export const CreateSettingsPage = () => { + return Настройки публикации +} + +// for lazy loading +export default CreateSettingsPage diff --git a/src/components/Root.tsx b/src/components/Root.tsx index 4bb38cd2..771ed7e0 100644 --- a/src/components/Root.tsx +++ b/src/components/Root.tsx @@ -35,6 +35,7 @@ import { SessionProvider } from '../context/session' import { ProfileSettingsPage } from './Pages/profile/ProfileSettingsPage' import { ProfileSecurityPage } from './Pages/profile/ProfileSecurityPage' import { ProfileSubscriptionsPage } from './Pages/profile/ProfileSubscriptionsPage' +import CreateSettingsPage from './Pages/CreateSettingsPage' // TODO: lazy load // const SomePage = lazy(() => import('./Pages/SomePage')) @@ -44,6 +45,7 @@ const pagesMap: Record> = { expo: LayoutShoutsPage, connect: ConnectPage, create: CreatePage, + createSettings: CreateSettingsPage, home: HomePage, topics: AllTopicsPage, topic: TopicPage, diff --git a/src/components/_shared/CommentEditor/CommentEditor.tsx b/src/components/_shared/CommentEditor/CommentEditor.tsx index 74cb9ad9..de857fc1 100644 --- a/src/components/_shared/CommentEditor/CommentEditor.tsx +++ b/src/components/_shared/CommentEditor/CommentEditor.tsx @@ -2,7 +2,7 @@ import styles from './styles/CommentEditor.module.scss' import './styles/ProseMirrorOverrides.scss' import { clsx } from 'clsx' import Button from '../Button' -import { createEffect, createMemo, onMount } from 'solid-js' +import { createEffect, onMount, Show } from 'solid-js' import { t } from '../../../utils/intl' //ProseMirror deps import { schema } from './schema' @@ -16,6 +16,8 @@ import { baseKeymap } from 'prosemirror-commands' import { customKeymap } from '../../EditorNew/prosemirror/plugins/customKeymap' import { placeholder } from '../../EditorNew/prosemirror/plugins/placeholder' import { undo, redo, history } from 'prosemirror-history' +import { useSession } from '../../../context/session' +import { showModal } from '../../../stores/ui' type Props = { initialValue: string @@ -31,6 +33,7 @@ const getHtml = (state: EditorState) => { } const CommentEditor = (props: Props) => { + const { session } = useSession() const editorElRef: { current: HTMLDivElement } = { current: null } const menuElRef: { current: HTMLDivElement } = { current: null } const editorViewRef: { current: EditorView } = { current: null } @@ -65,7 +68,9 @@ const CommentEditor = (props: Props) => { } createEffect(() => { - if (props.clear) clearEditor() + if (props.clear) { + clearEditor() + } }) return ( @@ -78,12 +83,28 @@ const CommentEditor = (props: Props) => {
(menuElRef.current = el)} />
-
{'"Cmd-Z": Undo, "Cmd-Y": Redo'}
+ +
+ {t('To write a comment, you must')}  + { + evt.preventDefault() + showModal('auth') + }} + > + {t('sign up or sign in')} + +
+
) } diff --git a/src/components/_shared/CommentEditor/styles/CommentEditor.module.scss b/src/components/_shared/CommentEditor/styles/CommentEditor.module.scss index ea33f29d..0b1f8353 100644 --- a/src/components/_shared/CommentEditor/styles/CommentEditor.module.scss +++ b/src/components/_shared/CommentEditor/styles/CommentEditor.module.scss @@ -30,3 +30,21 @@ margin: 12px 0; 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; + } + } +} diff --git a/src/pages/create.astro b/src/pages/create.astro deleted file mode 100644 index b4ffc2d1..00000000 --- a/src/pages/create.astro +++ /dev/null @@ -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) - ---- - - - - diff --git a/src/pages/create/[page].astro b/src/pages/create/[page].astro new file mode 100644 index 00000000..b107057c --- /dev/null +++ b/src/pages/create/[page].astro @@ -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) + +--- + + + + diff --git a/src/stores/router.ts b/src/stores/router.ts index 6d8a002e..fe8e3e32 100644 --- a/src/stores/router.ts +++ b/src/stores/router.ts @@ -8,6 +8,7 @@ export interface Routes { home: void connect: void create: void + createSettings: void topics: void topic: 'slug' authors: void @@ -39,6 +40,7 @@ const routerStore = createRouter( inbox: '/inbox', connect: '/connect', create: '/create', + createSettings: '/create/settings', topics: '/topics', topic: '/topic/:slug', authors: '/authors',