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