-
{props.name}
+
{props.author.name}
Указать предпочтительные языки для результатов поиска можно в разделе
diff --git a/src/components/Inbox/Search.module.scss b/src/components/Inbox/Search.module.scss
index 2808aba0..207ad6a6 100644
--- a/src/components/Inbox/Search.module.scss
+++ b/src/components/Inbox/Search.module.scss
@@ -1,7 +1,7 @@
.Search {
.field {
position: relative;
- background: #ffffff;
+ background: #fff;
border: 2px solid #e8e8e8;
border-radius: 2px;
overflow: hidden;
@@ -22,8 +22,10 @@
color: #858585;
font-family: inherit;
}
+
&:focus {
outline: none;
+
& + .icon {
opacity: 0;
right: -30px;
diff --git a/src/components/Inbox/Search.tsx b/src/components/Inbox/Search.tsx
index d180331a..90ce7423 100644
--- a/src/components/Inbox/Search.tsx
+++ b/src/components/Inbox/Search.tsx
@@ -1,6 +1,6 @@
import styles from './Search.module.scss'
import { createSignal } from 'solid-js'
-import { Icon } from '../Nav/Icon'
+import { Icon } from '../_shared/Icon'
type Props = {
placeholder: string
diff --git a/src/components/Nav/AuthModal/SocialProviders.tsx b/src/components/Nav/AuthModal/SocialProviders.tsx
index 1daefd67..fcbe1309 100644
--- a/src/components/Nav/AuthModal/SocialProviders.tsx
+++ b/src/components/Nav/AuthModal/SocialProviders.tsx
@@ -1,5 +1,5 @@
import { t } from '../../../utils/intl'
-import { Icon } from '../Icon'
+import { Icon } from '../../_shared/Icon'
import { hideModal } from '../../../stores/ui'
import styles from './SocialProviders.module.scss'
diff --git a/src/components/Nav/Header.tsx b/src/components/Nav/Header.tsx
index adbe721c..a21b78e6 100644
--- a/src/components/Nav/Header.tsx
+++ b/src/components/Nav/Header.tsx
@@ -1,5 +1,5 @@
import { For, Show, createSignal, createEffect, onMount, onCleanup } from 'solid-js'
-import { Icon } from './Icon'
+import { Icon } from '../_shared/Icon'
import { Modal } from './Modal'
import { AuthModal } from './AuthModal'
import { t } from '../../utils/intl'
diff --git a/src/components/Nav/HeaderAuth.tsx b/src/components/Nav/HeaderAuth.tsx
index f8eee853..aa54e6fa 100644
--- a/src/components/Nav/HeaderAuth.tsx
+++ b/src/components/Nav/HeaderAuth.tsx
@@ -2,7 +2,7 @@ import styles from './Header.module.scss'
import { clsx } from 'clsx'
import { handleClientRouteLinkClick, useRouter } from '../../stores/router'
import { t } from '../../utils/intl'
-import { Icon } from './Icon'
+import { Icon } from '../_shared/Icon'
import { createSignal, Show } from 'solid-js'
import Notifications from './Notifications'
import { ProfilePopup } from './ProfilePopup'
diff --git a/src/components/Nav/Topics.tsx b/src/components/Nav/Topics.tsx
index 5ce88cce..f79526e0 100644
--- a/src/components/Nav/Topics.tsx
+++ b/src/components/Nav/Topics.tsx
@@ -1,6 +1,6 @@
import { For, Show } from 'solid-js'
import type { Topic } from '../../graphql/types.gen'
-import { Icon } from './Icon'
+import { Icon } from '../_shared/Icon'
import './Topics.scss'
import { t } from '../../utils/intl'
import { locale } from '../../stores/ui'
diff --git a/src/components/Pages/AllAuthorsPage.tsx b/src/components/Pages/AllAuthorsPage.tsx
index 5a6e380c..959bc722 100644
--- a/src/components/Pages/AllAuthorsPage.tsx
+++ b/src/components/Pages/AllAuthorsPage.tsx
@@ -1,4 +1,4 @@
-import { MainLayout } from '../Layouts/MainLayout'
+import { PageWrap } from '../_shared/PageWrap'
import { AllAuthorsView } from '../Views/AllAuthors'
import type { PageProps } from '../types'
import { createSignal, onMount, Show } from 'solid-js'
@@ -18,11 +18,11 @@ export const AllAuthorsPage = (props: PageProps) => {
})
return (
-
+
}>
-
+
)
}
diff --git a/src/components/Pages/AllTopicsPage.tsx b/src/components/Pages/AllTopicsPage.tsx
index ae5e3230..6c2276b0 100644
--- a/src/components/Pages/AllTopicsPage.tsx
+++ b/src/components/Pages/AllTopicsPage.tsx
@@ -1,4 +1,4 @@
-import { MainLayout } from '../Layouts/MainLayout'
+import { PageWrap } from '../_shared/PageWrap'
import { AllTopicsView } from '../Views/AllTopics'
import type { PageProps } from '../types'
import { createSignal, onMount, Show } from 'solid-js'
@@ -18,11 +18,11 @@ export const AllTopicsPage = (props: PageProps) => {
})
return (
-
+
}>
-
+
)
}
diff --git a/src/components/Pages/ArticlePage.tsx b/src/components/Pages/ArticlePage.tsx
index 00e7d661..460a7f5f 100644
--- a/src/components/Pages/ArticlePage.tsx
+++ b/src/components/Pages/ArticlePage.tsx
@@ -1,14 +1,14 @@
-import { MainLayout } from '../Layouts/MainLayout'
+import { PageWrap } from '../_shared/PageWrap'
import { ArticleView } from '../Views/Article'
import type { PageProps } from '../types'
-import { loadArticle, useArticlesStore } from '../../stores/zine/articles'
+import { loadShoutsBy, useArticlesStore } from '../../stores/zine/articles'
import { createMemo, onMount, Show } from 'solid-js'
import type { Shout } from '../../graphql/types.gen'
import { useRouter } from '../../stores/router'
import { Loading } from '../Loading'
export const ArticlePage = (props: PageProps) => {
- const sortedArticles = props.article ? [props.article] : []
+ const shouts = props.article ? [props.article] : []
const slug = createMemo(() => {
const { page: getPage } = useRouter()
@@ -23,25 +23,25 @@ export const ArticlePage = (props: PageProps) => {
})
const { articleEntities } = useArticlesStore({
- sortedArticles
+ shouts
})
const article = createMemo
(() => articleEntities()[slug()])
- onMount(() => {
+ onMount(async () => {
const articleValue = articleEntities()[slug()]
if (!articleValue || !articleValue.body) {
- loadArticle({ slug: slug() })
+ await loadShoutsBy({ by: { slug: slug() }, limit: 1, offset: 0 })
}
})
return (
-
+
}>
-
+
)
}
diff --git a/src/components/Pages/AuthorPage.tsx b/src/components/Pages/AuthorPage.tsx
index d8d73f6c..7bde9aaa 100644
--- a/src/components/Pages/AuthorPage.tsx
+++ b/src/components/Pages/AuthorPage.tsx
@@ -1,14 +1,14 @@
-import { MainLayout } from '../Layouts/MainLayout'
+import { PageWrap } from '../_shared/PageWrap'
import { AuthorView, PRERENDERED_ARTICLES_COUNT } from '../Views/Author'
import type { PageProps } from '../types'
import { createMemo, createSignal, onCleanup, onMount, Show } from 'solid-js'
-import { loadAuthorArticles, resetSortedArticles } from '../../stores/zine/articles'
+import { loadShoutsBy, resetSortedArticles } from '../../stores/zine/articles'
import { useRouter } from '../../stores/router'
import { loadAuthor } from '../../stores/zine/authors'
import { Loading } from '../Loading'
export const AuthorPage = (props: PageProps) => {
- const [isLoaded, setIsLoaded] = createSignal(Boolean(props.authorArticles) && Boolean(props.author))
+ const [isLoaded, setIsLoaded] = createSignal(Boolean(props.shouts) && Boolean(props.author))
const slug = createMemo(() => {
const { page: getPage } = useRouter()
@@ -27,7 +27,7 @@ export const AuthorPage = (props: PageProps) => {
return
}
- await loadAuthorArticles({ authorSlug: slug(), limit: PRERENDERED_ARTICLES_COUNT })
+ await loadShoutsBy({ by: { author: slug() }, limit: PRERENDERED_ARTICLES_COUNT })
await loadAuthor({ slug: slug() })
setIsLoaded(true)
@@ -36,11 +36,11 @@ export const AuthorPage = (props: PageProps) => {
onCleanup(() => resetSortedArticles())
return (
-
+
}>
-
+
-
+
)
}
diff --git a/src/components/Pages/ConnectPage.tsx b/src/components/Pages/ConnectPage.tsx
index b2a99e73..a4c4fa66 100644
--- a/src/components/Pages/ConnectPage.tsx
+++ b/src/components/Pages/ConnectPage.tsx
@@ -1,8 +1,8 @@
-import { MainLayout } from '../Layouts/MainLayout'
+import { PageWrap } from '../_shared/PageWrap'
export const ConnectPage = () => {
return (
-
+
@@ -39,7 +39,7 @@ export const ConnectPage = () => {
-
+
)
}
diff --git a/src/components/Pages/CreatePage.tsx b/src/components/Pages/CreatePage.tsx
index 3662483d..f800769e 100644
--- a/src/components/Pages/CreatePage.tsx
+++ b/src/components/Pages/CreatePage.tsx
@@ -1,16 +1,16 @@
import { lazy, Suspense } from 'solid-js'
-import { MainLayout } from '../Layouts/MainLayout'
+import { PageWrap } from '../_shared/PageWrap'
import { Loading } from '../Loading'
const CreateView = lazy(() => import('../Views/Create'))
export const CreatePage = () => {
return (
-
+
}>
-
+
)
}
diff --git a/src/components/Pages/FeedPage.tsx b/src/components/Pages/FeedPage.tsx
index 7aef8fbf..dc7dc3ac 100644
--- a/src/components/Pages/FeedPage.tsx
+++ b/src/components/Pages/FeedPage.tsx
@@ -1,4 +1,4 @@
-import { MainLayout } from '../Layouts/MainLayout'
+import { PageWrap } from '../_shared/PageWrap'
import { FeedView } from '../Views/Feed'
import { onCleanup } from 'solid-js'
import { resetSortedArticles } from '../../stores/zine/articles'
@@ -7,9 +7,9 @@ export const FeedPage = () => {
onCleanup(() => resetSortedArticles())
return (
-
+
-
+
)
}
diff --git a/src/components/Pages/FourOuFourPage.tsx b/src/components/Pages/FourOuFourPage.tsx
index 68d5cb97..86bd076a 100644
--- a/src/components/Pages/FourOuFourPage.tsx
+++ b/src/components/Pages/FourOuFourPage.tsx
@@ -1,11 +1,11 @@
import { FourOuFourView } from '../Views/FourOuFour'
-import { MainLayout } from '../Layouts/MainLayout'
+import { PageWrap } from '../_shared/PageWrap'
export const FourOuFourPage = () => {
return (
-
+
-
+
)
}
diff --git a/src/components/Pages/HomePage.tsx b/src/components/Pages/HomePage.tsx
index 77896108..1522db48 100644
--- a/src/components/Pages/HomePage.tsx
+++ b/src/components/Pages/HomePage.tsx
@@ -1,20 +1,20 @@
import { HomeView, PRERENDERED_ARTICLES_COUNT } from '../Views/Home'
-import { MainLayout } from '../Layouts/MainLayout'
+import { PageWrap } from '../_shared/PageWrap'
import type { PageProps } from '../types'
import { createSignal, onCleanup, onMount, Show } from 'solid-js'
-import { loadPublishedArticles, resetSortedArticles } from '../../stores/zine/articles'
+import { loadShoutsBy, resetSortedArticles } from '../../stores/zine/articles'
import { loadRandomTopics } from '../../stores/zine/topics'
import { Loading } from '../Loading'
-import { InboxView } from '../Views/Inbox'
+
export const HomePage = (props: PageProps) => {
- const [isLoaded, setIsLoaded] = createSignal(Boolean(props.homeArticles) && Boolean(props.randomTopics))
+ const [isLoaded, setIsLoaded] = createSignal(Boolean(props.shouts) && Boolean(props.randomTopics))
onMount(async () => {
if (isLoaded()) {
return
}
- await loadPublishedArticles({ limit: PRERENDERED_ARTICLES_COUNT, offset: 0 })
+ await loadShoutsBy({ by: { visibility: 'public' }, limit: PRERENDERED_ARTICLES_COUNT, offset: 0 })
await loadRandomTopics()
setIsLoaded(true)
@@ -23,12 +23,11 @@ export const HomePage = (props: PageProps) => {
onCleanup(() => resetSortedArticles())
return (
-
+
}>
-
-
+
-
+
)
}
diff --git a/src/components/Pages/LayoutShoutsPage.tsx b/src/components/Pages/LayoutShoutsPage.tsx
new file mode 100644
index 00000000..84052e2c
--- /dev/null
+++ b/src/components/Pages/LayoutShoutsPage.tsx
@@ -0,0 +1,148 @@
+import { PageWrap } from '../_shared/PageWrap'
+import type { PageProps } from '../types'
+import { createMemo, createSignal, For, onCleanup, onMount, Show } from 'solid-js'
+import { loadShoutsBy, resetSortedArticles } from '../../stores/zine/articles'
+import { useRouter } from '../../stores/router'
+import { LayoutType, useLayoutsStore } from '../../stores/zine/layouts'
+import { Loading } from '../Loading'
+import { restoreScrollPosition, saveScrollPosition } from '../../utils/scroll'
+import type { Shout } from '../../graphql/types.gen'
+import { splitToPages } from '../../utils/splitToPages'
+import clsx from 'clsx'
+import { t } from '../../utils/intl'
+import { Row3 } from '../Feed/Row3'
+import { Row2 } from '../Feed/Row2'
+import { Beside } from '../Feed/Beside'
+import Slider from '../Feed/Slider'
+import { Row1 } from '../Feed/Row1'
+import styles from '../../styles/Topic.module.scss'
+
+export const PRERENDERED_ARTICLES_COUNT = 21
+const LOAD_MORE_PAGE_SIZE = 9 // Row3 + Row3 + Row3
+
+export const LayoutShoutsPage = (props: PageProps) => {
+ const layout = createMemo(() => {
+ const { page: getPage } = useRouter()
+ const page = getPage()
+ if (page.route !== 'expo') throw new Error('ts guard')
+ return page.params.layout as LayoutType
+ })
+ const [isLoadMoreButtonVisible, setIsLoadMoreButtonVisible] = createSignal(false)
+ const { sortedLayoutShouts, loadLayoutShoutsBy } = useLayoutsStore(layout(), props.shouts)
+ const sortedArticles = createMemo(() => sortedLayoutShouts().get(layout()) || [])
+ const loadMoreLayout = async (kind: LayoutType) => {
+ saveScrollPosition()
+ const { hasMore } = await loadLayoutShoutsBy({
+ by: { layout: kind },
+ limit: LOAD_MORE_PAGE_SIZE,
+ offset: sortedArticles().length
+ })
+ setIsLoadMoreButtonVisible(hasMore)
+ restoreScrollPosition()
+ }
+
+ onMount(async () => {
+ if (sortedArticles().length === PRERENDERED_ARTICLES_COUNT) {
+ loadMoreLayout(layout())
+ }
+ })
+
+ const title = createMemo(() => {
+ const l = layout()
+ if (l === 'audio') return t('Audio')
+ if (l === 'video') return t('Video')
+ if (l === 'image') return t('Artworks')
+ return t('Literature')
+ })
+
+ const pages = createMemo(() =>
+ splitToPages(sortedArticles(), PRERENDERED_ARTICLES_COUNT, LOAD_MORE_PAGE_SIZE)
+ )
+ const isLoaded = createMemo(() => Boolean(sortedArticles()))
+
+ onMount(async () => {
+ if (!isLoaded()) {
+ await loadShoutsBy({ by: { layout: layout() }, limit: PRERENDERED_ARTICLES_COUNT, offset: 0 })
+ }
+ })
+
+ onCleanup(() => resetSortedArticles())
+
+ const ModeSwitcher = () => (
+
+
+
+
+
+ {`${t('Show')} `}
+ {t('All posts')}
+
+
+
+
+ )
+ return (
+
+ }>
+
+
+ {title()}
+
+
+
+
+
+ 5}>
+
+
+
+
+
+
+
+
+ {(page) => (
+ <>
+
+
+
+ >
+ )}
+
+
+
+
+
+
+
+
+
+
+
+ )
+}
+
+// for lazy loading
+export default LayoutShoutsPage
diff --git a/src/components/Pages/SearchPage.tsx b/src/components/Pages/SearchPage.tsx
index 9ce346b1..aabf7214 100644
--- a/src/components/Pages/SearchPage.tsx
+++ b/src/components/Pages/SearchPage.tsx
@@ -1,8 +1,8 @@
-import { MainLayout } from '../Layouts/MainLayout'
+import { PageWrap } from '../_shared/PageWrap'
import { SearchView } from '../Views/Search'
import type { PageProps } from '../types'
import { createMemo, createSignal, onCleanup, onMount, Show } from 'solid-js'
-import { loadSearchResults, resetSortedArticles } from '../../stores/zine/articles'
+import { loadShoutsBy, resetSortedArticles } from '../../stores/zine/articles'
import { useRouter } from '../../stores/router'
import { Loading } from '../Loading'
@@ -26,18 +26,18 @@ export const SearchPage = (props: PageProps) => {
return
}
- await loadSearchResults({ query: q(), limit: 50, offset: 0 })
+ await loadShoutsBy({ by: { title: q(), body: q() }, limit: 50, offset: 0 })
setIsLoaded(true)
})
onCleanup(() => resetSortedArticles())
return (
-
+
}>
-
+
)
}
diff --git a/src/components/Pages/TopicPage.tsx b/src/components/Pages/TopicPage.tsx
index 35a94c92..fc314cd7 100644
--- a/src/components/Pages/TopicPage.tsx
+++ b/src/components/Pages/TopicPage.tsx
@@ -1,14 +1,14 @@
-import { MainLayout } from '../Layouts/MainLayout'
+import { PageWrap } from '../_shared/PageWrap'
import { PRERENDERED_ARTICLES_COUNT, TopicView } from '../Views/Topic'
import type { PageProps } from '../types'
import { createMemo, createSignal, onCleanup, onMount, Show } from 'solid-js'
-import { loadTopicArticles, resetSortedArticles } from '../../stores/zine/articles'
+import { loadShoutsBy, resetSortedArticles } from '../../stores/zine/articles'
import { useRouter } from '../../stores/router'
import { loadTopic } from '../../stores/zine/topics'
import { Loading } from '../Loading'
export const TopicPage = (props: PageProps) => {
- const [isLoaded, setIsLoaded] = createSignal(Boolean(props.topicArticles) && Boolean(props.topic))
+ const [isLoaded, setIsLoaded] = createSignal(Boolean(props.shouts) && Boolean(props.topic))
const slug = createMemo(() => {
const { page: getPage } = useRouter()
@@ -27,7 +27,7 @@ export const TopicPage = (props: PageProps) => {
return
}
- await loadTopicArticles({ topicSlug: slug(), limit: PRERENDERED_ARTICLES_COUNT, offset: 0 })
+ await loadShoutsBy({ by: { topics: [slug()] }, limit: PRERENDERED_ARTICLES_COUNT, offset: 0 })
await loadTopic({ slug: slug() })
setIsLoaded(true)
@@ -36,11 +36,11 @@ export const TopicPage = (props: PageProps) => {
onCleanup(() => resetSortedArticles())
return (
-
+
}>
-
+
-
+
)
}
diff --git a/src/components/Pages/about/DiscussionRulesPage.tsx b/src/components/Pages/about/DiscussionRulesPage.tsx
index 11ee4565..935639bc 100644
--- a/src/components/Pages/about/DiscussionRulesPage.tsx
+++ b/src/components/Pages/about/DiscussionRulesPage.tsx
@@ -1,10 +1,10 @@
-import { MainLayout } from '../../Layouts/MainLayout'
+import { PageWrap } from '../../_shared/PageWrap'
import { t } from '../../../utils/intl'
export const DiscussionRulesPage = () => {
const title = t('Discussion rules')
return (
-
+
@@ -114,7 +114,7 @@ export const DiscussionRulesPage = () => {
-
+
)
}
diff --git a/src/components/Pages/about/DogmaPage.tsx b/src/components/Pages/about/DogmaPage.tsx
index 1407c73d..1dcba449 100644
--- a/src/components/Pages/about/DogmaPage.tsx
+++ b/src/components/Pages/about/DogmaPage.tsx
@@ -1,10 +1,10 @@
-import { MainLayout } from '../../Layouts/MainLayout'
+import { PageWrap } from '../../_shared/PageWrap'
// const title = t('Dogma')
export const DogmaPage = () => {
return (
-
+
@@ -53,7 +53,7 @@ export const DogmaPage = () => {
-
+
)
}
diff --git a/src/components/Pages/about/GuidePage.tsx b/src/components/Pages/about/GuidePage.tsx
index b1158c60..17213e64 100644
--- a/src/components/Pages/about/GuidePage.tsx
+++ b/src/components/Pages/about/GuidePage.tsx
@@ -1,7 +1,7 @@
import { createSignal, Show } from 'solid-js'
-import { MainLayout } from '../../Layouts/MainLayout'
+import { PageWrap } from '../../_shared/PageWrap'
import { t } from '../../../utils/intl'
-import { Icon } from '../../Nav/Icon'
+import { Icon } from '../../_shared/Icon'
export const GuidePage = () => {
const title = t('How it works')
@@ -11,7 +11,7 @@ export const GuidePage = () => {
const toggleIndexExpanded = () => setIndexExpanded((oldExpanded) => !oldExpanded)
return (
-
+
{/**/}
{/**/}
{/**/}
@@ -283,7 +283,7 @@ export const GuidePage = () => {