This commit is contained in:
Untone 2024-03-01 00:11:59 +03:00
parent 72610d10b5
commit d0be8ffb6a
5 changed files with 37 additions and 26 deletions

View File

@ -2,7 +2,7 @@
@include font-size(1.2rem); @include font-size(1.2rem);
color: var(--secondary-color); color: var(--secondary-color);
//align-self: center; align-self: center;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
justify-content: flex-start; justify-content: flex-start;

View File

@ -1,5 +1,5 @@
import { clsx } from 'clsx' import { clsx } from 'clsx'
import {createMemo, createSignal, For, lazy, onMount, Show} from 'solid-js' import { For, Show, createMemo, createSignal, lazy, onMount } from 'solid-js'
import { useLocalize } from '../../context/localize' import { useLocalize } from '../../context/localize'
import { useReactions } from '../../context/reactions' import { useReactions } from '../../context/reactions'
@ -95,11 +95,7 @@ export const CommentsTree = (props: Props) => {
<ul class={clsx(styles.commentsViewSwitcher, 'view-switcher')}> <ul class={clsx(styles.commentsViewSwitcher, 'view-switcher')}>
<Show when={newReactions().length > 0}> <Show when={newReactions().length > 0}>
<li classList={{ 'view-switcher__item--selected': onlyNew() }}> <li classList={{ 'view-switcher__item--selected': onlyNew() }}>
<Button <Button variant="light" value={t('New only')} onClick={() => setOnlyNew(!onlyNew())} />
variant="light"
value={t('New only')}
onClick={() => setOnlyNew(!onlyNew())}
/>
</li> </li>
</Show> </Show>
<li classList={{ 'view-switcher__item--selected': commentsOrder() === ReactionSort.Newest }}> <li classList={{ 'view-switcher__item--selected': commentsOrder() === ReactionSort.Newest }}>

View File

@ -23,9 +23,9 @@ import { Row2 } from '../../Feed/Row2'
import { Row3 } from '../../Feed/Row3' import { Row3 } from '../../Feed/Row3'
import { Loading } from '../../_shared/Loading' import { Loading } from '../../_shared/Loading'
import { byCreated } from '../../../utils/sortby'
import stylesArticle from '../../Article/Article.module.scss' import stylesArticle from '../../Article/Article.module.scss'
import styles from './Author.module.scss' import styles from './Author.module.scss'
import {byCreated} from "../../../utils/sortby";
type Props = { type Props = {
shouts: Shout[] shouts: Shout[]

View File

@ -1,13 +1,21 @@
import type { PageContext } from '../renderer/types' import type { PageContext } from '../renderer/types'
import type { PageProps } from './types' import type { PageProps } from './types'
import { PAGE_SIZE } from '../components/Views/AllTopics/AllTopics'
import { apiClient } from '../graphql/client/core' import { apiClient } from '../graphql/client/core'
import { PAGE_SIZE } from "../components/Views/AllTopics/AllTopics";
export const onBeforeRender = async (_pageContext: PageContext) => { export const onBeforeRender = async (_pageContext: PageContext) => {
const allAuthors = await apiClient.getAllAuthors() const allAuthors = await apiClient.getAllAuthors()
const topWritingAuthors = await apiClient.loadAuthorsBy({ by: { order: 'shouts' }, limit: PAGE_SIZE}) const topWritingAuthors = await apiClient.loadAuthorsBy({
const topFollowedAuthors = await apiClient.loadAuthorsBy({ by: { order: 'followers' }, limit: PAGE_SIZE}) by: { order: 'shouts' },
limit: PAGE_SIZE,
offset: 0,
})
const topFollowedAuthors = await apiClient.loadAuthorsBy({
by: { order: 'followers' },
limit: PAGE_SIZE,
offset: 0,
})
const pageProps: PageProps = { allAuthors, seo: { title: '' }, topWritingAuthors, topFollowedAuthors } const pageProps: PageProps = { allAuthors, seo: { title: '' }, topWritingAuthors, topFollowedAuthors }
return { return {

View File

@ -3,13 +3,15 @@ import type { PageProps } from './types'
import { createEffect, createSignal, onMount } from 'solid-js' import { createEffect, createSignal, onMount } from 'solid-js'
import { AllAuthors } from '../components/Views/AllAuthors/' import { AllAuthors } from '../components/Views/AllAuthors/'
import { PAGE_SIZE } from '../components/Views/AllTopics/AllTopics'
import { PageLayout } from '../components/_shared/PageLayout' import { PageLayout } from '../components/_shared/PageLayout'
import { useLocalize } from '../context/localize' import { useLocalize } from '../context/localize'
import { loadAllAuthors, loadAuthors } from '../stores/zine/authors' import { loadAllAuthors, loadAuthors } from '../stores/zine/authors'
import {PAGE_SIZE} from "../components/Views/AllTopics/AllTopics";
export const AllAuthorsPage = (props: PageProps) => { export const AllAuthorsPage = (props: PageProps) => {
const [isLoaded, setIsLoaded] = createSignal<boolean>(Boolean(props.allAuthors && props.topFollowedAuthors && props.topWritingAuthors)) const [isLoaded, setIsLoaded] = createSignal<boolean>(
Boolean(props.allAuthors && props.topFollowedAuthors && props.topWritingAuthors),
)
const { t } = useLocalize() const { t } = useLocalize()
@ -19,14 +21,19 @@ export const AllAuthorsPage = (props: PageProps) => {
} }
await loadAllAuthors() await loadAllAuthors()
await loadAuthors({ by: { order: 'shouts' }, limit: PAGE_SIZE }) await loadAuthors({ by: { order: 'shouts' }, limit: PAGE_SIZE, offset: 0 })
await loadAuthors({ by: { order: 'followers' }, limit: PAGE_SIZE }) await loadAuthors({ by: { order: 'followers' }, limit: PAGE_SIZE, offset: 0 })
setIsLoaded(true) setIsLoaded(true)
}) })
return ( return (
<PageLayout title={t('Authors')}> <PageLayout title={t('Authors')}>
<AllAuthors isLoaded={isLoaded()} authors={props.allAuthors} topWritingAuthors={props.topWritingAuthors} topFollowedAuthors={props.topFollowedAuthors} /> <AllAuthors
isLoaded={isLoaded()}
authors={props.allAuthors}
topWritingAuthors={props.topWritingAuthors}
topFollowedAuthors={props.topFollowedAuthors}
/>
</PageLayout> </PageLayout>
) )
} }