premerge
This commit is contained in:
parent
2d850f3c36
commit
a1ac9a52dd
|
@ -22,7 +22,7 @@ export const Userpic = (props: Props) => {
|
|||
const letters = () => {
|
||||
if (!props.name) return
|
||||
const names = props.name ? props.name.split(' ') : []
|
||||
return names[0][0] + (names.length > 1 ? names[1][0] : '')
|
||||
return names[0][0] + '.' + (names.length > 1 ? names[1][0] : '') + '.'
|
||||
}
|
||||
|
||||
const avatarSize = createMemo(() => {
|
||||
|
|
|
@ -24,7 +24,7 @@ export default () => {
|
|||
</div>
|
||||
<div class={clsx(styles.discoursBannerImage, 'col-lg-12 offset-lg-2')}>
|
||||
<Image
|
||||
src="https://images.discours.io/unsafe/production/image/discours-banner.jpg"
|
||||
src="https://cdn.discours.io/production/image/discours-banner.jpg"
|
||||
alt={t('Discours')}
|
||||
width={600}
|
||||
/>
|
||||
|
|
|
@ -40,8 +40,8 @@
|
|||
.authImage {
|
||||
@include font-size(1.5rem);
|
||||
|
||||
background: var(--background-color-invert)
|
||||
url('https://images.discours.io/unsafe/1600x/production/image/auth-page.jpg') center no-repeat;
|
||||
background: var(--background-color-invert) url('https://cdn.discours.io/production/image/auth-page.jpg')
|
||||
center no-repeat;
|
||||
background-size: cover;
|
||||
color: var(--default-color-invert);
|
||||
display: flex;
|
||||
|
|
|
@ -32,7 +32,7 @@ const MD_WIDTH_BREAKPOINT = 992
|
|||
export const HeaderAuth = (props: Props) => {
|
||||
const { t } = useLocalize()
|
||||
const { page } = useRouter()
|
||||
const { session, isSessionLoaded, isAuthenticated } = useSession()
|
||||
const { author, session, isSessionLoaded, isAuthenticated } = useSession()
|
||||
const {
|
||||
unreadNotificationsCount,
|
||||
actions: { showNotificationsPanel },
|
||||
|
@ -218,11 +218,11 @@ export const HeaderAuth = (props: Props) => {
|
|||
trigger={
|
||||
<div class={styles.userControlItem}>
|
||||
<button class={styles.button}>
|
||||
<div classList={{ entered: page().path === `/${session().user?.slug}` }}>
|
||||
<div classList={{ entered: page().path === `/${author()?.slug}` }}>
|
||||
<Userpic
|
||||
size={'M'}
|
||||
name={session().user.name}
|
||||
userpic={session().user.userpic}
|
||||
name={author().name}
|
||||
userpic={author().pic}
|
||||
class={styles.userpic}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -8,7 +8,7 @@ import { SearchView } from '../components/Views/Search'
|
|||
import { useLocalize } from '../context/localize'
|
||||
import { ReactionsProvider } from '../context/reactions'
|
||||
import { useRouter } from '../stores/router'
|
||||
import { loadShouts, resetSortedArticles } from '../stores/zine/articles'
|
||||
import { loadShoutsSearch, resetSortedArticles } from '../stores/zine/articles'
|
||||
|
||||
export const SearchPage = (props: PageProps) => {
|
||||
const [isLoaded, setIsLoaded] = createSignal(Boolean(props.searchResults))
|
||||
|
@ -24,7 +24,7 @@ export const SearchPage = (props: PageProps) => {
|
|||
return
|
||||
}
|
||||
|
||||
await loadShouts({ filters: { title: q(), body: q() }, limit: 50, offset: 0 })
|
||||
await loadShoutsSearch({ text: q(), limit: 50, offset: 0 })
|
||||
setIsLoaded(true)
|
||||
})
|
||||
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
import type { Author, Shout, ShoutInput, LoadShoutsOptions } from '../../graphql/schema/core.gen'
|
||||
import type {
|
||||
Author,
|
||||
Shout,
|
||||
ShoutInput,
|
||||
LoadShoutsOptions,
|
||||
QueryLoad_Shouts_SearchArgs,
|
||||
} from '../../graphql/schema/core.gen'
|
||||
|
||||
import { createLazyMemo } from '@solid-primitives/memo'
|
||||
import { createSignal } from 'solid-js'
|
||||
|
@ -168,6 +174,23 @@ export const loadMyFeed = async (
|
|||
return { hasMore, newShouts }
|
||||
}
|
||||
|
||||
export const loadShoutsSearch = async (
|
||||
options: QueryLoad_Shouts_SearchArgs,
|
||||
): Promise<{ hasMore: boolean; newShouts: Shout[] }> => {
|
||||
options.limit += 1
|
||||
const newShouts = await apiClient.getShoutsSearch(options)
|
||||
const hasMore = newShouts ?? newShouts.length === options.limit + 1
|
||||
|
||||
if (hasMore) {
|
||||
newShouts.splice(-1)
|
||||
}
|
||||
|
||||
addArticles(newShouts)
|
||||
addSortedArticles(newShouts)
|
||||
|
||||
return { hasMore, newShouts }
|
||||
}
|
||||
|
||||
export const resetSortedArticles = () => {
|
||||
setSortedArticles([])
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user