types-fixed
Some checks failed
deploy / test (push) Failing after 1m43s
deploy / deploy (push) Has been skipped

This commit is contained in:
Untone 2023-12-24 16:08:04 +03:00
parent 11788bcf0d
commit bd1b0025e7
10 changed files with 19 additions and 23 deletions

View File

@ -1,6 +1,6 @@
// TODO: additional entities list column + article
import type { Author, Shout, Topic, User } from '../../graphql/schema/core.gen'
import type { Author, Shout, Topic } from '../../graphql/schema/core.gen'
import { clsx } from 'clsx'
import { For, Show } from 'solid-js'
@ -16,7 +16,7 @@ import styles from './Beside.module.scss'
type Props = {
title?: string
values: (Shout | User | Topic | Author)[]
values: (Shout | Topic | Author)[]
beside: Shout
wrapper: 'topic' | 'author' | 'article' | 'top-article'
isTopicCompact?: boolean
@ -68,7 +68,7 @@ export const Beside = (props: Props) => {
})}
>
<For each={[...props.values]}>
{(value: Partial<Shout | User | Topic>) => (
{(value: Partial<Shout | Author | Topic>) => (
<li classList={{ [styles.top]: props.wrapper.startsWith('top-') }}>
<Show when={props.wrapper === 'topic'}>
<TopicCard

View File

@ -130,7 +130,7 @@ export const Sidebar = () => {
classList={{ [styles.unread]: checkAuthorIsSeen(author.slug) }}
>
<div class={styles.sidebarItemName}>
<Userpic name={author.name} userpic={author.userpic} size="XS" class={styles.userpic} />
<Userpic name={author.name} userpic={author.pic} size="XS" class={styles.userpic} />
<div class={styles.sidebarItemNameLabel}>{author.name}</div>
</div>
</a>

View File

@ -1,4 +1,4 @@
import type { Chat } from '../../graphql/schema/core.gen'
import type { Chat } from '../../graphql/schema/chat.gen'
import DialogCard from './DialogCard'

View File

@ -1,4 +1,4 @@
import type { ChatMember } from '../../graphql/schema/core.gen'
import type { ChatMember } from '../../graphql/schema/chat.gen'
import { clsx } from 'clsx'
import { For } from 'solid-js'
@ -29,7 +29,7 @@ const GroupDialogAvatar = (props: Props) => {
bordered={true}
size="small"
name={user.name}
url={user.userpic}
url={user.pic}
/>
)}
</For>

View File

@ -15,7 +15,7 @@ type DialogProps = {
const InviteUser = (props: DialogProps) => {
return (
<div class={styles.InviteUser} onClick={props.onClick}>
<DialogAvatar name={props.author.name} url={props.author.userpic} />
<DialogAvatar name={props.author.name} url={props.author.pic} />
<div class={styles.name}>{props.author.name}</div>
<div class={styles.action}>{props.selected ? <Icon name="cross" /> : <Icon name="plus" />}</div>
</div>

View File

@ -31,7 +31,7 @@ export const Message = (props: Props) => {
<div class={clsx(styles.Message, isOwn && styles.own)}>
<Show when={!isOwn && user}>
<div class={styles.author}>
<DialogAvatar size="small" name={user.name} url={user.userpic} />
<DialogAvatar size="small" name={user.name} url={user.pic} />
<div class={styles.name}>{user.name}</div>
</div>
</Show>

View File

@ -13,7 +13,7 @@ import { useArticlesStore, resetSortedArticles } from '../../../stores/zine/arti
import { useTopAuthorsStore } from '../../../stores/zine/topAuthors'
import { useTopicsStore } from '../../../stores/zine/topics'
import { getImageUrl } from '../../../utils/getImageUrl'
import { getServerDate } from '../../../utils/getServerDate'
import { getUnixtime } from '../../../utils/getServerDate'
import { DropDown } from '../../_shared/DropDown'
import { Icon } from '../../_shared/Icon'
import { Loading } from '../../_shared/Loading'
@ -54,19 +54,21 @@ const getOrderBy = (by: FeedSearchParams['by']) => {
return ''
}
const getFromDate = (period: FeedPeriod): Date => {
const getFromDate = (period: FeedPeriod): number => {
const now = new Date()
let d: Date = now
switch (period) {
case 'week': {
return new Date(now.setDate(now.getDate() - 7))
d = new Date(now.setDate(now.getDate() - 7))
}
case 'month': {
return new Date(now.setMonth(now.getMonth() - 1))
d = new Date(now.setMonth(now.getMonth() - 1))
}
case 'year': {
return new Date(now.setFullYear(now.getFullYear() - 1))
d = new Date(now.setFullYear(now.getFullYear() - 1))
}
}
return Math.floor(d.getTime() / 1000)
}
type Props = {
@ -153,8 +155,7 @@ export const FeedView = (props: Props) => {
if (searchParams().by && searchParams().by !== 'publish_date') {
const period = searchParams().period || 'month'
const fromDate = getFromDate(period)
options.filters = { fromDate: getServerDate(fromDate) }
options.filters = { after: getFromDate(period) }
}
return props.loadShouts(options)

View File

@ -21,7 +21,6 @@ import {
MutationUpdate_MessageArgs,
QueryLoad_ChatsArgs,
QueryLoad_Messages_ByArgs,
QueryLoad_RecipientsArgs,
} from '../schema/chat.gen'
export const inboxClient = {
@ -72,8 +71,4 @@ export const inboxClient = {
const resp = await inboxClient.private.query(chatMessagesLoadBy, options).toPromise()
return resp.data.load_messages_by.messages
},
loadRecipients: async (options: QueryLoad_RecipientsArgs) => {
const resp = await inboxClient.private.query(loadRecipients, options).toPromise()
return resp.data.load_recipients.members
},
}

View File

@ -1,4 +1,4 @@
import type { Author, Shout, Topic } from '../graphql/types.gen'
import type { Author, Shout, Topic } from '../graphql/schema/core.gen'
export const groupByName = (arr: Author[]) => {
return arr.reduce(

View File

@ -1,4 +1,4 @@
import type { Author, Reaction, Shout, Stat, Topic, TopicStat } from '../graphql/types.gen'
import type { Author, Reaction, Shout, Stat, Topic, TopicStat } from '../graphql/schema/core.gen'
export const byFirstChar = (a, b) => (a.name || a.title || '').localeCompare(b.name || b.title || '')