postmerge
This commit is contained in:
parent
607d986293
commit
9733eff104
|
@ -37,11 +37,11 @@ export const AllAuthors = (props: Props) => {
|
||||||
const [filteredAuthors, setFilteredAuthors] = createSignal<Author[]>([])
|
const [filteredAuthors, setFilteredAuthors] = createSignal<Author[]>([])
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
// Load all authors initially
|
// Load all authors initially
|
||||||
fetchAuthors(searchParams.by || 'name', 0)
|
fetchAuthors(searchParams.by || 'name', 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
/* const authors = createMemo(() => {
|
/* const authors = createMemo(() => {
|
||||||
let sortedAuthors = [...props.authors]
|
let sortedAuthors = [...props.authors]
|
||||||
sortedAuthors = authorsSorted()
|
sortedAuthors = authorsSorted()
|
||||||
if (!searchParams.by || searchParams.by === 'name') {
|
if (!searchParams.by || searchParams.by === 'name') {
|
||||||
|
@ -68,7 +68,6 @@ export const AllAuthors = (props: Props) => {
|
||||||
setFilteredAuthors(dummyFilter(authors(), searchQuery(), lang()) as Author[])
|
setFilteredAuthors(dummyFilter(authors(), searchQuery(), lang()) as Author[])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const byLetterFiltered = createMemo<{ [letter: string]: Author[] }>(() => {
|
const byLetterFiltered = createMemo<{ [letter: string]: Author[] }>(() => {
|
||||||
if (!(filteredAuthors()?.length > 0)) return {}
|
if (!(filteredAuthors()?.length > 0)) return {}
|
||||||
return filteredAuthors().reduce(
|
return filteredAuthors().reduce(
|
||||||
|
@ -114,7 +113,6 @@ export const AllAuthors = (props: Props) => {
|
||||||
fetchAuthors(by, nextPage).then(() => setCurrentPage({ ...currentPage(), [by]: nextPage }))
|
fetchAuthors(by, nextPage).then(() => setCurrentPage({ ...currentPage(), [by]: nextPage }))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const TabNavigator = () => (
|
const TabNavigator = () => (
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-20 col-xl-18">
|
<div class="col-lg-20 col-xl-18">
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import type { JSX } from 'solid-js'
|
|
||||||
|
|
||||||
import { Link } from '@solidjs/meta'
|
import { Link } from '@solidjs/meta'
|
||||||
|
import type { JSX } from 'solid-js'
|
||||||
import { splitProps } from 'solid-js'
|
import { splitProps } from 'solid-js'
|
||||||
|
|
||||||
import { getImageUrl } from '~/lib/getThumbUrl'
|
import { getImageUrl } from '~/lib/getThumbUrl'
|
||||||
|
|
||||||
type Props = JSX.ImgHTMLAttributes<HTMLImageElement> & {
|
type Props = JSX.ImgHTMLAttributes<HTMLImageElement> & {
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
import { RouteDefinition, RoutePreloadFuncArgs, type RouteSectionProps, createAsync } from '@solidjs/router'
|
import { RouteDefinition, RoutePreloadFuncArgs, type RouteSectionProps, createAsync } from '@solidjs/router'
|
||||||
import { Suspense, createEffect, on } from 'solid-js'
|
import { Suspense, createEffect, on } from 'solid-js'
|
||||||
import { AllAuthors } from '~/components/Views/AllAuthors'
|
import { AllAuthors } from '~/components/Views/AllAuthors'
|
||||||
import { AUTHORS_PER_PAGE } from '~/components/Views/AllAuthors/AllAuthors'
|
|
||||||
import { Loading } from '~/components/_shared/Loading'
|
import { Loading } from '~/components/_shared/Loading'
|
||||||
import { PageLayout } from '~/components/_shared/PageLayout'
|
import { PageLayout } from '~/components/_shared/PageLayout'
|
||||||
import { useAuthors } from '~/context/authors'
|
import { useAuthors } from '~/context/authors'
|
||||||
import { useLocalize } from '~/context/localize'
|
import { useLocalize } from '~/context/localize'
|
||||||
import { loadAuthors, loadAuthorsAll } from '~/graphql/api/public'
|
import { loadAuthorsAll } from '~/graphql/api/public'
|
||||||
import { Author, AuthorsBy } from '~/graphql/schema/core.gen'
|
import { Author } from '~/graphql/schema/core.gen'
|
||||||
|
|
||||||
// Fetch Function
|
// Fetch Function
|
||||||
const fetchAllAuthors = async () => {
|
const fetchAllAuthors = async () => {
|
||||||
|
@ -17,7 +16,7 @@ const fetchAllAuthors = async () => {
|
||||||
|
|
||||||
//Route Defenition
|
//Route Defenition
|
||||||
export const route = {
|
export const route = {
|
||||||
load: async ({ location: { query } }: RoutePreloadFuncArgs) => {
|
load: async ({ location: { query: _q } }: RoutePreloadFuncArgs) => {
|
||||||
return {
|
return {
|
||||||
authors: await fetchAllAuthors()
|
authors: await fetchAllAuthors()
|
||||||
}
|
}
|
||||||
|
@ -26,7 +25,6 @@ export const route = {
|
||||||
|
|
||||||
type AllAuthorsData = { authors: Author[] }
|
type AllAuthorsData = { authors: Author[] }
|
||||||
|
|
||||||
|
|
||||||
// addAuthors to context
|
// addAuthors to context
|
||||||
|
|
||||||
export default function AllAuthorsPage(props: RouteSectionProps<AllAuthorsData>) {
|
export default function AllAuthorsPage(props: RouteSectionProps<AllAuthorsData>) {
|
||||||
|
@ -61,10 +59,7 @@ export default function AllAuthorsPage(props: RouteSectionProps<AllAuthorsData>)
|
||||||
desc="List of authors of the open editorial community"
|
desc="List of authors of the open editorial community"
|
||||||
>
|
>
|
||||||
<Suspense fallback={<Loading />}>
|
<Suspense fallback={<Loading />}>
|
||||||
<AllAuthors
|
<AllAuthors isLoaded={Boolean(data()?.authors)} authors={data()?.authors || []} />
|
||||||
isLoaded={Boolean(data()?.authors)}
|
|
||||||
authors={data()?.authors || []}
|
|
||||||
/>
|
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user