diff --git a/src/components/TutorialMetadata.tsx b/src/components/TutorialMetadata.tsx index bc081d90304..d2565a5cb0d 100644 --- a/src/components/TutorialMetadata.tsx +++ b/src/components/TutorialMetadata.tsx @@ -1,6 +1,6 @@ import { useRouter } from "next/router" import { useTranslation } from "next-i18next" -import { Badge, Box, Flex, HStack, Text } from "@chakra-ui/react" +import { Badge } from "@chakra-ui/react" import type { Lang, TranslationKey } from "@/lib/types" import { TutorialFrontmatter } from "@/lib/interfaces" @@ -13,6 +13,8 @@ import TutorialTags from "@/components/TutorialTags" import { getLocaleTimestamp } from "@/lib/utils/time" +import { Flex } from "./ui/flex" + export type TutorialMetadataProps = { frontmatter: TutorialFrontmatter timeToRead: number @@ -42,101 +44,61 @@ const TutorialMetadata = ({ const address = frontmatter.address return ( - - - + + + - {t(getSkillTranslationId(frontmatter.skill as Skill))} - + - + {author && ( - +
{author} - +
)} {hasSource && ( - +
{frontmatter.source} - +
)} {published && ( - +
{" "} {getLocaleTimestamp(locale! as Lang, published)} - +
)} - +
{timeToRead} {t("comp-tutorial-metadata-minute-read")} minute read - - - - {address && ( - - - {(isCopied) => ( - - {" "} - {address} {isCopied && } - {isCopied && ( - - )} - - )} - - - )} - +
+
+ {address && ( + + + {(isCopied) => ( +
+ + + {" "} + {address} {isCopied && }{" "} + {isCopied && ( + + )} +
+ )} +
+
+ )}
) }