Code style fixes
This commit is contained in:
parent
0664b5c933
commit
7d69c55963
|
@ -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,25 +59,31 @@ 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>
|
||||||
<div class={styles.placeholderContent}>
|
<div class={styles.placeholderContent}>
|
||||||
<div>
|
<div>
|
||||||
<h3 innerHTML={data[props.type].header}/>
|
<h3 innerHTML={data[props.type].header} />
|
||||||
<p innerHTML={data[props.type].text}/>
|
<p innerHTML={data[props.type].text} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Show when={data[props.type].profileLinks}>
|
<Show when={data[props.type].profileLinks}>
|
||||||
|
@ -85,7 +91,7 @@ export const Placeholder = (props: PlaceholderProps) => {
|
||||||
<For each={data[props.type].profileLinks}>
|
<For each={data[props.type].profileLinks}>
|
||||||
{(link) => (
|
{(link) => (
|
||||||
<a href={link.href}>
|
<a href={link.href}>
|
||||||
<Icon name="link-white" class={styles.icon}/>
|
<Icon name="link-white" class={styles.icon} />
|
||||||
{link.label}
|
{link.label}
|
||||||
</a>
|
</a>
|
||||||
)}
|
)}
|
||||||
|
@ -104,7 +110,7 @@ export const Placeholder = (props: PlaceholderProps) => {
|
||||||
<a class={styles.button} href={data[props.type].href}>
|
<a class={styles.button} href={data[props.type].href}>
|
||||||
{data[props.type].buttonLabel}
|
{data[props.type].buttonLabel}
|
||||||
<Show when={props.mode === 'profile'}>
|
<Show when={props.mode === 'profile'}>
|
||||||
<Icon name="arrow-right-2" class={styles.icon}/>
|
<Icon name="arrow-right-2" class={styles.icon} />
|
||||||
</Show>
|
</Show>
|
||||||
</a>
|
</a>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user