diff --git a/.lintstagedrc b/.lintstagedrc deleted file mode 100644 index e0351c1f..00000000 --- a/.lintstagedrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "*.{js,ts,cjs,mjs,d.mts,jsx,tsx,json,jsonc}": [ - "npx @biomejs/biome check ./src && tsc" - ] -} diff --git a/api/feedback.js b/api/feedback.js index d3d2062e..fe2f0789 100644 --- a/api/feedback.js +++ b/api/feedback.js @@ -13,7 +13,7 @@ export default async function handler(req, res) { from: 'Discours Feedback Robot ', to: 'welcome@discours.io', subject, - text, + text } try { diff --git a/api/newsletter.js b/api/newsletter.js index d964d52c..7ad433e9 100644 --- a/api/newsletter.js +++ b/api/newsletter.js @@ -11,18 +11,18 @@ export default async (req, res) => { const response = await mg.lists.members.createMember('newsletter@discours.io', { address: email, subscribed: true, - upsert: 'yes', + upsert: 'yes' }) return res.status(200).json({ success: true, message: 'Email was added to newsletter list', - response: JSON.stringify(response), + response: JSON.stringify(response) }) } catch (error) { return res.status(400).json({ success: false, - message: error.message, + message: error.message }) } } diff --git a/app.config.ts b/app.config.ts index 6d244961..9832fea9 100644 --- a/app.config.ts +++ b/app.config.ts @@ -8,12 +8,12 @@ export default defineConfig({ ssr: true, server: { preset: isVercel ? 'vercel_edge' : isBun ? 'bun' : 'node', - port: 3000, + port: 3000 }, devOverlay: true, build: { chunkSizeWarningLimit: 1024, - target: 'esnext', + target: 'esnext' }, vite: { envPrefix: 'PUBLIC_', @@ -22,12 +22,12 @@ export default defineConfig({ include: ['path', 'stream', 'util'], exclude: ['http'], globals: { - Buffer: true, + Buffer: true }, overrides: { - fs: 'memfs', + fs: 'memfs' }, - protocolImports: true, + protocolImports: true }), sassDts() ], @@ -35,13 +35,13 @@ export default defineConfig({ preprocessorOptions: { scss: { additionalData: '@import "src/styles/imports";\n', - includePaths: ['./public', './src/styles'], - }, - }, + includePaths: ['./public', './src/styles'] + } + } }, build: { chunkSizeWarningLimit: 1024, - target: 'esnext', + target: 'esnext' } } } as SolidStartInlineConfig) diff --git a/biome.json b/biome.json index a2d31d9f..cf0b9ae5 100644 --- a/biome.json +++ b/biome.json @@ -1,21 +1,8 @@ { "$schema": "https://biomejs.dev/schemas/1.8.2/schema.json", "files": { - "include": [ - "*.tsx", - "*.ts", - "*.js", - "*.json" - ], - "ignore": [ - "./dist", - "./node_modules", - ".husky", - "docs", - "gen", - "*.gen.ts", - "*.d.ts" - ] + "include": ["*.tsx", "*.ts", "*.js", "*.json"], + "ignore": ["./dist", "./node_modules", ".husky", "docs", "gen", "*.gen.ts", "*.d.ts"] }, "vcs": { "defaultBranch": "dev", @@ -23,19 +10,13 @@ }, "organizeImports": { "enabled": true, - "ignore": [ - "./api", - "./gen" - ] + "ignore": ["./api", "./gen"] }, "formatter": { "indentStyle": "space", "indentWidth": 2, "lineWidth": 108, - "ignore": [ - "./src/graphql/schema", - "./gen" - ] + "ignore": ["./src/graphql/schema", "./gen"] }, "javascript": { "formatter": { @@ -43,17 +24,12 @@ "quoteStyle": "single", "enabled": true, "jsxQuoteStyle": "double", - "arrowParentheses": "always" + "arrowParentheses": "always", + "trailingCommas": "none" } }, "linter": { - "ignore": [ - "*.scss", - "*.md", - ".DS_Store", - "*.svg", - "*.d.ts" - ], + "ignore": ["*.scss", "*.md", ".DS_Store", "*.svg", "*.d.ts"], "enabled": true, "rules": { "all": true, @@ -85,6 +61,7 @@ "noBarrelFile": "off" }, "style": { + "noNamespaceImport": "warn", "useBlockStatements": "off", "noImplicitBoolean": "off", "useNamingConvention": "off", @@ -98,4 +75,4 @@ } } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 9c0d9159..7fd76ddf 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "@solid-primitives/media": "^2.2.9", "@solid-primitives/memo": "^1.3.8", "@solid-primitives/pagination": "^0.3.0", + "@solid-primitives/script-loader": "^2.2.0", "@solid-primitives/share": "^2.0.6", "@solid-primitives/storage": "^3.7.1", "@solid-primitives/upload": "^0.0.117", @@ -112,11 +113,7 @@ "yjs": "13.6.18", "y-prosemirror": "1.2.9" }, - "trustedDependencies": [ - "@biomejs/biome", - "esbuild", - "protobufjs" - ], + "trustedDependencies": ["@biomejs/biome", "esbuild", "protobufjs"], "dependencies": { "form-data": "^4.0.0", "idb": "^8.0.0", @@ -125,4 +122,4 @@ "engines": { "node": "20.x" } -} \ No newline at end of file +} diff --git a/playwright.config.ts b/playwright.config.ts index 300d6fec..978dadb9 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -27,25 +27,25 @@ export default defineConfig({ // baseURL: 'http://127.0.0.1:3000', /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', + trace: 'on-first-retry' }, /* Configure projects for major browsers */ projects: [ { name: 'chromium', - use: { ...devices['Desktop Chrome'] }, + use: { ...devices['Desktop Chrome'] } }, { name: 'firefox', - use: { ...devices['Desktop Firefox'] }, + use: { ...devices['Desktop Firefox'] } }, { name: 'webkit', - use: { ...devices['Desktop Safari'] }, - }, + use: { ...devices['Desktop Safari'] } + } /* Test against many viewports. // { @@ -66,7 +66,7 @@ export default defineConfig({ // name: 'Google Chrome', // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, // }, - ], + ] /* Run local dev server before starting the tests */ //webServer: { diff --git a/src/components/Article/AudioPlayer/AudioPlayer.tsx b/src/components/Article/AudioPlayer/AudioPlayer.tsx index d0466be5..1fe13702 100644 --- a/src/components/Article/AudioPlayer/AudioPlayer.tsx +++ b/src/components/Article/AudioPlayer/AudioPlayer.tsx @@ -15,7 +15,7 @@ type Props = { onMediaItemFieldChange?: ( index: number, field: keyof MediaItem | string | number | symbol, - value: string, + value: string ) => void onChangeMediaIndex?: (direction: 'up' | 'down', index: number) => void } @@ -101,7 +101,7 @@ export const AudioPlayer = (props: Props) => { const handleMediaItemFieldChange = ( index: number, field: keyof MediaItem | string | number | symbol, - value: string, + value: string ) => { props.onMediaItemFieldChange?.(index, field, value) } @@ -135,7 +135,7 @@ export const AudioPlayer = (props: Props) => {
diff --git a/src/components/Article/AudioPlayer/PlayerHeader.tsx b/src/components/Article/AudioPlayer/PlayerHeader.tsx index cd8aeff1..2570682b 100644 --- a/src/components/Article/AudioPlayer/PlayerHeader.tsx +++ b/src/components/Article/AudioPlayer/PlayerHeader.tsx @@ -26,7 +26,7 @@ export const PlayerHeader = (props: Props) => { useOutsideClickHandler({ containerRef: volumeContainerRef, predicate: () => isVolumeBarOpened(), - handler: () => toggleVolumeBar(), + handler: () => toggleVolumeBar() }) return ( @@ -38,7 +38,7 @@ export const PlayerHeader = (props: Props) => { onClick={props.onPlayMedia} class={clsx( styles.playButton, - props.isPlaying ? styles.playButtonInvertPause : styles.playButtonInvertPlay, + props.isPlaying ? styles.playButtonInvertPause : styles.playButtonInvertPlay )} aria-label="Play" data-playing="false" diff --git a/src/components/Article/Comment/Comment.tsx b/src/components/Article/Comment/Comment.tsx index 105b93f8..9f2ef490 100644 --- a/src/components/Article/Comment/Comment.tsx +++ b/src/components/Article/Comment/Comment.tsx @@ -12,7 +12,7 @@ import { MutationCreate_ReactionArgs, MutationUpdate_ReactionArgs, Reaction, - ReactionKind, + ReactionKind } from '../../../graphql/schema/core.gen' import { AuthorLink } from '../../Author/AuthorLink' import { Userpic } from '../../Author/Userpic' @@ -54,7 +54,7 @@ export const Comment = (props: Props) => { const canEdit = createMemo( () => Boolean(author()?.id) && - (props.comment?.created_by?.slug === author()?.slug || session()?.user?.roles?.includes('editor')), + (props.comment?.created_by?.slug === author()?.slug || session()?.user?.roles?.includes('editor')) ) const body = createMemo(() => (editedBody() ? editedBody()?.trim() : props.comment.body?.trim() || '')) @@ -66,7 +66,7 @@ export const Comment = (props: Props) => { confirmBody: t('Are you sure you want to delete this comment?'), confirmButtonLabel: t('Delete'), confirmButtonVariant: 'danger', - declineButtonVariant: 'primary', + declineButtonVariant: 'primary' }) if (isConfirmed) { @@ -80,7 +80,7 @@ export const Comment = (props: Props) => { await showSnackbar({ type: notificationType, body: notificationMessage, - duration: 3, + duration: 3 }) if (!error && props.onDelete) { @@ -102,8 +102,8 @@ export const Comment = (props: Props) => { kind: ReactionKind.Comment, reply_to: props.comment.id, body: value, - shout: props.comment.shout.id, - }, + shout: props.comment.shout.id + } } as MutationCreate_ReactionArgs) setClearEditor(true) setIsReplyVisible(false) @@ -126,8 +126,8 @@ export const Comment = (props: Props) => { id: props.comment.id || 0, kind: ReactionKind.Comment, body: value, - shout: props.comment.shout.id, - }, + shout: props.comment.shout.id + } } as MutationUpdate_ReactionArgs) if (reaction) { setEditedBody(value) @@ -144,7 +144,7 @@ export const Comment = (props: Props) => { id={`comment_${props.comment.id}`} class={clsx(styles.comment, props.class, { [styles.isNew]: - (props.lastSeen || Date.now()) > (props.comment.updated_at || props.comment.created_at), + (props.lastSeen || Date.now()) > (props.comment.updated_at || props.comment.created_at) })} > @@ -157,7 +157,7 @@ export const Comment = (props: Props) => { name={props.comment.created_by.name || ''} userpic={props.comment.created_by.pic || ''} class={clsx({ - [styles.compactUserpic]: props.compact, + [styles.compactUserpic]: props.compact })} /> diff --git a/src/components/Article/CommentDate/CommentDate.tsx b/src/components/Article/CommentDate/CommentDate.tsx index 3b472425..ffcdcb99 100644 --- a/src/components/Article/CommentDate/CommentDate.tsx +++ b/src/components/Article/CommentDate/CommentDate.tsx @@ -28,7 +28,7 @@ export const CommentDate = (props: Props) => {
diff --git a/src/components/Article/CommentRatingControl.tsx b/src/components/Article/CommentRatingControl.tsx index 6f4fe376..7d60e9bb 100644 --- a/src/components/Article/CommentRatingControl.tsx +++ b/src/components/Article/CommentRatingControl.tsx @@ -30,7 +30,7 @@ export const CommentRatingControl = (props: Props) => { r.kind === reactionKind && r.created_by.id === uid() && r.shout.id === props.comment.shout.id && - r.reply_to === props.comment.id, + r.reply_to === props.comment.id ) const isUpvoted = createMemo(() => checkReaction(ReactionKind.Like)) const isDownvoted = createMemo(() => checkReaction(ReactionKind.Dislike)) @@ -41,8 +41,8 @@ export const CommentRatingControl = (props: Props) => { (r) => [ReactionKind.Like, ReactionKind.Dislike].includes(r.kind) && r.shout.id === props.comment.shout.id && - r.reply_to === props.comment.id, - ), + r.reply_to === props.comment.id + ) ) const deleteCommentReaction = async (reactionKind: ReactionKind) => { @@ -51,7 +51,7 @@ export const CommentRatingControl = (props: Props) => { r.kind === reactionKind && r.created_by.id === uid() && r.shout.id === props.comment.shout.id && - r.reply_to === props.comment.id, + r.reply_to === props.comment.id ) if (reactionToDelete) return deleteReaction(reactionToDelete.id) } @@ -67,8 +67,8 @@ export const CommentRatingControl = (props: Props) => { reaction: { kind: isUpvote ? ReactionKind.Like : ReactionKind.Dislike, shout: props.comment.shout.id, - reply_to: props.comment.id, - }, + reply_to: props.comment.id + } }) } } catch { @@ -77,7 +77,7 @@ export const CommentRatingControl = (props: Props) => { await loadShout(props.comment.shout.slug) await loadReactionsBy({ - by: { shout: props.comment.shout.slug }, + by: { shout: props.comment.shout.slug } }) } @@ -88,7 +88,7 @@ export const CommentRatingControl = (props: Props) => { disabled={!(canVote() && uid())} onClick={() => handleRatingChange(true)} class={clsx(styles.commentRatingControl, styles.commentRatingControlUp, { - [styles.voted]: isUpvoted(), + [styles.voted]: isUpvoted() })} /> {
0, - [styles.commentRatingNegative]: (props.comment?.stat?.rating || 0) < 0, + [styles.commentRatingNegative]: (props.comment?.stat?.rating || 0) < 0 })} > {props.comment?.stat?.rating || 0} @@ -114,7 +114,7 @@ export const CommentRatingControl = (props: Props) => { disabled={!(canVote() && uid())} onClick={() => handleRatingChange(false)} class={clsx(styles.commentRatingControl, styles.commentRatingControlDown, { - [styles.voted]: isDownvoted(), + [styles.voted]: isDownvoted() })} />
diff --git a/src/components/Article/CommentsTree.tsx b/src/components/Article/CommentsTree.tsx index 3c4a33f9..e942060b 100644 --- a/src/components/Article/CommentsTree.tsx +++ b/src/components/Article/CommentsTree.tsx @@ -34,7 +34,7 @@ export const CommentsTree = (props: Props) => { const { reactionEntities, createReaction, loadReactionsBy } = useReactions() const comments = createMemo(() => - Object.values(reactionEntities).filter((reaction) => reaction.kind === 'COMMENT'), + Object.values(reactionEntities).filter((reaction) => reaction.kind === 'COMMENT') ) const sortedComments = createMemo(() => { @@ -80,8 +80,8 @@ export const CommentsTree = (props: Props) => { reaction: { kind: ReactionKind.Comment, body: value, - shout: props.shoutId, - }, + shout: props.shoutId + } }) setClearEditor(true) await loadReactionsBy({ by: { shout: props.shoutSlug } }) diff --git a/src/components/Article/CoverImage/CoverImage.tsx b/src/components/Article/CoverImage/CoverImage.tsx index 970d2636..4815b20d 100644 --- a/src/components/Article/CoverImage/CoverImage.tsx +++ b/src/components/Article/CoverImage/CoverImage.tsx @@ -26,7 +26,7 @@ const coverImages = [ CoverImage9, CoverImage10, CoverImage11, - CoverImage12, + CoverImage12 ] let counter = 0 diff --git a/src/components/Article/FullArticle.tsx b/src/components/Article/FullArticle.tsx index ba4dc64a..86f49c0b 100644 --- a/src/components/Article/FullArticle.tsx +++ b/src/components/Article/FullArticle.tsx @@ -61,7 +61,7 @@ const scrollTo = (el: HTMLElement) => { window.scrollTo({ top: top + window.scrollY - DEFAULT_HEADER_OFFSET, left: 0, - behavior: 'smooth', + behavior: 'smooth' }) } @@ -86,7 +86,7 @@ export const FullArticle = (props: Props) => { Boolean(author()?.id) && (props.article?.authors?.some((a) => Boolean(a) && a?.id === author().id) || props.article?.created_by?.id === author().id || - session()?.user?.roles?.includes('editor')), + session()?.user?.roles?.includes('editor')) ) const mainTopic = createMemo(() => { @@ -156,7 +156,7 @@ export const FullArticle = (props: Props) => { createEffect(() => { if (searchParams?.commentId && isReactionsLoaded()) { const commentElement = document.querySelector( - `[id='comment_${searchParams?.commentId}']`, + `[id='comment_${searchParams?.commentId}']` ) if (commentElement) { @@ -174,7 +174,7 @@ export const FullArticle = (props: Props) => { } const tooltipElements: NodeListOf = document.querySelectorAll( - '[data-toggle="tooltip"], footnote', + '[data-toggle="tooltip"], footnote' ) if (!tooltipElements) { return @@ -199,19 +199,19 @@ export const FullArticle = (props: Props) => { modifiers: [ { name: 'eventListeners', - options: { scroll: false }, + options: { scroll: false } }, { name: 'offset', options: { - offset: [0, 8], - }, + offset: [0, 8] + } }, { name: 'flip', - options: { fallbackPlacements: ['top'] }, - }, - ], + options: { fallbackPlacements: ['top'] } + } + ] }) tooltip.style.visibility = 'hidden' @@ -297,8 +297,8 @@ export const FullArticle = (props: Props) => { () => props.article, () => { updateIframeSizes() - }, - ), + } + ) ) onMount(async () => { @@ -330,7 +330,7 @@ export const FullArticle = (props: Props) => { title: props.article.title, topic: mainTopic()?.title || '', author: props.article?.authors?.[0]?.name || '', - width: 1200, + width: 1200 }) const description = getDescription(props.article.description || body() || media()[0]?.body) diff --git a/src/components/Article/ShoutRatingControl.tsx b/src/components/Article/ShoutRatingControl.tsx index d6feb806..e7671b72 100644 --- a/src/components/Article/ShoutRatingControl.tsx +++ b/src/components/Article/ShoutRatingControl.tsx @@ -31,7 +31,7 @@ export const ShoutRatingControl = (props: ShoutRatingControlProps) => { r.kind === reactionKind && r.created_by.id === author()?.id && r.shout.id === props.shout.id && - !r.reply_to, + !r.reply_to ) const isUpvoted = createMemo(() => checkReaction(ReactionKind.Like)) @@ -39,8 +39,8 @@ export const ShoutRatingControl = (props: ShoutRatingControlProps) => { const shoutRatingReactions = createMemo(() => Object.values(reactionEntities).filter( - (r) => ['LIKE', 'DISLIKE'].includes(r.kind) && r.shout.id === props.shout.id && !r.reply_to, - ), + (r) => ['LIKE', 'DISLIKE'].includes(r.kind) && r.shout.id === props.shout.id && !r.reply_to + ) ) const deleteShoutReaction = async (reactionKind: ReactionKind) => { @@ -49,7 +49,7 @@ export const ShoutRatingControl = (props: ShoutRatingControlProps) => { r.kind === reactionKind && r.created_by.id === author()?.id && r.shout.id === props.shout.id && - !r.reply_to, + !r.reply_to ) if (reactionToDelete) return deleteReaction(reactionToDelete.id) } @@ -65,14 +65,14 @@ export const ShoutRatingControl = (props: ShoutRatingControlProps) => { await createReaction({ reaction: { kind: isUpvote ? ReactionKind.Like : ReactionKind.Dislike, - shout: props.shout.id, - }, + shout: props.shout.id + } }) } loadShout(props.shout.slug) loadReactionsBy({ - by: { shout: props.shout.slug }, + by: { shout: props.shout.slug } }) setIsLoading(false) diff --git a/src/components/AuthGuard/AuthGuard.tsx b/src/components/AuthGuard/AuthGuard.tsx index ffb9ec24..2224f9f9 100644 --- a/src/components/AuthGuard/AuthGuard.tsx +++ b/src/components/AuthGuard/AuthGuard.tsx @@ -26,14 +26,14 @@ export const AuthGuard = (props: Props) => { changeSearchParams( { source: 'authguard', - m: 'auth', + m: 'auth' }, - { replace: true }, + { replace: true } ) } }, - { defer: true }, - ), + { defer: true } + ) ) return {props.children} diff --git a/src/components/Author/AuthorBadge/AuthorBadge.tsx b/src/components/Author/AuthorBadge/AuthorBadge.tsx index c5bfc07a..007a5556 100644 --- a/src/components/Author/AuthorBadge/AuthorBadge.tsx +++ b/src/components/Author/AuthorBadge/AuthorBadge.tsx @@ -34,7 +34,7 @@ export const AuthorBadge = (props: Props) => { const { follow, unfollow, follows, following } = useFollowing() const [isMobileView, setIsMobileView] = createSignal(false) const [isFollowed, setIsFollowed] = createSignal( - Boolean(follows?.authors?.some((authorEntity) => Boolean(authorEntity.id === props.author?.id))), + Boolean(follows?.authors?.some((authorEntity) => Boolean(authorEntity.id === props.author?.id))) ) createEffect(() => setIsMobileView(!mediaMatches.sm)) createEffect( @@ -42,11 +42,11 @@ export const AuthorBadge = (props: Props) => { [() => follows?.authors, () => props.author, following], ([followingAuthors, currentAuthor, _]) => { setIsFollowed( - Boolean(followingAuthors?.some((followedAuthor) => followedAuthor.id === currentAuthor?.id)), + Boolean(followingAuthors?.some((followedAuthor) => followedAuthor.id === currentAuthor?.id)) ) }, - { defer: true }, - ), + { defer: true } + ) ) const [, changeSearchParams] = useSearchParams() @@ -58,7 +58,7 @@ export const AuthorBadge = (props: Props) => { requireAuthentication(() => { navigate('/inbox') changeSearchParams({ - initChat: props.author?.id.toString(), + initChat: props.author?.id.toString() }) }, 'discussions') } @@ -108,7 +108,7 @@ export const AuthorBadge = (props: Props) => { fallback={
{t('Registered since {date}', { - date: formatDate(new Date((props.author.created_at || 0) * 1000)), + date: formatDate(new Date((props.author.created_at || 0) * 1000)) })}
} diff --git a/src/components/Author/AuthorCard/AuthorCard.tsx b/src/components/Author/AuthorCard/AuthorCard.tsx index 1fb40ded..0cd605af 100644 --- a/src/components/Author/AuthorCard/AuthorCard.tsx +++ b/src/components/Author/AuthorCard/AuthorCard.tsx @@ -65,7 +65,7 @@ export const AuthorCard = (props: Props) => { requireAuthentication(() => { navigate('/inbox') changeSearchParams({ - initChat: props.author?.id.toString(), + initChat: props.author?.id.toString() }) }, 'discussions') } @@ -127,7 +127,7 @@ export const AuthorCard = (props: Props) => {
@@ -193,7 +193,7 @@ export const PublishSettings = (props: Props) => {

{t( - 'Choose a title image for the article. You can immediately see how the publication card will look like.', + 'Choose a title image for the article. You can immediately see how the publication card will look like.' )}

@@ -242,7 +242,7 @@ export const PublishSettings = (props: Props) => {

{t('Topics')}

{t( - 'Add a few topics so that the reader knows what your content is about and can find it on pages of topics that interest them. Topics can be swapped, the first topic becomes the title', + 'Add a few topics so that the reader knows what your content is about and can find it on pages of topics that interest them. Topics can be swapped, the first topic becomes the title' )}

diff --git a/src/components/Views/Search.tsx b/src/components/Views/Search.tsx index 45ac71ca..22952d5b 100644 --- a/src/components/Views/Search.tsx +++ b/src/components/Views/Search.tsx @@ -36,7 +36,7 @@ export const SearchView = (props: Props) => { const { hasMore } = await loadShoutsSearch({ text: query(), offset: offset(), - limit: LOAD_MORE_PAGE_SIZE, + limit: LOAD_MORE_PAGE_SIZE }) setIsLoadMoreButtonVisible(hasMore) setOffset(offset() + LOAD_MORE_PAGE_SIZE) @@ -76,14 +76,14 @@ export const SearchView = (props: Props) => {
  • {t('By relevance')}
  • {t('Top rated')} diff --git a/src/components/Views/Topic.tsx b/src/components/Views/Topic.tsx index a4f85d7b..0e514d54 100644 --- a/src/components/Views/Topic.tsx +++ b/src/components/Views/Topic.tsx @@ -65,7 +65,7 @@ export const TopicView = (props: Props) => { await loadTopicAuthors() loadRandom() } - }), + }) ) const [followers, setFollowers] = createSignal(props.followers || []) @@ -84,7 +84,7 @@ export const TopicView = (props: Props) => { const options: LoadShoutsOptions = { filters: { featured: true, topic: topic }, limit: 10, - random_limit: 100, + random_limit: 100 } const resp = await query(getRandomTopShoutsQuery, { options }).toPromise() setFavoriteTopArticles(resp?.data?.l) @@ -97,7 +97,7 @@ export const TopicView = (props: Props) => { const options: LoadShoutsOptions = { filters: { after: after, featured: true, topic: topic }, limit: 10, - random_limit: 10, + random_limit: 10 } const resp = await query(loadShoutsRandomQuery, { options }).toPromise() @@ -117,8 +117,8 @@ export const TopicView = (props: Props) => { lang() === 'en' ? (topic() as Topic)?.slug.replace(/-/, ' ') : (topic() as Topic)?.title || (topic() as Topic)?.slug.replace(/-/, ' '), - true, - )}`, + true + )}` ) const loadMore = async () => { @@ -127,7 +127,7 @@ export const TopicView = (props: Props) => { const { hasMore } = await loadShouts({ filters: { topic: topic()?.slug }, limit: LOAD_MORE_PAGE_SIZE, - offset: sortedFeed().length, // FIXME: use feedByTopic + offset: sortedFeed().length // FIXME: use feedByTopic }) setIsLoadMoreButtonVisible(hasMore) @@ -150,7 +150,7 @@ export const TopicView = (props: Props) => { }) */ const pages = createMemo(() => - splitToPages(sortedFeed(), PRERENDERED_ARTICLES_COUNT, LOAD_MORE_PAGE_SIZE), + splitToPages(sortedFeed(), PRERENDERED_ARTICLES_COUNT, LOAD_MORE_PAGE_SIZE) ) const ogImage = () => @@ -181,14 +181,14 @@ export const TopicView = (props: Props) => {
@@ -63,7 +63,7 @@ export const DropDown = (props: Props)