From 6c4f89597f437e01e2984a73fd7b1ce89ee131c9 Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Sun, 13 Nov 2022 06:40:37 +0300 Subject: [PATCH] layout term minimum usage, some refactorings --- CHANGELOG.txt | 3 ++- src/components/Pages/AllAuthorsPage.tsx | 6 +++--- src/components/Pages/AllTopicsPage.tsx | 6 +++--- src/components/Pages/ArticlePage.tsx | 6 +++--- src/components/Pages/AuthorPage.tsx | 10 +++++----- src/components/Pages/ConnectPage.tsx | 6 +++--- src/components/Pages/CreatePage.tsx | 6 +++--- src/components/Pages/FeedPage.tsx | 6 +++--- src/components/Pages/FourOuFourPage.tsx | 6 +++--- src/components/Pages/HomePage.tsx | 10 +++++----- src/components/Pages/LayoutShoutsPage.tsx | 6 +++--- src/components/Pages/SearchPage.tsx | 6 +++--- src/components/Pages/TopicPage.tsx | 10 +++++----- src/components/Pages/about/DiscussionRulesPage.tsx | 6 +++--- src/components/Pages/about/DogmaPage.tsx | 6 +++--- src/components/Pages/about/GuidePage.tsx | 6 +++--- src/components/Pages/about/HelpPage.tsx | 6 +++--- src/components/Pages/about/ManifestPage.tsx | 6 +++--- src/components/Pages/about/PartnersPage.tsx | 6 +++--- src/components/Pages/about/PrinciplesPage.tsx | 6 +++--- src/components/Pages/about/ProjectsPage.tsx | 6 +++--- src/components/Pages/about/TermsOfUsePage.tsx | 6 +++--- src/components/Pages/about/ThanksPage.tsx | 6 +++--- src/components/Views/LayoutView.tsx | 8 ++++---- .../{Wrap/MainWrap.tsx => Wraps/PageWrap.tsx} | 4 ++-- src/{layouts/zine.astro => main.astro} | 8 +++++--- src/pages/404.astro | 2 +- src/pages/[...slug].astro | 2 +- src/pages/about/discussion-rules.astro | 2 +- src/pages/about/dogma.astro | 2 +- src/pages/about/guide.astro | 2 +- src/pages/about/help.astro | 2 +- src/pages/about/manifest.astro | 2 +- src/pages/about/partners.astro | 2 +- src/pages/about/principles.astro | 2 +- src/pages/about/projects.astro | 2 +- src/pages/about/terms-of-use.astro | 2 +- src/pages/about/thanks.astro | 2 +- src/pages/author/[slug]/index.astro | 8 ++++---- src/pages/authors.astro | 2 +- src/pages/connect.astro | 2 +- src/pages/create.astro | 2 +- src/pages/{layout => expo}/[...layout].astro | 2 +- src/pages/feed/index.astro | 2 +- src/pages/feed/settings.astro.bak | 2 +- src/pages/inbox.astro | 2 +- src/pages/index.astro | 4 ++-- src/pages/search.astro | 2 +- src/pages/topic/[slug].astro | 8 ++++---- src/pages/topics.astro | 2 +- 50 files changed, 116 insertions(+), 113 deletions(-) rename src/components/{Wrap/MainWrap.tsx => Wraps/PageWrap.tsx} (90%) rename src/{layouts/zine.astro => main.astro} (72%) rename src/pages/{layout => expo}/[...layout].astro (93%) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 3b42f1a1..f6574694 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,7 @@ [0.6.0] [+] hybrid routing ssr/spa -[+] layout pages +[+] 'expo' pages +[-] layout term usage with an exception [-] nanostores [+] inbox [+] css modules diff --git a/src/components/Pages/AllAuthorsPage.tsx b/src/components/Pages/AllAuthorsPage.tsx index 3978e95e..16c710d3 100644 --- a/src/components/Pages/AllAuthorsPage.tsx +++ b/src/components/Pages/AllAuthorsPage.tsx @@ -1,4 +1,4 @@ -import { MainWrap } from '../Wrap/MainWrap' +import { PageWrap } from '../Wraps/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 96889617..d188771a 100644 --- a/src/components/Pages/AllTopicsPage.tsx +++ b/src/components/Pages/AllTopicsPage.tsx @@ -1,4 +1,4 @@ -import { MainWrap } from '../Wrap/MainWrap' +import { PageWrap } from '../Wraps/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 974d27c8..4a465b03 100644 --- a/src/components/Pages/ArticlePage.tsx +++ b/src/components/Pages/ArticlePage.tsx @@ -1,4 +1,4 @@ -import { MainWrap } from '../Wrap/MainWrap' +import { PageWrap } from '../Wraps/PageWrap' import { ArticleView } from '../Views/Article' import type { PageProps } from '../types' import { loadArticle, useArticlesStore } from '../../stores/zine/articles' @@ -37,11 +37,11 @@ export const ArticlePage = (props: PageProps) => { }) return ( - + }> - + ) } diff --git a/src/components/Pages/AuthorPage.tsx b/src/components/Pages/AuthorPage.tsx index d3d3c9b6..467add97 100644 --- a/src/components/Pages/AuthorPage.tsx +++ b/src/components/Pages/AuthorPage.tsx @@ -1,4 +1,4 @@ -import { MainWrap } from '../Wrap/MainWrap' +import { PageWrap } from '../Wraps/PageWrap' import { AuthorView, PRERENDERED_ARTICLES_COUNT } from '../Views/Author' import type { PageProps } from '../types' import { createMemo, createSignal, onCleanup, onMount, Show } from 'solid-js' @@ -8,7 +8,7 @@ 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() @@ -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 1ee0913b..ed722e12 100644 --- a/src/components/Pages/ConnectPage.tsx +++ b/src/components/Pages/ConnectPage.tsx @@ -1,8 +1,8 @@ -import { MainWrap } from '../Wrap/MainWrap' +import { PageWrap } from '../Wraps/PageWrap' export const ConnectPage = () => { return ( - +

@@ -38,7 +38,7 @@ export const ConnectPage = () => {

-
+ ) } diff --git a/src/components/Pages/CreatePage.tsx b/src/components/Pages/CreatePage.tsx index 8f7ea417..60fa4255 100644 --- a/src/components/Pages/CreatePage.tsx +++ b/src/components/Pages/CreatePage.tsx @@ -1,16 +1,16 @@ import { lazy, Suspense } from 'solid-js' -import { MainWrap } from '../Wrap/MainWrap' +import { PageWrap } from '../Wraps/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 9ec5f9d2..8067859e 100644 --- a/src/components/Pages/FeedPage.tsx +++ b/src/components/Pages/FeedPage.tsx @@ -1,4 +1,4 @@ -import { MainWrap } from '../Wrap/MainWrap' +import { PageWrap } from '../Wraps/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 2848cadf..31137f13 100644 --- a/src/components/Pages/FourOuFourPage.tsx +++ b/src/components/Pages/FourOuFourPage.tsx @@ -1,11 +1,11 @@ import { FourOuFourView } from '../Views/FourOuFour' -import { MainWrap } from '../Wrap/MainWrap' +import { PageWrap } from '../Wraps/PageWrap' export const FourOuFourPage = () => { return ( - + - + ) } diff --git a/src/components/Pages/HomePage.tsx b/src/components/Pages/HomePage.tsx index ec1cb842..04cb93d0 100644 --- a/src/components/Pages/HomePage.tsx +++ b/src/components/Pages/HomePage.tsx @@ -1,5 +1,5 @@ import { HomeView, PRERENDERED_ARTICLES_COUNT } from '../Views/Home' -import { MainWrap } from '../Wrap/MainWrap' +import { PageWrap } from '../Wraps/PageWrap' import type { PageProps } from '../types' import { createSignal, onCleanup, onMount, Show } from 'solid-js' import { loadPublishedArticles, resetSortedArticles } from '../../stores/zine/articles' @@ -7,7 +7,7 @@ import { loadRandomTopics } from '../../stores/zine/topics' import { Loading } from '../Loading' 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()) { @@ -23,11 +23,11 @@ export const HomePage = (props: PageProps) => { onCleanup(() => resetSortedArticles()) return ( - + }> - + - + ) } diff --git a/src/components/Pages/LayoutShoutsPage.tsx b/src/components/Pages/LayoutShoutsPage.tsx index c6b905ca..a8566c3d 100644 --- a/src/components/Pages/LayoutShoutsPage.tsx +++ b/src/components/Pages/LayoutShoutsPage.tsx @@ -1,4 +1,4 @@ -import { MainWrap } from '../Wrap/MainWrap' +import { PageWrap } from '../Wraps/PageWrap' import { LayoutView } from '../Views/LayoutView' import type { PageProps } from '../types' import { createMemo, createSignal, onCleanup, onMount, Show } from 'solid-js' @@ -37,11 +37,11 @@ export const LayoutShoutsPage = (props: PageProps) => { onCleanup(() => resetSortedArticles()) return ( - + }> - + ) } diff --git a/src/components/Pages/SearchPage.tsx b/src/components/Pages/SearchPage.tsx index 204ca05e..497d109c 100644 --- a/src/components/Pages/SearchPage.tsx +++ b/src/components/Pages/SearchPage.tsx @@ -1,4 +1,4 @@ -import { MainWrap } from '../Wrap/MainWrap' +import { PageWrap } from '../Wraps/PageWrap' import { SearchView } from '../Views/Search' import type { PageProps } from '../types' import { createMemo, createSignal, onCleanup, onMount, Show } from 'solid-js' @@ -33,11 +33,11 @@ export const SearchPage = (props: PageProps) => { onCleanup(() => resetSortedArticles()) return ( - + }> - + ) } diff --git a/src/components/Pages/TopicPage.tsx b/src/components/Pages/TopicPage.tsx index 4cf60a28..ad4fdc1f 100644 --- a/src/components/Pages/TopicPage.tsx +++ b/src/components/Pages/TopicPage.tsx @@ -1,4 +1,4 @@ -import { MainWrap } from '../Wrap/MainWrap' +import { PageWrap } from '../Wraps/PageWrap' import { PRERENDERED_ARTICLES_COUNT, TopicView } from '../Views/Topic' import type { PageProps } from '../types' import { createMemo, createSignal, onCleanup, onMount, Show } from 'solid-js' @@ -8,7 +8,7 @@ import { loadTopic } from '../../stores/zine/topics' import { Loading } from '../Loading' export const TopicPage = (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() @@ -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 eb70490e..735c2389 100644 --- a/src/components/Pages/about/DiscussionRulesPage.tsx +++ b/src/components/Pages/about/DiscussionRulesPage.tsx @@ -1,10 +1,10 @@ -import { MainWrap } from '../../Wrap/MainWrap' +import { PageWrap } from '../../Wraps/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 b4dcea1f..ff43de62 100644 --- a/src/components/Pages/about/DogmaPage.tsx +++ b/src/components/Pages/about/DogmaPage.tsx @@ -1,10 +1,10 @@ -import { MainWrap } from '../../Wrap/MainWrap' +import { PageWrap } from '../../Wraps/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 b9ba2837..99ace509 100644 --- a/src/components/Pages/about/GuidePage.tsx +++ b/src/components/Pages/about/GuidePage.tsx @@ -1,5 +1,5 @@ import { createSignal, Show } from 'solid-js' -import { MainWrap } from '../../Wrap/MainWrap' +import { PageWrap } from '../../Wraps/PageWrap' import { t } from '../../../utils/intl' import { Icon } from '../../Nav/Icon' @@ -11,7 +11,7 @@ export const GuidePage = () => { const toggleIndexExpanded = () => setIndexExpanded((oldExpanded) => !oldExpanded) return ( - + {/**/} {/**/} {/**/} @@ -283,7 +283,7 @@ export const GuidePage = () => { - + ) } diff --git a/src/components/Pages/about/HelpPage.tsx b/src/components/Pages/about/HelpPage.tsx index a327b837..5b725b1f 100644 --- a/src/components/Pages/about/HelpPage.tsx +++ b/src/components/Pages/about/HelpPage.tsx @@ -1,5 +1,5 @@ import { createSignal, Show } from 'solid-js' -import { MainWrap } from '../../Wrap/MainWrap' +import { PageWrap } from '../../Wraps/PageWrap' import { Donate } from '../../Discours/Donate' import { Icon } from '../../Nav/Icon' @@ -11,7 +11,7 @@ export const HelpPage = () => { const toggleIndexExpanded = () => setIndexExpanded((oldExpanded) => !oldExpanded) return ( - + {/*Здесь можно поддержать Дискурс материально.*/} {/*Discours.io, помощь, благотворительность*/} @@ -161,7 +161,7 @@ export const HelpPage = () => { - + ) } diff --git a/src/components/Pages/about/ManifestPage.tsx b/src/components/Pages/about/ManifestPage.tsx index c221762a..32b48ec0 100644 --- a/src/components/Pages/about/ManifestPage.tsx +++ b/src/components/Pages/about/ManifestPage.tsx @@ -1,5 +1,5 @@ import { createSignal, Show } from 'solid-js' -import { MainWrap } from '../../Wrap/MainWrap' +import { PageWrap } from '../../Wraps/PageWrap' import { Modal } from '../../Nav/Modal' import { Feedback } from '../../Discours/Feedback' import Subscribe from '../../Discours/Subscribe' @@ -14,7 +14,7 @@ export const ManifestPage = () => { const toggleIndexExpanded = () => setIndexExpanded((oldExpanded) => !oldExpanded) return ( - + @@ -191,7 +191,7 @@ export const ManifestPage = () => { - + ) } diff --git a/src/components/Pages/about/PartnersPage.tsx b/src/components/Pages/about/PartnersPage.tsx index c30a7fec..35a2ab29 100644 --- a/src/components/Pages/about/PartnersPage.tsx +++ b/src/components/Pages/about/PartnersPage.tsx @@ -1,11 +1,11 @@ -import { MainWrap } from '../../Wrap/MainWrap' +import { PageWrap } from '../../Wraps/PageWrap' import { t } from '../../../utils/intl' // const title = t('Partners') export const PartnersPage = () => { return ( - +
@@ -13,7 +13,7 @@ export const PartnersPage = () => {
-
+ ) } diff --git a/src/components/Pages/about/PrinciplesPage.tsx b/src/components/Pages/about/PrinciplesPage.tsx index 717539f3..60abeae6 100644 --- a/src/components/Pages/about/PrinciplesPage.tsx +++ b/src/components/Pages/about/PrinciplesPage.tsx @@ -1,10 +1,10 @@ -import { MainWrap } from '../../Wrap/MainWrap' +import { PageWrap } from '../../Wraps/PageWrap' import { t } from '../../../utils/intl' export const PrinciplesPage = () => { const title = t('Principles') return ( - +
@@ -172,7 +172,7 @@ export const PrinciplesPage = () => {
-
+ ) } diff --git a/src/components/Pages/about/ProjectsPage.tsx b/src/components/Pages/about/ProjectsPage.tsx index 114ffd0d..f051d55d 100644 --- a/src/components/Pages/about/ProjectsPage.tsx +++ b/src/components/Pages/about/ProjectsPage.tsx @@ -1,11 +1,11 @@ -import { MainWrap } from '../../Wrap/MainWrap' +import { PageWrap } from '../../Wraps/PageWrap' import { t } from '../../../utils/intl' // title={t('Projects')}> export const ProjectsPage = () => { return ( - +
@@ -13,7 +13,7 @@ export const ProjectsPage = () => {
-
+ ) } diff --git a/src/components/Pages/about/TermsOfUsePage.tsx b/src/components/Pages/about/TermsOfUsePage.tsx index 31e1e930..6f395bad 100644 --- a/src/components/Pages/about/TermsOfUsePage.tsx +++ b/src/components/Pages/about/TermsOfUsePage.tsx @@ -1,5 +1,5 @@ import { createSignal, Show } from 'solid-js' -import { MainWrap } from '../../Wrap/MainWrap' +import { PageWrap } from '../../Wraps/PageWrap' import { Icon } from '../../Nav/Icon' // const title = t('Terms of use') @@ -10,7 +10,7 @@ export const TermsOfUsePage = () => { const toggleIndexExpanded = () => setIndexExpanded((oldExpanded) => !oldExpanded) return ( - + {/**/} {/**/} {/**/} @@ -274,7 +274,7 @@ export const TermsOfUsePage = () => { - + ) } diff --git a/src/components/Pages/about/ThanksPage.tsx b/src/components/Pages/about/ThanksPage.tsx index 8aecb632..e1998c70 100644 --- a/src/components/Pages/about/ThanksPage.tsx +++ b/src/components/Pages/about/ThanksPage.tsx @@ -1,10 +1,10 @@ -import { MainWrap } from '../../Wrap/MainWrap' +import { PageWrap } from '../../Wraps/PageWrap' import { t } from '../../../utils/intl' export const ThanksPage = () => { const title = t('Thank you') return ( - + {/**/} {/**/} {/**/} @@ -85,7 +85,7 @@ export const ThanksPage = () => { - + ) } diff --git a/src/components/Views/LayoutView.tsx b/src/components/Views/LayoutView.tsx index a3db9f99..d7b7a2ac 100644 --- a/src/components/Views/LayoutView.tsx +++ b/src/components/Views/LayoutView.tsx @@ -71,16 +71,16 @@ export const LayoutView = (props: LayoutProps) => {
diff --git a/src/components/Wrap/MainWrap.tsx b/src/components/Wraps/PageWrap.tsx similarity index 90% rename from src/components/Wrap/MainWrap.tsx rename to src/components/Wraps/PageWrap.tsx index 46138afe..6d68e512 100644 --- a/src/components/Wrap/MainWrap.tsx +++ b/src/components/Wraps/PageWrap.tsx @@ -5,14 +5,14 @@ import { Footer } from '../Discours/Footer' import '../../styles/app.scss' import { Show } from 'solid-js' -type MainWrapProps = { +type PageWrapProps = { headerTitle?: string children: JSX.Element isHeaderFixed?: boolean hideFooter?: boolean } -export const MainWrap = (props: MainWrapProps) => { +export const PageWrap = (props: PageWrapProps) => { const isHeaderFixed = props.isHeaderFixed !== undefined ? props.isHeaderFixed : true return ( diff --git a/src/layouts/zine.astro b/src/main.astro similarity index 72% rename from src/layouts/zine.astro rename to src/main.astro index 41be19e4..a39f8e4f 100644 --- a/src/layouts/zine.astro +++ b/src/main.astro @@ -1,7 +1,9 @@ --- -import { setLocale } from '../stores/ui'; -import '../styles/app.scss' -import { t } from '../utils/intl' +import { setLocale } from './stores/ui'; +import './styles/app.scss' +import { t } from './utils/intl' + +// Setting locale for prerendered content here const lang = Astro.url.searchParams.get('lang') || 'ru' console.log('[layout] server locale is', lang) diff --git a/src/pages/404.astro b/src/pages/404.astro index e1a8d16a..06d1839a 100644 --- a/src/pages/404.astro +++ b/src/pages/404.astro @@ -1,5 +1,5 @@ --- -import Zine from '../layouts/zine.astro' +import Zine from '../main.astro' import { Root } from '../components/Root' import { initRouter } from '../stores/router' diff --git a/src/pages/[...slug].astro b/src/pages/[...slug].astro index 9ca1dbfd..d757e077 100644 --- a/src/pages/[...slug].astro +++ b/src/pages/[...slug].astro @@ -1,6 +1,6 @@ --- import { Root } from '../components/Root' -import Zine from '../layouts/zine.astro' +import Zine from '../main.astro' import { apiClient } from '../utils/apiClient' import { initRouter } from '../stores/router' diff --git a/src/pages/about/discussion-rules.astro b/src/pages/about/discussion-rules.astro index d41f44f0..19521c3e 100644 --- a/src/pages/about/discussion-rules.astro +++ b/src/pages/about/discussion-rules.astro @@ -1,5 +1,5 @@ --- -import Zine from '../../layouts/zine.astro' +import Zine from '../../main.astro' import { Root } from '../../components/Root' import { initRouter } from '../../stores/router' diff --git a/src/pages/about/dogma.astro b/src/pages/about/dogma.astro index d41f44f0..19521c3e 100644 --- a/src/pages/about/dogma.astro +++ b/src/pages/about/dogma.astro @@ -1,5 +1,5 @@ --- -import Zine from '../../layouts/zine.astro' +import Zine from '../../main.astro' import { Root } from '../../components/Root' import { initRouter } from '../../stores/router' diff --git a/src/pages/about/guide.astro b/src/pages/about/guide.astro index d41f44f0..19521c3e 100644 --- a/src/pages/about/guide.astro +++ b/src/pages/about/guide.astro @@ -1,5 +1,5 @@ --- -import Zine from '../../layouts/zine.astro' +import Zine from '../../main.astro' import { Root } from '../../components/Root' import { initRouter } from '../../stores/router' diff --git a/src/pages/about/help.astro b/src/pages/about/help.astro index ed7f0104..60a199ec 100644 --- a/src/pages/about/help.astro +++ b/src/pages/about/help.astro @@ -1,5 +1,5 @@ --- -import Zine from '../../layouts/zine.astro' +import Zine from '../../main.astro' import { Root } from '../../components/Root' import { initRouter } from '../../stores/router' diff --git a/src/pages/about/manifest.astro b/src/pages/about/manifest.astro index d41f44f0..19521c3e 100644 --- a/src/pages/about/manifest.astro +++ b/src/pages/about/manifest.astro @@ -1,5 +1,5 @@ --- -import Zine from '../../layouts/zine.astro' +import Zine from '../../main.astro' import { Root } from '../../components/Root' import { initRouter } from '../../stores/router' diff --git a/src/pages/about/partners.astro b/src/pages/about/partners.astro index d41f44f0..19521c3e 100644 --- a/src/pages/about/partners.astro +++ b/src/pages/about/partners.astro @@ -1,5 +1,5 @@ --- -import Zine from '../../layouts/zine.astro' +import Zine from '../../main.astro' import { Root } from '../../components/Root' import { initRouter } from '../../stores/router' diff --git a/src/pages/about/principles.astro b/src/pages/about/principles.astro index d41f44f0..19521c3e 100644 --- a/src/pages/about/principles.astro +++ b/src/pages/about/principles.astro @@ -1,5 +1,5 @@ --- -import Zine from '../../layouts/zine.astro' +import Zine from '../../main.astro' import { Root } from '../../components/Root' import { initRouter } from '../../stores/router' diff --git a/src/pages/about/projects.astro b/src/pages/about/projects.astro index d41f44f0..19521c3e 100644 --- a/src/pages/about/projects.astro +++ b/src/pages/about/projects.astro @@ -1,5 +1,5 @@ --- -import Zine from '../../layouts/zine.astro' +import Zine from '../../main.astro' import { Root } from '../../components/Root' import { initRouter } from '../../stores/router' diff --git a/src/pages/about/terms-of-use.astro b/src/pages/about/terms-of-use.astro index d41f44f0..19521c3e 100644 --- a/src/pages/about/terms-of-use.astro +++ b/src/pages/about/terms-of-use.astro @@ -1,5 +1,5 @@ --- -import Zine from '../../layouts/zine.astro' +import Zine from '../../main.astro' import { Root } from '../../components/Root' import { initRouter } from '../../stores/router' diff --git a/src/pages/about/thanks.astro b/src/pages/about/thanks.astro index d41f44f0..19521c3e 100644 --- a/src/pages/about/thanks.astro +++ b/src/pages/about/thanks.astro @@ -1,5 +1,5 @@ --- -import Zine from '../../layouts/zine.astro' +import Zine from '../../main.astro' import { Root } from '../../components/Root' import { initRouter } from '../../stores/router' diff --git a/src/pages/author/[slug]/index.astro b/src/pages/author/[slug]/index.astro index 50e29aa4..d38cba66 100644 --- a/src/pages/author/[slug]/index.astro +++ b/src/pages/author/[slug]/index.astro @@ -1,13 +1,13 @@ --- import { Root } from '../../../components/Root' -import Zine from '../../../layouts/zine.astro' +import Zine from '../../../main.astro' import { apiClient } from '../../../utils/apiClient' import { initRouter } from '../../../stores/router' import { PRERENDERED_ARTICLES_COUNT } from '../../../components/Views/Author' const slug = Astro.params.slug.toString() -const articles = await apiClient.getArticlesForAuthors({ authorSlugs: [slug], limit: PRERENDERED_ARTICLES_COUNT }) -const author = articles[0].authors.find((a) => a.slug === slug) +const shouts = await apiClient.getArticlesForAuthors({ authorSlugs: [slug], limit: PRERENDERED_ARTICLES_COUNT }) +const author = shouts[0].authors.find((a) => a.slug === slug) const { pathname, search } = Astro.url initRouter(pathname, search) @@ -16,5 +16,5 @@ Astro.response.headers.set('Cache-Control', 's-maxage=1, stale-while-revalidate' --- - + diff --git a/src/pages/authors.astro b/src/pages/authors.astro index 2b5b1176..edf5a128 100644 --- a/src/pages/authors.astro +++ b/src/pages/authors.astro @@ -1,6 +1,6 @@ --- import { Root } from '../components/Root' -import Zine from '../layouts/zine.astro' +import Zine from '../main.astro' import { apiClient } from '../utils/apiClient' import { initRouter } from '../stores/router' diff --git a/src/pages/connect.astro b/src/pages/connect.astro index e1a8d16a..06d1839a 100644 --- a/src/pages/connect.astro +++ b/src/pages/connect.astro @@ -1,5 +1,5 @@ --- -import Zine from '../layouts/zine.astro' +import Zine from '../main.astro' import { Root } from '../components/Root' import { initRouter } from '../stores/router' diff --git a/src/pages/create.astro b/src/pages/create.astro index defdaefe..f77ecc20 100644 --- a/src/pages/create.astro +++ b/src/pages/create.astro @@ -1,6 +1,6 @@ --- import { Root } from '../components/Root' -import Zine from '../layouts/zine.astro' +import Zine from '../main.astro' import { initRouter } from '../stores/router' const { pathname, search } = Astro.url diff --git a/src/pages/layout/[...layout].astro b/src/pages/expo/[...layout].astro similarity index 93% rename from src/pages/layout/[...layout].astro rename to src/pages/expo/[...layout].astro index 555ff131..5b515ce7 100644 --- a/src/pages/layout/[...layout].astro +++ b/src/pages/expo/[...layout].astro @@ -1,6 +1,6 @@ --- import { Root } from '../../components/Root' -import Zine from '../../layouts/zine.astro' +import Zine from '../../main.astro' import { apiClient } from '../../utils/apiClient' import { initRouter } from '../../stores/router' diff --git a/src/pages/feed/index.astro b/src/pages/feed/index.astro index e9063068..139a36eb 100644 --- a/src/pages/feed/index.astro +++ b/src/pages/feed/index.astro @@ -1,6 +1,6 @@ --- import { Root } from '../../components/Root' -import Zine from '../../layouts/zine.astro' +import Zine from '../../main.astro' import { initRouter } from '../../stores/router' const { pathname, search } = Astro.url diff --git a/src/pages/feed/settings.astro.bak b/src/pages/feed/settings.astro.bak index 11bef960..98b18912 100644 --- a/src/pages/feed/settings.astro.bak +++ b/src/pages/feed/settings.astro.bak @@ -1,5 +1,5 @@ --- -import Zine from '../../layouts/zine.astro' +import Zine from '../../main.astro' import { FeedSettings } from '../../components/Views/FeedSettings' import { initRouter } from '../../stores/router' diff --git a/src/pages/inbox.astro b/src/pages/inbox.astro index 8e7abf67..fd139a17 100644 --- a/src/pages/inbox.astro +++ b/src/pages/inbox.astro @@ -1,5 +1,5 @@ --- -import Zine from '../layouts/zine.astro' +import Zine from '../main.astro' import { Root } from '../components/Root' import { apiClient } from '../utils/apiClient' import { initRouter } from '../stores/router' diff --git a/src/pages/index.astro b/src/pages/index.astro index 9bbde9a4..8ebb57cd 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,5 +1,5 @@ --- -import Zine from '../layouts/zine.astro' +import Zine from '../main.astro' import { Root } from '../components/Root' import { apiClient } from '../utils/apiClient' import { initRouter } from '../stores/router' @@ -15,6 +15,6 @@ Astro.response.headers.set('Cache-Control', 's-maxage=1, stale-while-revalidate' --- - + diff --git a/src/pages/search.astro b/src/pages/search.astro index 7de5f5a7..b9379170 100644 --- a/src/pages/search.astro +++ b/src/pages/search.astro @@ -1,6 +1,6 @@ --- import { Root } from '../components/Root' -import Zine from '../layouts/zine.astro' +import Zine from '../main.astro' import { apiClient } from '../utils/apiClient' import { initRouter } from '../stores/router' diff --git a/src/pages/topic/[slug].astro b/src/pages/topic/[slug].astro index 91ebde65..07d46c3a 100644 --- a/src/pages/topic/[slug].astro +++ b/src/pages/topic/[slug].astro @@ -1,12 +1,12 @@ --- import { Root } from '../../components/Root' -import Zine from '../../layouts/zine.astro' +import Zine from '../../main.astro' import { apiClient } from '../../utils/apiClient' import { PRERENDERED_ARTICLES_COUNT } from '../../components/Views/Topic' const slug = Astro.params.slug?.toString() || '' -const articles = await apiClient.getArticlesForTopics({ topicSlugs: [slug], limit: PRERENDERED_ARTICLES_COUNT }) -const topic = articles[0].topics.find(({ slug: topicSlug }) => topicSlug === slug) +const shouts = await apiClient.getArticlesForTopics({ topicSlugs: [slug], limit: PRERENDERED_ARTICLES_COUNT }) +const topic = shouts[0].topics.find(({ slug: topicSlug }) => topicSlug === slug) import { initRouter } from '../../stores/router' @@ -17,5 +17,5 @@ Astro.response.headers.set('Cache-Control', 's-maxage=1, stale-while-revalidate' --- - + diff --git a/src/pages/topics.astro b/src/pages/topics.astro index eda7b67a..fe7967d0 100644 --- a/src/pages/topics.astro +++ b/src/pages/topics.astro @@ -1,6 +1,6 @@ --- import { Root } from '../components/Root' -import Zine from '../layouts/zine.astro' +import Zine from '../main.astro' import { apiClient } from '../utils/apiClient' import { initRouter } from '../stores/router'