From 4838df315931bb883f704ec3e1abe2685f296cdf Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Sat, 22 Apr 2023 19:52:26 +0800 Subject: 😀 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/components/clients/Logo.tsx | 67 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 docs/components/clients/Logo.tsx (limited to 'docs/components/clients/Logo.tsx') diff --git a/docs/components/clients/Logo.tsx b/docs/components/clients/Logo.tsx new file mode 100644 index 0000000..79ab9c2 --- /dev/null +++ b/docs/components/clients/Logo.tsx @@ -0,0 +1,67 @@ +import React from "react"; +import cn from "classnames"; +import Image from "next/image"; +import { TurboUser } from "./users"; + +const DEFAULT_SIZE = { + width: 100, + height: 75, +}; + +export function Logo({ + user, + theme, + isLink, +}: { + user: TurboUser; + theme: "dark" | "light"; + isLink: boolean; +}) { + const styles = { + ...DEFAULT_SIZE, + ...user.style, + }; + let numericWidth: number; + let numericHeight: number; + if (typeof styles.width === "number") { + numericWidth = styles.width; + } + if (typeof styles.height === "number") { + numericHeight = styles.height; + } + const logo = ( + {`${user.caption}'s + ); + + if (isLink) { + return ( + + {logo} + + ); + } + + return logo; +} -- cgit v1.2.3-70-g09d2