Skip to content

Commit fd22db3

Browse files
committed
Fix LogoTextSVG eye cutouts to match brand mark
1 parent 29408a9 commit fd22db3

3 files changed

Lines changed: 13 additions & 27 deletions

File tree

apps/web/src/app/promo-video/promo-video-page.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,7 @@ export function PromoLogoEndScene({
425425
type: "spring",
426426
}}
427427
>
428-
<LogoTextSVG
429-
className="w-[min(78%,980px)] text-primary"
430-
eyeFill="var(--background)"
431-
/>
428+
<LogoTextSVG className="w-[min(78%,980px)] text-primary" />
432429
</motion.div>
433430
) : null}
434431
</AnimatePresence>

apps/web/src/components/ui/logo.test.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,10 @@ import { renderToStaticMarkup } from "react-dom/server";
44
import { LogoTextSVG } from "./logo";
55

66
describe("LogoTextSVG", () => {
7-
it("keeps the eye cutouts transparent by default", () => {
7+
it("renders the logo mark as a single punched-out shape", () => {
88
const html = renderToStaticMarkup(<LogoTextSVG />);
99

10-
expect(html).toContain('fill="transparent"');
11-
});
12-
13-
it("supports overriding the eye fill for promo scenes", () => {
14-
const html = renderToStaticMarkup(
15-
<LogoTextSVG eyeFill="var(--background)" />
16-
);
17-
18-
expect(html).toContain('fill="var(--background)"');
19-
expect(html).not.toContain('fill="transparent"');
10+
expect(html.match(/<path/g)?.length).toBe(2);
11+
expect(html).toContain('fill-rule="evenodd"');
2012
});
2113
});

apps/web/src/components/ui/logo.tsx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
"use client";
2+
import { usePathname } from "next/navigation";
13
import { cn } from "@/lib/utils";
24

35
type Props = {
46
className?: string;
5-
eyeFill?: string;
67
};
78

89
export function Logo({ className }: Props) {
@@ -25,6 +26,8 @@ export function Logo({ className }: Props) {
2526
}
2627

2728
export function LogoText({ className }: Props) {
29+
const pathname = usePathname() ?? "";
30+
const isDocs = pathname.startsWith("/docs");
2831
return (
2932
<span
3033
className={cn(
@@ -33,12 +36,12 @@ export function LogoText({ className }: Props) {
3336
)}
3437
>
3538
<Logo className="mt-1 h-4.5" />
36-
cossistant
39+
cossistant {isDocs ? "docs" : ""}
3740
</span>
3841
);
3942
}
4043

41-
export function LogoTextSVG({ className, eyeFill = "transparent" }: Props) {
44+
export function LogoTextSVG({ className }: Props) {
4245
return (
4346
<svg
4447
className={className}
@@ -54,16 +57,10 @@ export function LogoTextSVG({ className, eyeFill = "transparent" }: Props) {
5457
fill="currentColor"
5558
/>
5659
<path
57-
d="M0.268813 91.3819L34.5395 59.2561L149.718 59.2561L183.988 91.3819L183.988 210L149.718 210L34.5395 210L0.268809 178.228L0.268813 91.3819Z"
60+
clipRule="evenodd"
61+
d="M0.268813 91.3819L34.5395 59.2561L149.718 59.2561L183.988 91.3819L183.988 210L149.718 210L34.5395 210L0.268809 178.228L0.268813 91.3819ZM95.6992 124.672L95.7955 138.043H108.954L108.836 130.956C108.836 125.777 110.07 124.799 115.556 124.799H127.599C133.086 124.799 133.903 125.777 133.903 131.364V138.043H147.195V124.669C147.195 122.757 146.451 120.92 145.12 119.547L139.06 113.295C137.674 111.865 135.767 111.057 133.775 111.057H108.992C106.983 111.057 105.062 111.878 103.674 113.33L97.7406 119.532C96.4177 120.914 95.6854 122.758 95.6992 124.672ZM29.4619 124.672L29.5581 138.043H42.7162L42.5985 130.956C42.5985 125.777 43.8328 124.799 49.3191 124.799H61.362C66.8483 124.799 67.6657 125.777 67.6657 131.364V138.043H80.9576V124.669C80.9576 122.757 80.2134 120.92 78.8827 119.547L72.8228 113.295C71.4366 111.865 69.5299 111.057 67.5381 111.057H42.7545C40.746 111.057 38.8248 111.878 37.4364 113.33L31.5033 119.532C30.1804 120.914 29.4481 122.758 29.4619 124.672Z"
5862
fill="currentColor"
59-
/>
60-
<path
61-
d="M95.6992 124.672L95.7955 138.043H108.954L108.836 130.956C108.836 125.777 110.07 124.799 115.556 124.799H127.599C133.086 124.799 133.903 125.777 133.903 131.364V138.043H147.195V124.669C147.195 122.757 146.451 120.92 145.12 119.547L139.06 113.295C137.674 111.865 135.767 111.057 133.775 111.057H108.992C106.983 111.057 105.062 111.878 103.674 113.33L97.7406 119.532C96.4177 120.914 95.6854 122.758 95.6992 124.672Z"
62-
fill={eyeFill}
63-
/>
64-
<path
65-
d="M29.4619 124.672L29.5581 138.043H42.7162L42.5985 130.956C42.5985 125.777 43.8328 124.799 49.3191 124.799H61.362C66.8483 124.799 67.6657 125.777 67.6657 131.364V138.043H80.9576V124.669C80.9576 122.757 80.2134 120.92 78.8827 119.547L72.8228 113.295C71.4366 111.865 69.5299 111.057 67.5381 111.057H42.7545C40.746 111.057 38.8248 111.878 37.4364 113.33L31.5033 119.532C30.1804 120.914 29.4481 122.758 29.4619 124.672Z"
66-
fill={eyeFill}
63+
fillRule="evenodd"
6764
/>
6865
</svg>
6966
);

0 commit comments

Comments
 (0)