Merge branch 'main' of https://github.com/Discours/discoursio-webapp into feature/sse-test

This commit is contained in:
Tony Rewin 2023-10-10 01:27:59 +03:00
commit 9cedb23ccf
14 changed files with 137 additions and 65 deletions

View File

@ -98,6 +98,10 @@
} }
} }
.commentControlDelete {
align-items: center;
}
.commentControl { .commentControl {
border: none; border: none;
color: #696969; color: #696969;
@ -106,7 +110,10 @@
line-height: 1.2; line-height: 1.2;
margin-right: 0.8rem; margin-right: 0.8rem;
padding: 0.2em 0.3em; padding: 0.2em 0.3em;
transition: opacity 0.2s, color 0.3s, background-color 0.3s; transition:
opacity 0.2s,
color 0.3s,
background-color 0.3s;
vertical-align: top; vertical-align: top;
&:hover { &:hover {
@ -123,7 +130,9 @@
filter: invert(0); filter: invert(0);
margin-right: 0.3em; margin-right: 0.3em;
opacity: 0.6; opacity: 0.6;
transition: filter 0.3s, opacity 0.2s; transition:
filter 0.3s,
opacity 0.2s;
img { img {
margin-bottom: -0.1em; margin-bottom: -0.1em;

View File

@ -1,15 +1,26 @@
.AuthorBadge { .AuthorBadge {
align-items: flex-start;
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
align-items: flex-start; margin-bottom: 2rem;
margin-bottom: 1rem;
@include media-breakpoint-down(sm) {
flex-wrap: wrap;
margin-bottom: 3rem;
}
.info { .info {
@include font-size(1.4rem); @include font-size(1.4rem);
display: flex;
flex-direction: column;
border: none; border: none;
display: flex;
flex: 0 calc(100% - 5.2rem);
flex-direction: column;
line-height: 1.3;
margin-bottom: 1rem;
@include media-breakpoint-up(sm) {
flex: 1 100%;
}
&:hover { &:hover {
background: unset; background: unset;
@ -26,7 +37,24 @@
} }
.actions { .actions {
flex: 0 20%;
margin-left: 5.2rem;
@include media-breakpoint-up(sm) {
margin-left: 2rem;
}
@include media-breakpoint-up(md) {
flex: 1;
margin-left: auto; margin-left: auto;
padding-left: 1rem; padding-left: 1rem;
text-align: right;
}
}
.subscribeButton {
border-radius: 0.8rem !important;
margin-right: 0 !important;
width: 9em;
} }
} }

View File

@ -44,7 +44,13 @@ export const AuthorBadge = (props: Props) => {
return ( return (
<div class={clsx(styles.AuthorBadge)}> <div class={clsx(styles.AuthorBadge)}>
<Userpic hasLink={true} isMedium={true} name={props.author.name} userpic={props.author.userpic} /> <Userpic
hasLink={true}
isMedium={true}
name={props.author.name}
userpic={props.author.userpic}
slug={props.author.slug}
/>
<a href={`/author/${props.author.slug}`} class={styles.info}> <a href={`/author/${props.author.slug}`} class={styles.info}>
<div class={styles.name}>{props.author.name}</div> <div class={styles.name}>{props.author.name}</div>
<Switch <Switch
@ -84,14 +90,16 @@ export const AuthorBadge = (props: Props) => {
size="S" size="S"
value={isSubscribing() ? t('...subscribing') : t('Subscribe')} value={isSubscribing() ? t('...subscribing') : t('Subscribe')}
onClick={() => handleSubscribe(true)} onClick={() => handleSubscribe(true)}
class={styles.subscribeButton}
/> />
} }
> >
<Button <Button
variant="secondary" variant="bordered"
size="S" size="S"
value={t('You are subscribed')} value={t('You are subscribed')}
onClick={() => handleSubscribe(false)} onClick={() => handleSubscribe(false)}
class={styles.subscribeButton}
/> />
</Show> </Show>
</Show> </Show>

View File

@ -52,6 +52,10 @@
@include media-breakpoint-between(md, lg) { @include media-breakpoint-between(md, lg) {
flex-wrap: wrap; flex-wrap: wrap;
.listWrapper & {
flex-wrap: nowrap;
}
} }
&.authorDetailsShrinked { &.authorDetailsShrinked {
@ -69,6 +73,10 @@
@include media-breakpoint-between(md, lg) { @include media-breakpoint-between(md, lg) {
flex: 1 0 100%; flex: 1 0 100%;
.listWrapper & {
flex: 1;
}
} }
@include media-breakpoint-up(md) { @include media-breakpoint-up(md) {
@ -82,9 +90,9 @@
.authorName { .authorName {
border: none !important; border: none !important;
display: block;
font-size: 1.6rem; font-size: 1.6rem;
font-weight: 500; font-weight: 500;
line-height: 2;
margin-bottom: 0.8rem; margin-bottom: 0.8rem;
.listWrapper &:before { .listWrapper &:before {
@ -669,30 +677,4 @@
.listWrapper { .listWrapper {
max-height: 70vh; max-height: 70vh;
//padding-right: 2rem;
:global(.row) {
margin-right: 0;
}
}
.switcherCounter {
align-items: center;
background: #f7f7f8;
border-radius: 0.8rem;
display: inline-flex;
font-size: 1.2rem;
font-weight: bold;
height: 2.2rem;
justify-content: center;
line-height: 2.2rem;
margin-left: 0.4rem;
min-width: 2.2rem;
padding: 0 0.6rem;
text-align: center;
}
:global(.view-switcher__item--selected) .switcherCounter {
background: #000;
color: #fff;
} }

View File

@ -401,13 +401,13 @@ export const AuthorCard = (props: Props) => {
<button type="button" onClick={() => setSubscriptionFilter('all')}> <button type="button" onClick={() => setSubscriptionFilter('all')}>
{t('All')} {t('All')}
</button> </button>
<span class={styles.switcherCounter}>{props.following.length}</span> <span class="view-switcher__counter">{props.following.length}</span>
</li> </li>
<li class={clsx({ 'view-switcher__item--selected': subscriptionFilter() === 'users' })}> <li class={clsx({ 'view-switcher__item--selected': subscriptionFilter() === 'users' })}>
<button type="button" onClick={() => setSubscriptionFilter('users')}> <button type="button" onClick={() => setSubscriptionFilter('users')}>
{t('Users')} {t('Users')}
</button> </button>
<span class={styles.switcherCounter}> <span class="view-switcher__counter">
{props.following.filter((s) => 'name' in s).length} {props.following.filter((s) => 'name' in s).length}
</span> </span>
</li> </li>
@ -415,7 +415,7 @@ export const AuthorCard = (props: Props) => {
<button type="button" onClick={() => setSubscriptionFilter('topics')}> <button type="button" onClick={() => setSubscriptionFilter('topics')}>
{t('Topics')} {t('Topics')}
</button> </button>
<span class={styles.switcherCounter}> <span class="view-switcher__counter">
{props.following.filter((s) => 'title' in s).length} {props.following.filter((s) => 'title' in s).length}
</span> </span>
</li> </li>

View File

@ -17,16 +17,6 @@
color: #fff !important; color: #fff !important;
} }
} }
a:before {
content: '';
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: 2;
}
} }
.shoutTopicFloorImportant { .shoutTopicFloorImportant {

View File

@ -55,6 +55,8 @@
} }
&.narrow { &.narrow {
left: 50%;
transform: translateX(-50%);
width: 100%; width: 100%;
@include media-breakpoint-up(sm) { @include media-breakpoint-up(sm) {
@ -73,6 +75,7 @@
} }
.modalInner { .modalInner {
height: 100%;
overflow: auto; overflow: auto;
padding: 5.4rem 2.4rem 2.4rem; padding: 5.4rem 2.4rem 2.4rem;
position: relative; position: relative;

View File

@ -78,7 +78,7 @@ export const TopicCard = (props: TopicProps) => {
<div <div
classList={{ classList={{
[clsx('col-sm-18 col-md-24 col-lg-14 col-xl-15', styles.topicDetails)]: props.isNarrow, [clsx('col-sm-18 col-md-24 col-lg-14 col-xl-15', styles.topicDetails)]: props.isNarrow,
[clsx('col-12 col-xs-17 col-md-18', styles.topicDetails)]: props.compact, [clsx('col-24 col-sm-17 col-md-18', styles.topicDetails)]: props.compact,
[clsx('col-sm-17 col-md-18', styles.topicDetails)]: [clsx('col-sm-17 col-md-18', styles.topicDetails)]:
!props.subscribeButtonBottom && !props.isNarrow && !props.compact !props.subscribeButtonBottom && !props.isNarrow && !props.compact
}} }}
@ -122,7 +122,7 @@ export const TopicCard = (props: TopicProps) => {
class={styles.controlContainer} class={styles.controlContainer}
classList={{ classList={{
'col-sm-6 col-md-24 col-lg-10 col-xl-9': props.isNarrow, 'col-sm-6 col-md-24 col-lg-10 col-xl-9': props.isNarrow,
'col-12 col-xs-7 col-md-6': props.compact, 'col-24 col-sm-7 col-md-6': props.compact,
'col-sm-7 col-md-6': !props.subscribeButtonBottom && !props.isNarrow && !props.compact 'col-sm-7 col-md-6': !props.subscribeButtonBottom && !props.isNarrow && !props.compact
}} }}
> >

View File

@ -2,8 +2,12 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: flex-start; align-items: flex-start;
gap: 1rem; margin-bottom: 2rem;
margin-bottom: 1rem;
@include media-breakpoint-down(sm) {
flex-wrap: wrap;
margin-bottom: 3rem;
}
.picture { .picture {
display: block; display: block;
@ -16,6 +20,7 @@
background-position: 50% 50%; background-position: 50% 50%;
background-repeat: no-repeat; background-repeat: no-repeat;
border: none; border: none;
margin-right: 1.2rem;
&:hover { &:hover {
background-color: var(--black-50); background-color: var(--black-50);
@ -27,10 +32,16 @@
} }
.info { .info {
display: flex;
flex-direction: column;
border: none; border: none;
display: flex;
flex: 0 calc(100% - 5.2rem);
flex-direction: column;
@include font-size(1.4rem); @include font-size(1.4rem);
margin-bottom: 1rem;
@include media-breakpoint-up(sm) {
flex: 1 100%;
}
&:hover { &:hover {
background: unset; background: unset;
@ -48,7 +59,24 @@
} }
.actions { .actions {
flex: 0 20%;
margin-left: 5.2rem;
@include media-breakpoint-up(sm) {
margin-left: 2rem;
}
@include media-breakpoint-up(md) {
flex: 1;
margin-left: auto; margin-left: auto;
padding-left: 1rem; padding-left: 1rem;
text-align: right;
}
}
.subscribeButton {
border-radius: 0.8rem !important;
margin-right: 0 !important;
width: 9em;
} }
} }

View File

@ -83,14 +83,16 @@ export const TopicBadge = (props: Props) => {
size="S" size="S"
value={isSubscribing() ? t('...subscribing') : t('Subscribe')} value={isSubscribing() ? t('...subscribing') : t('Subscribe')}
onClick={() => subscribe(true)} onClick={() => subscribe(true)}
class={styles.subscribeButton}
/> />
} }
> >
<Button <Button
onClick={() => subscribe(false)} onClick={() => subscribe(false)}
variant="secondary" variant="bordered"
size="S" size="S"
value={t('You are subscribed')} value={t('You are subscribed')}
class={styles.subscribeButton}
/> />
</Show> </Show>
</Show> </Show>

View File

@ -17,6 +17,7 @@
border-bottom: 2px solid #000; border-bottom: 2px solid #000;
margin-bottom: 2.4rem; margin-bottom: 2.4rem;
padding-bottom: 4rem; padding-bottom: 4rem;
padding-top: 2.6rem;
} }
.ratingContainer { .ratingContainer {

View File

@ -138,14 +138,14 @@ export const AuthorView = (props: Props) => {
<div class="col-md-16"> <div class="col-md-16">
<ul class="view-switcher"> <ul class="view-switcher">
<li classList={{ 'view-switcher__item--selected': page().route === 'author' }}> <li classList={{ 'view-switcher__item--selected': page().route === 'author' }}>
<a href={getPagePath(router, 'author', { slug: props.authorSlug })}> <a href={getPagePath(router, 'author', { slug: props.authorSlug })}>{t('Publications')}</a>
{t('Publications')}&nbsp;({author().stat.shouts}) <span class="view-switcher__counter">{author().stat.shouts}</span>
</a>
</li> </li>
<li classList={{ 'view-switcher__item--selected': page().route === 'authorComments' }}> <li classList={{ 'view-switcher__item--selected': page().route === 'authorComments' }}>
<a href={getPagePath(router, 'authorComments', { slug: props.authorSlug })}> <a href={getPagePath(router, 'authorComments', { slug: props.authorSlug })}>
{t('Comments')}&nbsp;({author().stat.commented}) {t('Comments')}
</a> </a>
<span class="view-switcher__counter">{author().stat.commented}</span>
</li> </li>
<li classList={{ 'view-switcher__item--selected': page().route === 'authorAbout' }}> <li classList={{ 'view-switcher__item--selected': page().route === 'authorAbout' }}>
<a <a

View File

@ -118,6 +118,6 @@
height: 32px; height: 32px;
min-width: 53px; min-width: 53px;
font-size: 15px; font-size: 15px;
padding: 8px 16px; padding: 1rem 1.2rem;
} }
} }

View File

@ -651,6 +651,27 @@ figure {
} }
} }
.view-switcher__counter {
align-items: center;
background: #f7f7f8;
border-radius: 0.8rem;
display: inline-flex;
font-size: 1.2rem;
font-weight: bold;
height: 2.2rem;
justify-content: center;
line-height: 2.2rem;
margin-left: 0.4rem;
min-width: 2.2rem;
padding: 0 0.6rem;
text-align: center;
.view-switcher__item--selected & {
background: #000;
color: #fff;
}
}
.view-switcher__search { .view-switcher__search {
flex: 1 100%; flex: 1 100%;
text-align: right; text-align: right;