types-fixed
This commit is contained in:
parent
11788bcf0d
commit
bd1b0025e7
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { Chat } from '../../graphql/schema/core.gen'
|
||||
import type { Chat } from '../../graphql/schema/chat.gen'
|
||||
|
||||
import DialogCard from './DialogCard'
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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 || '')
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user