Date: Mon, 26 Aug 2024 15:13:41 +0200
Subject: [PATCH 4/4] refactor review
---
.../Author/GeneratedImage/index.tsx | 40 ++-----------------
.../theme/Blog/Components/Author/index.tsx | 12 +++---
.../Blog/Components/Author/styles.module.css | 23 ++++++++++-
3 files changed, 33 insertions(+), 42 deletions(-)
diff --git a/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/GeneratedImage/index.tsx b/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/GeneratedImage/index.tsx
index fea99c75ad8c..9c2076840ab2 100644
--- a/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/GeneratedImage/index.tsx
+++ b/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/GeneratedImage/index.tsx
@@ -7,44 +7,12 @@
import React from 'react';
import clsx from 'clsx';
-import Link, {type Props as LinkProps} from '@docusaurus/Link';
import type {Props} from '@theme/Blog/Components/Author/GeneratedImage';
-function MaybeLink(props: LinkProps): JSX.Element {
- if (props.href) {
- return ;
- }
- return <>{props.children}>;
-}
-
-export default function GeneratedImage({
- name,
- link,
- className,
-}: Props): JSX.Element {
+export default function GeneratedImage({name, className}: Props): JSX.Element {
return (
-
-
-
+
+ {name[0]?.toLocaleUpperCase()}
+
);
}
diff --git a/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/index.tsx b/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/index.tsx
index 93665396a7e7..a56217920203 100644
--- a/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/index.tsx
+++ b/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/index.tsx
@@ -75,11 +75,13 @@ export default function BlogAuthor({
/>