From 8e6b70eb7e2a83e849dabe085814171aa62a2868 Mon Sep 17 00:00:00 2001 From: Ilya Y <75578537+ilya-bkv@users.noreply.github.com> Date: Fri, 13 Oct 2023 09:10:24 +0300 Subject: [PATCH] Fix profile markup (#259) --- .../Article/AudioHeader/AudioHeader.tsx | 2 - .../Author/AuthorCard/AuthorCard.module.scss | 7 +- .../Author/AuthorCard/AuthorCard.tsx | 559 +++++++++--------- .../Views/Author/Author.module.scss | 7 +- 4 files changed, 284 insertions(+), 291 deletions(-) diff --git a/src/components/Article/AudioHeader/AudioHeader.tsx b/src/components/Article/AudioHeader/AudioHeader.tsx index 252ddc66..09f80bd9 100644 --- a/src/components/Article/AudioHeader/AudioHeader.tsx +++ b/src/components/Article/AudioHeader/AudioHeader.tsx @@ -5,8 +5,6 @@ import { MediaItem } from '../../../pages/types' import { createSignal, Show } from 'solid-js' import { Icon } from '../../_shared/Icon' import { Topic } from '../../../graphql/types.gen' -import { getPagePath } from '@nanostores/router' -import { router } from '../../../stores/router' import { CardTopic } from '../../Feed/CardTopic' type Props = { diff --git a/src/components/Author/AuthorCard/AuthorCard.module.scss b/src/components/Author/AuthorCard/AuthorCard.module.scss index 84609c03..240e4be2 100644 --- a/src/components/Author/AuthorCard/AuthorCard.module.scss +++ b/src/components/Author/AuthorCard/AuthorCard.module.scss @@ -625,7 +625,7 @@ display: flex; flex-wrap: wrap; font-size: 1.4rem; - margin-top: 0.5rem; + margin-top: 1.5rem; gap: 1rem; @include media-breakpoint-down(md) { @@ -637,7 +637,6 @@ align-items: center; cursor: pointer; display: inline-flex; - margin-top: 1rem; margin-right: 3rem; vertical-align: top; border-bottom: unset !important; @@ -669,10 +668,6 @@ .subscribersCounter { font-weight: 500; margin-left: -0.6rem; - - &:hover { - color: #696969; - } } .listWrapper { diff --git a/src/components/Author/AuthorCard/AuthorCard.tsx b/src/components/Author/AuthorCard/AuthorCard.tsx index 8516cde4..4395d96d 100644 --- a/src/components/Author/AuthorCard/AuthorCard.tsx +++ b/src/components/Author/AuthorCard/AuthorCard.tsx @@ -126,192 +126,168 @@ export const AuthorCard = (props: Props) => { setUserpicUrl(props.author.userpic.replace('100x', '500x500')) } return ( - <> +
+ + } + > +
+ +
+
+
- - } - > -
- +
+
+ ( + + {children} + + )} + > + {name()} +
- + + {t('PublicationsWithCount', { count: props.author.stat?.shouts ?? 0 })} +
+ ) : ( + '' + ) + } + > +
+ -
-
- + + +
+ + {(link) => ( + + + {link.startsWith('http') ? link : `https://${link}`} + )} - > - {name()} - +
- - {t('PublicationsWithCount', { count: props.author.stat?.shouts ?? 0 })} -
- ) : ( - '' - ) - } - > -
- - - 0) || - (props.following && props.following.length > 0) - } - > -
- - 0 && !props.isCurrentUser}> - - - {(f) => } - -
- {t('SubscriptionWithCount', { count: props.followers.length })} -
-
-
- 0 && props.isCurrentUser}> -
-
-
- - - - -
- - - - - - - {t('Follow')} - - - - } - > + +
+ subscribe(false)} + onClick={handleSubscribe} class={clsx('button', styles.button)} classList={{ [styles.buttonSubscribe]: !props.isAuthorsList && !props.isTextButton, @@ -323,118 +299,139 @@ export const AuthorCard = (props: Props) => { disabled={isSubscribing()} > - + - - {t('Unfollow')} - - - {t('You are subscribed')} + + {t('Follow')} - + } + > + + - - - -
-
+ + + +
-
-
+ + + + + <> +

{t('Followers')}

+
+
+
+ + {(follower: Author) => } + +
+
+
+ +
+
+ + + + <> +

{t('Subscriptions')}

+
    +
  • + + {props.following.length} +
  • +
  • + + + {props.following.filter((s) => 'name' in s).length} + +
  • +
  • + + + {props.following.filter((s) => 'title' in s).length} + +
  • +
+
+
+
+
+ + {(subscription) => + isAuthor(subscription) ? ( + + ) : ( + + ) + } + +
+
+
+ +
+
- - - - <> -

{t('Followers')}

-
-
-
- - {(follower: Author) => } - -
-
-
- -
-
- - - - <> -

{t('Subscriptions')}

-
    -
  • - - {props.following.length} -
  • -
  • - - - {props.following.filter((s) => 'name' in s).length} - -
  • -
  • - - - {props.following.filter((s) => 'title' in s).length} - -
  • -
-
-
-
-
- - {(subscription) => - isAuthor(subscription) ? ( - - ) : ( - - ) - } - -
-
-
- -
-
- +
) } diff --git a/src/components/Views/Author/Author.module.scss b/src/components/Views/Author/Author.module.scss index 45f849a3..5005b836 100644 --- a/src/components/Views/Author/Author.module.scss +++ b/src/components/Views/Author/Author.module.scss @@ -14,10 +14,13 @@ } .authorHeader { - border-bottom: 2px solid #000; + border-bottom: 2px solid var(--default-color); margin-bottom: 2.4rem; - margin-top: -3.2rem; padding-bottom: 4rem; + + @include media-breakpoint-up(lg) { + margin-top: -3.2rem; + } } .ratingContainer {