linted
This commit is contained in:
parent
4e631f5f91
commit
deeb7c58cf
|
@ -30,8 +30,8 @@ export const AllTopics = (props: Props) => {
|
||||||
const alphabet = createMemo(() => ABC[lang()])
|
const alphabet = createMemo(() => ABC[lang()])
|
||||||
const { setTopicsSort, sortedTopics } = useTopics()
|
const { setTopicsSort, sortedTopics } = useTopics()
|
||||||
const topics = createMemo(() => sortedTopics() || props.topics)
|
const topics = createMemo(() => sortedTopics() || props.topics)
|
||||||
const [searchParams, ] = useSearchParams<{ by?: string }>()
|
const [searchParams] = useSearchParams<{ by?: string }>()
|
||||||
createEffect(on(() => searchParams?.by || 'shouts', setTopicsSort, {defer: true}))
|
createEffect(on(() => searchParams?.by || 'shouts', setTopicsSort, { defer: true }))
|
||||||
onMount(() => setTopicsSort('shouts'))
|
onMount(() => setTopicsSort('shouts'))
|
||||||
// sorted derivative
|
// sorted derivative
|
||||||
const byLetter = createMemo<{ [letter: string]: Topic[] }>(() => {
|
const byLetter = createMemo<{ [letter: string]: Topic[] }>(() => {
|
||||||
|
@ -66,7 +66,9 @@ export const AllTopics = (props: Props) => {
|
||||||
// filter
|
// filter
|
||||||
const [searchQuery, setSearchQuery] = createSignal('')
|
const [searchQuery, setSearchQuery] = createSignal('')
|
||||||
const [filteredResults, setFilteredResults] = createSignal<Topic[]>([])
|
const [filteredResults, setFilteredResults] = createSignal<Topic[]>([])
|
||||||
createEffect(() => setFilteredResults((_prev: Topic[]) => dummyFilter(topics(), searchQuery(), lang()) as Topic[]))
|
createEffect(() =>
|
||||||
|
setFilteredResults((_prev: Topic[]) => dummyFilter(topics(), searchQuery(), lang()) as Topic[])
|
||||||
|
)
|
||||||
|
|
||||||
// subcomponent
|
// subcomponent
|
||||||
const AllTopicsHead = () => (
|
const AllTopicsHead = () => (
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import { createLazyMemo } from '@solid-primitives/memo'
|
|
||||||
import { openDB } from 'idb'
|
import { openDB } from 'idb'
|
||||||
import {
|
import {
|
||||||
Accessor,
|
Accessor,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { type RouteDefinition, type RouteSectionProps, createAsync } from '@solidjs/router'
|
import { type RouteDefinition, type RouteSectionProps, createAsync } from '@solidjs/router'
|
||||||
import { Suspense, createEffect} from 'solid-js'
|
import { Suspense, createEffect } from 'solid-js'
|
||||||
import { useTopics } from '~/context/topics'
|
import { useTopics } from '~/context/topics'
|
||||||
import { Topic } from '~/graphql/schema/core.gen'
|
import { Topic } from '~/graphql/schema/core.gen'
|
||||||
import { loadTopics } from '~/lib/api'
|
import { loadTopics } from '~/lib/api'
|
||||||
|
@ -20,7 +20,7 @@ export default function AllTopicsPage(props: RouteSectionProps<{ topics: Topic[]
|
||||||
const { t } = useLocalize()
|
const { t } = useLocalize()
|
||||||
const topics = createAsync<Topic[]>(async () => props.data.topics || (await fetchData()) || [])
|
const topics = createAsync<Topic[]>(async () => props.data.topics || (await fetchData()) || [])
|
||||||
const { addTopics } = useTopics()
|
const { addTopics } = useTopics()
|
||||||
createEffect(() => addTopics(topics()||[]))
|
createEffect(() => addTopics(topics() || []))
|
||||||
return (
|
return (
|
||||||
<PageLayout withPadding={true} title={`${t('Discours')}:${t('All topics')}`}>
|
<PageLayout withPadding={true} title={`${t('Discours')}:${t('All topics')}`}>
|
||||||
<ReactionsProvider>
|
<ReactionsProvider>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user