Code style fixes

This commit is contained in:
kvakazyambra 2024-05-11 20:33:40 +03:00
parent 0664b5c933
commit 7d69c55963
3 changed files with 28 additions and 19 deletions

View File

@ -3,11 +3,11 @@ import { For, Show } from 'solid-js'
import { useLocalize } from '../../../context/localize' import { useLocalize } from '../../../context/localize'
import { useSession } from '../../../context/session' import { useSession } from '../../../context/session'
import { Icon } from '../../_shared/Icon'
import styles from './Placeholder.module.scss' import styles from './Placeholder.module.scss'
import {Icon} from "../../_shared/Icon";
export type PlaceholderProps = { export type PlaceholderProps = {
type: string, type: string
mode: 'feed' | 'profile' mode: 'feed' | 'profile'
} }
@ -46,9 +46,9 @@ export const Placeholder = (props: PlaceholderProps) => {
profileLinks: [ profileLinks: [
{ {
href: '/how-to-write-a-good-article', href: '/how-to-write-a-good-article',
label: t('How to write a good article') label: t('How to write a good article'),
} },
] ],
}, },
authorComments: { authorComments: {
image: 'placeholder-discussions.webp', image: 'placeholder-discussions.webp',
@ -59,18 +59,24 @@ export const Placeholder = (props: PlaceholderProps) => {
profileLinks: [ profileLinks: [
{ {
href: '/about/discussion-rules', href: '/about/discussion-rules',
label: t('Discussion rules') label: t('Discussion rules'),
}, },
{ {
href: '/about/discussion-rules#ban', href: '/about/discussion-rules#ban',
label: t('Block rules') label: t('Block rules'),
} },
] ],
}, },
} }
return ( return (
<div class={clsx(styles.placeholder, styles[`placeholder--${props.type}`], styles[`placeholder--${props.mode}-mode`])}> <div
class={clsx(
styles.placeholder,
styles[`placeholder--${props.type}`],
styles[`placeholder--${props.mode}-mode`],
)}
>
<div class={styles.placeholderCover}> <div class={styles.placeholderCover}>
<img src={`/public/${data[props.type].image}`} /> <img src={`/public/${data[props.type].image}`} />
</div> </div>

View File

@ -27,8 +27,8 @@ import { Loading } from '../../_shared/Loading'
import { MODALS, hideModal } from '../../../stores/ui' import { MODALS, hideModal } from '../../../stores/ui'
import { byCreated } from '../../../utils/sortby' import { byCreated } from '../../../utils/sortby'
import stylesArticle from '../../Article/Article.module.scss' import stylesArticle from '../../Article/Article.module.scss'
import { Placeholder } from '../../Feed/Placeholder'
import styles from './Author.module.scss' import styles from './Author.module.scss'
import {Placeholder} from "../../Feed/Placeholder";
type Props = { type Props = {
authorSlug: string authorSlug: string
@ -264,7 +264,6 @@ export const AuthorView = (props: Props) => {
<Placeholder type={getPage().route} mode="profile" /> <Placeholder type={getPage().route} mode="profile" />
</div> </div>
<div class="wide-container"> <div class="wide-container">
<div class="row"> <div class="row">
<div class="col-md-20 col-lg-18"> <div class="col-md-20 col-lg-18">
@ -285,7 +284,9 @@ export const AuthorView = (props: Props) => {
</div> </div>
</Match> </Match>
<Match when={getPage().route === 'author'}> <Match when={getPage().route === 'author'}>
<Show when={session()?.user?.app_data?.profile?.slug === props.authorSlug && !sortedArticles().length}> <Show
when={session()?.user?.app_data?.profile?.slug === props.authorSlug && !sortedArticles().length}
>
<div class="wide-container"> <div class="wide-container">
<Placeholder type={getPage().route} mode="profile" /> <Placeholder type={getPage().route} mode="profile" />
</div> </div>

View File

@ -235,8 +235,10 @@ export const FeedView = (props: Props) => {
</div> </div>
<div class="col-md-12 offset-xl-1"> <div class="col-md-12 offset-xl-1">
<Show when={author() || !sortedArticles().length} <Show
fallback={<Placeholder type={page().route} mode="feed" />}> when={author() || !sortedArticles().length}
fallback={<Placeholder type={page().route} mode="feed" />}
>
<div class={styles.filtersContainer}> <div class={styles.filtersContainer}>
<ul class={clsx('view-switcher', styles.feedFilter)}> <ul class={clsx('view-switcher', styles.feedFilter)}>
<li <li