From 76d43514e6822a3fecdf6f1a8df3d1effa09d424 Mon Sep 17 00:00:00 2001 From: kvakazyambra Date: Fri, 11 Nov 2022 11:58:22 +0300 Subject: [PATCH] Fixed all authors page --- src/components/Author/Card.module.scss | 40 +++++++++++++- src/components/Author/Card.tsx | 67 +++++++++++++++++------ src/components/Author/Userpic.module.scss | 14 ++++- src/components/Author/Userpic.tsx | 15 +++-- src/components/Views/AllAuthors.tsx | 9 +-- src/styles/AllTopics.module.scss | 13 +---- src/styles/app.scss | 7 +++ 7 files changed, 125 insertions(+), 40 deletions(-) diff --git a/src/components/Author/Card.module.scss b/src/components/Author/Card.module.scss index a68b6e5b..ad75417e 100644 --- a/src/components/Author/Card.module.scss +++ b/src/components/Author/Card.module.scss @@ -15,12 +15,24 @@ .authorDetails { display: flex; flex: 1; - padding-right: 1.2rem; + //padding-right: 1.2rem; width: max-content; + + @include media-breakpoint-down(sm) { + flex-wrap: wrap; + } } .authorDetailsWrapper { - flex: 1; + flex: 1 100%; + + @include media-breakpoint-up(sm) { + flex: 1; + } + + @include media-breakpoint-up(md) { + padding-right: 1.2rem; + } } .authorName { @@ -33,6 +45,7 @@ .authorAbout { font-size: 1.5rem; color: rgb(0 0 0 / 60%); + word-break: break-word; } .authorSubscribe { @@ -118,6 +131,10 @@ button { margin-right: 0.5em; + + &:last-child { + margin-right: 0; + } } } @@ -221,3 +238,22 @@ vertical-align: middle; } } + +.authorsListItem { + .authorName { + @include font-size(2.2rem); + font-weight: bold; + } + + .authorSubscribe { + align-items: baseline; + + @include media-breakpoint-down(sm) { + padding: 1rem 0 0; + } + } + + .buttonLabel { + display: block; + } +} diff --git a/src/components/Author/Card.tsx b/src/components/Author/Card.tsx index 4608163c..4477ee34 100644 --- a/src/components/Author/Card.tsx +++ b/src/components/Author/Card.tsx @@ -1,7 +1,7 @@ import type { Author } from '../../graphql/types.gen' import Userpic from './Userpic' import { Icon } from '../Nav/Icon' -import style from './Card.module.scss' +import styles from './Card.module.scss' import { createMemo, For, Show } from 'solid-js' import { translit } from '../../utils/ru2en' import { t } from '../../utils/intl' @@ -19,6 +19,7 @@ interface AuthorCardProps { author: Author isAuthorPage?: boolean noSocialButtons?: boolean + isAuthorsList?: boolean } export const AuthorCard = (props: AuthorCardProps) => { @@ -36,51 +37,81 @@ export const AuthorCard = (props: AuthorCardProps) => { } // TODO: reimplement AuthorCard return ( -
- +
+ -
-
+
+
- + {name()} -
{name()}
+
{name()}
-
{bio()}
+
+ {bio()} +
-
+
follow} - class={clsx('button button--subscribe', style.button, style.buttonSubscribe)} + class={clsx('button', styles.button)} + classList={{ + [styles.buttonSubscribe]: !props.isAuthorsList, + 'button--subscribe': !props.isAuthorsList, + 'button--subscribe-topic': props.isAuthorsList, + [styles.buttonWrite]: props.isAuthorsList + }} > - -  {t('Follow')} + + +   + + {t('Follow')} } > - - diff --git a/src/components/Author/Userpic.module.scss b/src/components/Author/Userpic.module.scss index 7006922a..20ed085e 100644 --- a/src/components/Author/Userpic.module.scss +++ b/src/components/Author/Userpic.module.scss @@ -20,7 +20,7 @@ border: 2px solid black; background-color: white; text-align: center; - line-height: 32px; + line-height: 28px; } .anonymous { @@ -47,3 +47,15 @@ width: 100%; } } + +.authorsList { + margin-right: 2.4rem; + max-height: 6.8rem; + min-width: 6.8rem; + height: 6.8rem; + width: 6.8rem; + + .userpic { + line-height: 6.4rem; + } +} diff --git a/src/components/Author/Userpic.tsx b/src/components/Author/Userpic.tsx index 0ed8744a..75dc918b 100644 --- a/src/components/Author/Userpic.tsx +++ b/src/components/Author/Userpic.tsx @@ -1,6 +1,6 @@ import { Show } from 'solid-js' import type { Author } from '../../graphql/types.gen' -import style from './Userpic.module.scss' +import styles from './Userpic.module.scss' import { clsx } from 'clsx' interface UserpicProps { @@ -8,6 +8,7 @@ interface UserpicProps { hasLink?: boolean isBig?: boolean class?: string + isAuthorsList?: boolean } export default (props: UserpicProps) => { @@ -18,7 +19,13 @@ export default (props: UserpicProps) => { } return ( -
+
{ /> } > -
{letters()}
+
{letters()}
@@ -47,7 +54,7 @@ export default (props: UserpicProps) => { /> } > -
{letters()}
+
{letters()}
diff --git a/src/components/Views/AllAuthors.tsx b/src/components/Views/AllAuthors.tsx index 070738ba..576bc1b9 100644 --- a/src/components/Views/AllAuthors.tsx +++ b/src/components/Views/AllAuthors.tsx @@ -60,15 +60,15 @@ export const AllAuthorsView = (props: Props) => {