footer-fix

This commit is contained in:
Untone 2024-02-24 13:50:14 +03:00
parent 93f6a1b080
commit 8fbcde234e
9 changed files with 16 additions and 17 deletions

View File

@ -46,7 +46,7 @@ export const Comment = (props: Props) => {
const canEdit = createMemo( const canEdit = createMemo(
() => () =>
Boolean(author()?.id) && Boolean(author()?.id) &&
(props.comment?.created_by?.id === author().id || session()?.user?.roles.includes('editor')), (props.comment?.created_by?.id === author().id || session()?.user?.roles.includes('editor'))
) )
const comment = createMemo(() => props.comment) const comment = createMemo(() => props.comment)

View File

@ -83,7 +83,7 @@ export const FullArticle = (props: Props) => {
Boolean(author()?.id) && Boolean(author()?.id) &&
(props.article?.authors?.some((a) => Boolean(a) && a?.id === author().id) || (props.article?.authors?.some((a) => Boolean(a) && a?.id === author().id) ||
props.article?.created_by?.id === author().id || props.article?.created_by?.id === author().id ||
session()?.user?.roles.includes('editor')), session()?.user?.roles.includes('editor'))
) )
const mainTopic = createMemo(() => { const mainTopic = createMemo(() => {

View File

@ -28,7 +28,7 @@ export const AuthorsList = (props: Props) => {
const result = await apiClient.loadAuthorsBy({ const result = await apiClient.loadAuthorsBy({
by: { order: queryType }, by: { order: queryType },
limit: PAGE_SIZE, limit: PAGE_SIZE,
offset: offset, offset: offset
}) })
if (queryType === 'shouts') { if (queryType === 'shouts') {
@ -44,7 +44,7 @@ export const AuthorsList = (props: Props) => {
const queryType = props.query const queryType = props.query
const nextPage = currentPage()[queryType] + 1 const nextPage = currentPage()[queryType] + 1
fetchAuthors(queryType, nextPage).then(() => fetchAuthors(queryType, nextPage).then(() =>
setCurrentPage({ ...currentPage(), [queryType]: nextPage }), setCurrentPage({ ...currentPage(), [queryType]: nextPage })
) )
} }
@ -70,7 +70,7 @@ export const AuthorsList = (props: Props) => {
author={author} author={author}
isFollowed={{ isFollowed={{
loaded: !loading(), loaded: !loading(),
value: isOwnerSubscribed(author.id), value: isOwnerSubscribed(author.id)
}} }}
/> />
</div> </div>

View File

@ -125,7 +125,7 @@ export const ArticleCard = (props: ArticleCardProps) => {
Boolean(author()?.id) && Boolean(author()?.id) &&
(props.article?.authors?.some((a) => Boolean(a) && a?.id === author().id) || (props.article?.authors?.some((a) => Boolean(a) && a?.id === author().id) ||
props.article?.created_by?.id === author().id || props.article?.created_by?.id === author().id ||
session()?.user?.roles.includes('editor')), session()?.user?.roles.includes('editor'))
) )
const scrollToComments = (event) => { const scrollToComments = (event) => {

View File

@ -1 +0,0 @@

View File

@ -33,7 +33,7 @@ export const AllAuthors = (props: Props) => {
const { searchParams, changeSearchParams } = useRouter<AllAuthorsPageSearchParams>() const { searchParams, changeSearchParams } = useRouter<AllAuthorsPageSearchParams>()
const { sortedAuthors } = useAuthorsStore({ const { sortedAuthors } = useAuthorsStore({
authors: props.authors, authors: props.authors,
sortBy: searchParams().by || 'name', sortBy: searchParams().by || 'name'
}) })
const [searchQuery, setSearchQuery] = createSignal('') const [searchQuery, setSearchQuery] = createSignal('')
@ -51,7 +51,7 @@ export const AllAuthors = (props: Props) => {
const byLetter = createMemo<{ [letter: string]: Author[] }>(() => { const byLetter = createMemo<{ [letter: string]: Author[] }>(() => {
return sortedAuthors().reduce( return sortedAuthors().reduce(
(acc, author) => authorLetterReduce(acc, author, lang()), (acc, author) => authorLetterReduce(acc, author, lang()),
{} as { [letter: string]: Author[] }, {} as { [letter: string]: Author[] }
) )
}) })
@ -87,21 +87,21 @@ export const AllAuthors = (props: Props) => {
<ul class={clsx(styles.viewSwitcher, 'view-switcher')}> <ul class={clsx(styles.viewSwitcher, 'view-switcher')}>
<li <li
class={clsx({ class={clsx({
['view-switcher__item--selected']: !searchParams().by || searchParams().by === 'shouts', ['view-switcher__item--selected']: !searchParams().by || searchParams().by === 'shouts'
})} })}
> >
<a href="/authors?by=shouts">{t('By shouts')}</a> <a href="/authors?by=shouts">{t('By shouts')}</a>
</li> </li>
<li <li
class={clsx({ class={clsx({
['view-switcher__item--selected']: searchParams().by === 'followers', ['view-switcher__item--selected']: searchParams().by === 'followers'
})} })}
> >
<a href="/authors?by=followers">{t('By popularity')}</a> <a href="/authors?by=followers">{t('By popularity')}</a>
</li> </li>
<li <li
class={clsx({ class={clsx({
['view-switcher__item--selected']: searchParams().by === 'name', ['view-switcher__item--selected']: searchParams().by === 'name'
})} })}
> >
<a href="/authors?by=name">{t('By name')}</a> <a href="/authors?by=name">{t('By name')}</a>

View File

@ -72,7 +72,7 @@ export const AuthorView = (props: Props) => {
try { try {
const [subscriptionsResult, followersResult] = await Promise.all([ const [subscriptionsResult, followersResult] = await Promise.all([
apiClient.getAuthorFollows({ slug }), apiClient.getAuthorFollows({ slug }),
apiClient.getAuthorFollowers({ slug }), apiClient.getAuthorFollowers({ slug })
]) ])
const { authors, topics } = subscriptionsResult const { authors, topics } = subscriptionsResult

View File

@ -108,8 +108,8 @@ export const SessionProvider = (props: {
changeSearchParams({ mode: 'confirm-email', m: 'auth' }, true) changeSearchParams({ mode: 'confirm-email', m: 'auth' }, true)
} }
}, },
{ defer: true }, { defer: true }
), )
) )
// handle token confirm // handle token confirm
@ -120,7 +120,7 @@ export const SessionProvider = (props: {
changeSearchParams({ changeSearchParams({
mode: 'confirm-email', mode: 'confirm-email',
m: 'auth', m: 'auth',
access_token, access_token
}) })
else if (token) changeSearchParams({ mode: 'change-password', modal: 'auth', token }) else if (token) changeSearchParams({ mode: 'change-password', modal: 'auth', token })
}) })

View File

@ -236,5 +236,5 @@ export const apiClient = {
.query(reactionsLoadBy, { by, limit: limit ?? 1000, offset: offset ?? 0 }) .query(reactionsLoadBy, { by, limit: limit ?? 1000, offset: offset ?? 0 })
.toPromise() .toPromise()
return resp.data.load_reactions_by return resp.data.load_reactions_by
}, }
} }