diff --git a/src/components/Article/Comment.tsx b/src/components/Article/Comment.tsx
index 114a54f4..c8cc6028 100644
--- a/src/components/Article/Comment.tsx
+++ b/src/components/Article/Comment.tsx
@@ -4,7 +4,7 @@ import { getPagePath } from '@nanostores/router'
import MD from './MD'
import { AuthorCard } from '../Author/AuthorCard'
-import Userpic from '../Author/Userpic'
+import { Userpic } from '../Author/Userpic'
import { CommentRatingControl } from './CommentRatingControl'
import { CommentDate } from './CommentDate'
import { ShowIfAuthenticated } from '../_shared/ShowIfAuthenticated'
@@ -123,7 +123,8 @@ export const Comment = (props: Props) => {
fallback={
{
}}
>
{
- const letters = () => {
- const names = props.user && props.user.name ? props.user.name.split(' ') : []
-
- return names[0][0] + (names.length > 1 ? names[1][0] : '')
- }
-
- return (
-
- )
-}
diff --git a/src/components/Author/Userpic.module.scss b/src/components/Author/Userpic/Userpic.module.scss
similarity index 75%
rename from src/components/Author/Userpic.module.scss
rename to src/components/Author/Userpic/Userpic.module.scss
index 7981d9bf..1dc106ac 100644
--- a/src/components/Author/Userpic.module.scss
+++ b/src/components/Author/Userpic/Userpic.module.scss
@@ -1,4 +1,4 @@
-.circlewrap {
+.Userpic {
align-items: baseline;
background: #f7f7f8;
border-radius: 100%;
@@ -19,7 +19,7 @@
display: block;
}
- .userpic {
+ .letters {
background-color: white;
border-radius: 50%;
border: 1.5px solid black;
@@ -53,24 +53,24 @@
color: #000;
}
}
-}
-.big.circlewrap {
- margin-right: 0;
- max-width: 168px;
- min-width: 168px;
- height: 168px;
- width: 168px;
+ &.big {
+ margin-right: 0;
+ max-width: 168px;
+ min-width: 168px;
+ height: 168px;
+ width: 168px;
- @include media-breakpoint-up(md) {
- margin-right: 4.8rem;
- }
+ @include media-breakpoint-up(md) {
+ margin-right: 4.8rem;
+ }
- .userpic {
- font-size: 2em;
- line-height: 168px;
- max-width: 100%;
- width: 100%;
+ .letters {
+ font-size: 2em;
+ line-height: 168px;
+ max-width: 100%;
+ width: 100%;
+ }
}
}
@@ -81,16 +81,20 @@
height: 6.8rem;
width: 6.8rem;
- .userpic {
+ .letters {
line-height: 6.4rem;
}
}
.feedMode {
- .userpic {
+ .letters {
font-size: 0.8rem;
line-height: 14px;
min-width: 16px;
max-width: 16px;
}
}
+
+.cursorPointer {
+ cursor: pointer;
+}
diff --git a/src/components/Author/Userpic/Userpic.tsx b/src/components/Author/Userpic/Userpic.tsx
new file mode 100644
index 00000000..57c205bd
--- /dev/null
+++ b/src/components/Author/Userpic/Userpic.tsx
@@ -0,0 +1,62 @@
+import { Show } from 'solid-js'
+import type { Author, User } from '../../../graphql/types.gen'
+import styles from './Userpic.module.scss'
+import { clsx } from 'clsx'
+import { imageProxy } from '../../../utils/imageProxy'
+import { ConditionalWrapper } from '../../_shared/ConditionalWrapper'
+import { Loading } from '../../_shared/Loading'
+
+type Props = {
+ name: string
+ userpic: string
+ class?: string
+ slug?: string
+ onClick?: () => void
+ loading?: boolean
+ isBig?: boolean
+ hasLink?: boolean
+
+ isAuthorsList?: boolean
+ isFeedMode?: boolean
+}
+
+export const Userpic = (props: Props) => {
+ const letters = () => {
+ if (!props.name) return
+ const names = props.name ? props.name.split(' ') : []
+ return names[0][0] + (names.length > 1 ? names[1][0] : '')
+ }
+
+ return (
+
+
}>
+
{children}}
+ >
+
+ }
+ >
+ {letters()}
+
+
+
+
+ )
+}
diff --git a/src/components/Author/Userpic/index.ts b/src/components/Author/Userpic/index.ts
new file mode 100644
index 00000000..041a2955
--- /dev/null
+++ b/src/components/Author/Userpic/index.ts
@@ -0,0 +1 @@
+export { Userpic } from './Userpic'
diff --git a/src/components/Feed/Sidebar/Sidebar.tsx b/src/components/Feed/Sidebar/Sidebar.tsx
index e93fc5bf..a886ec62 100644
--- a/src/components/Feed/Sidebar/Sidebar.tsx
+++ b/src/components/Feed/Sidebar/Sidebar.tsx
@@ -9,7 +9,7 @@ import { useSession } from '../../../context/session'
import { useLocalize } from '../../../context/localize'
import styles from './Sidebar.module.scss'
import { clsx } from 'clsx'
-import Userpic from '../../Author/Userpic'
+import { Userpic } from '../../Author/Userpic'
import { getPagePath } from '@nanostores/router'
import { router, useRouter } from '../../../stores/router'
@@ -138,7 +138,10 @@ export const Sidebar = (props: FeedSidebarProps) => {
>