Placeholders fixes

This commit is contained in:
kvakazyambra 2024-05-19 01:03:06 +03:00
parent 18a23ee0f8
commit f22d10a535
5 changed files with 85 additions and 54 deletions

View File

@ -17,6 +17,7 @@
display: flex; display: flex;
@include font-size(1.5rem); @include font-size(1.5rem);
gap: 0.6rem; gap: 0.6rem;
justify-content: center;
margin-top: 3rem; margin-top: 3rem;
padding: 1rem 2rem; padding: 1rem 2rem;
width: 100%; width: 100%;
@ -29,10 +30,18 @@
} }
.placeholder--feed-mode { .placeholder--feed-mode {
aspect-ratio: 1 / 0.8;
flex-direction: column; flex-direction: column;
min-height: 40rem;
text-align: center; text-align: center;
@include media-breakpoint-up(lg) {
aspect-ratio: 1 / 0.8;
}
.placeholderCover {
flex: 1 100%;
position: relative;
&:after { &:after {
bottom: 0; bottom: 0;
content: ''; content: '';
@ -40,35 +49,44 @@
left: 0; left: 0;
position: absolute; position: absolute;
width: 100%; width: 100%;
.placeholder--feed & {
background: linear-gradient(to top, #171032, rgba(23, 16, 50, 0));
} }
.placeholder--feedCollaborations & {
background: linear-gradient(to top, #070709, rgba(7, 7, 9, 0));
}
}
.placeholderCover {
flex: 0 100%;
width: 100%;
img { img {
position: absolute; position: absolute;
} }
} }
&.placeholder--feedMy .placeholderCover:after {
background: linear-gradient(to top, #171032, rgba(23, 16, 50, 0));
}
&.placeholder--feedCollaborations .placeholderCover:after {
background: linear-gradient(to top, #070709, rgba(7, 7, 9, 0));
}
} }
.placeholder--profile-mode { .placeholder--profile-mode {
min-height: 40rem;
@include media-breakpoint-down(md) {
display: block;
}
@include media-breakpoint-up(md) {
min-height: 28rem; min-height: 28rem;
}
.placeholderCover { .placeholderCover {
flex: 0 45rem;
min-width: 45rem;
order: 2;
padding: 1.6rem; padding: 1.6rem;
@include media-breakpoint-up(md) {
flex: 0 45rem;
min-width: 50%;
order: 2;
position: static;
width: 45rem;
}
img { img {
height: auto; height: auto;
width: 100%; width: 100%;
@ -92,9 +110,15 @@
background: var(--background-color-invert); background: var(--background-color-invert);
color: var(--default-color-invert); color: var(--default-color-invert);
bottom: 2rem; bottom: 2rem;
position: absolute; left: 2rem;
right: 2rem; right: 2rem;
width: 100%;
@include media-breakpoint-up(md) {
left: auto;
position: absolute;
width: auto; width: auto;
}
.icon { .icon {
filter: invert(1); filter: invert(1);
@ -117,7 +141,7 @@
padding: 1.6rem; padding: 1.6rem;
} }
.placeholder--feed, .placeholder--feedMy,
.placeholder--feedCollaborations { .placeholder--feedCollaborations {
color: var(--default-color-invert); color: var(--default-color-invert);
@ -128,7 +152,7 @@
} }
} }
.placeholder--feed { .placeholder--feedMy {
background: #171032; background: #171032;
.placeholderCover { .placeholderCover {
@ -190,6 +214,11 @@
@include font-size(1.6rem); @include font-size(1.6rem);
gap: 4rem; gap: 4rem;
@include media-breakpoint-down(sm) {
flex-direction: column;
gap: 1.4rem;
}
a { a {
border: none !important; border: none !important;
padding-left: 2.6rem; padding-left: 2.6rem;

View File

@ -16,7 +16,7 @@ export const Placeholder = (props: PlaceholderProps) => {
const { author } = useSession() const { author } = useSession()
const data = { const data = {
feed: { feedMy: {
image: 'placeholder-feed.webp', image: 'placeholder-feed.webp',
header: t('Feed settings'), header: t('Feed settings'),
text: t('Placeholder feed'), text: t('Placeholder feed'),

View File

@ -260,10 +260,13 @@ export const AuthorView = (props: Props) => {
</div> </div>
</Match> </Match>
<Match when={getPage().route === 'authorComments'}> <Match when={getPage().route === 'authorComments'}>
<Show when={session()?.user?.app_data?.profile?.slug === props.authorSlug && !commented().length}>
<div class="wide-container"> <div class="wide-container">
<Placeholder type={getPage().route} mode="profile" /> <Placeholder type={getPage().route} mode="profile" />
</div> </div>
</Show>
<Show when={commented()}>
<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">
@ -282,6 +285,7 @@ export const AuthorView = (props: Props) => {
</div> </div>
</div> </div>
</div> </div>
</Show>
</Match> </Match>
<Match when={getPage().route === 'author'}> <Match when={getPage().route === 'author'}>
<Show <Show

View File

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

View File

@ -1,6 +1,5 @@
import { Match, Switch, createEffect, on, onCleanup } from 'solid-js' import { Match, Switch, createEffect, on, onCleanup } from 'solid-js'
import { AuthGuard } from '../components/AuthGuard'
import { Feed } from '../components/Views/Feed' import { Feed } from '../components/Views/Feed'
import { PageLayout } from '../components/_shared/PageLayout' import { PageLayout } from '../components/_shared/PageLayout'
import { useLocalize } from '../context/localize' import { useLocalize } from '../context/localize'
@ -48,9 +47,7 @@ export const FeedPage = () => {
<Feed loadShouts={handleFeedLoadShouts} /> <Feed loadShouts={handleFeedLoadShouts} />
</Match> </Match>
<Match when={page().route === 'feedMy'}> <Match when={page().route === 'feedMy'}>
<AuthGuard>
<Feed loadShouts={handleMyFeedLoadShouts} /> <Feed loadShouts={handleMyFeedLoadShouts} />
</AuthGuard>
</Match> </Match>
</Switch> </Switch>
</ReactionsProvider> </ReactionsProvider>