Merge branch 'dev' of https://github.com/Discours/discoursio-webapp into feature/empty-feed

This commit is contained in:
kvakazyambra 2024-05-11 20:34:47 +03:00
commit 399deaec86
6 changed files with 7 additions and 19 deletions

View File

@ -11,7 +11,7 @@
"deploy": "graphql-codegen && npm run typecheck && vite build && vercel",
"dev": "vite",
"e2e": "npx playwright test --project=chromium",
"fix": "npm run lint:code:fix && stylelint **/*.{scss,css} --fix",
"fix": "npm run check:code:fix && stylelint **/*.{scss,css} --fix",
"format": "npx @biomejs/biome format src/. --write",
"hygen": "HYGEN_TMPLS=gen hygen",
"postinstall": "npm run codegen && npx patch-package",

View File

@ -3,10 +3,10 @@ import type { Author, Reaction, Shout, Topic } from '../../../graphql/schema/cor
import { getPagePath } from '@nanostores/router'
import { clsx } from 'clsx'
import { For, Match, Show, Switch, createEffect, createMemo, createSignal, on, onMount } from 'solid-js'
import { Meta, Title } from '../../../context/meta'
import { useFollowing } from '../../../context/following'
import { useLocalize } from '../../../context/localize'
import { Meta, Title } from '../../../context/meta'
import { useSession } from '../../../context/session'
import { apiClient } from '../../../graphql/client/core'
import { router, useRouter } from '../../../stores/router'
@ -87,7 +87,7 @@ export const AuthorView = (props: Props) => {
setFollowing([...(authors || []), ...(topics || [])])
setFollowers(followersResult || [])
console.debug('[components.Author] following data loaded', subscriptionsResult)
console.info('[components.Author] data loaded')
} catch (error) {
console.error('[components.Author] fetch error', error)
}
@ -244,7 +244,7 @@ export const AuthorView = (props: Props) => {
class={styles.longBio}
classList={{ [styles.longBioExpanded]: isBioExpanded() }}
>
<div ref={(el) => (bioContainerRef.current = el)} innerHTML={author().about} />
<div ref={(el) => (bioContainerRef.current = el)} innerHTML={author()?.about || ''} />
</div>
<Show when={showExpandBioControl()}>

View File

@ -59,7 +59,7 @@ export const PublishSettings = (props: Props) => {
const composeDescription = () => {
if (!props.form.description) {
const cleanFootnotes = props.form.body.replaceAll(/<footnote data-value=".*?">.*?<\/footnote>/g, '')
const cleanFootnotes = props.form.body.replaceAll(/<footnote data-value=".*?">(.*?)<\/footnote>/g, '')
const leadText = cleanFootnotes.replaceAll(/<\/?[^>]+(>|$)/gi, ' ')
return shorten(leadText, DESCRIPTION_MAX_LENGTH).trim()
}

View File

@ -8,18 +8,6 @@
}
}
.unswiped {
width: 100%;
margin: 2rem 0;
margin-bottom: 6rem;
padding-bottom: 2rem;
display: block;
h2 {
text-align: center;
}
}
.Swiper {
display: block;
margin: 2rem 0;

View File

@ -1,6 +1,5 @@
import type {
Author,
AuthorFollowsResult,
CommonResult,
FollowingEntity,
LoadShoutsOptions,
@ -134,7 +133,7 @@ export const apiClient = {
slug?: string
author_id?: number
user?: string
}): Promise<AuthorFollowsResult> => {
}): Promise<CommonResult> => {
const response = await publicGraphQLClient.query(authorFollows, params).toPromise()
return response.data.get_author_follows
},

View File

@ -3,6 +3,7 @@ import { gql } from '@urql/core'
export default gql`
query GetAuthorFollows($slug: String, $user: String, $author_id: Int) {
get_author_follows(slug: $slug, user: $user, author_id: $author_id) {
error
authors {
id
slug