Skip to content

Commit 7bb24bc

Browse files
authored
Make the hero logo icon color blue like on designs, not white (#2028)
1 parent bbdd9d4 commit 7bb24bc

File tree

4 files changed

+53
-7
lines changed

4 files changed

+53
-7
lines changed

packages/components/src/components/hero/hero-logo.tsx

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ import { cloneElement, ReactElement } from 'react';
22
import { cn } from '../../cn';
33
import { GRADIENT_GREEN_ID, GRADIENT_WHITE_ID } from './hero-gradient-ids';
44

5+
const GRADIENT_BLUE = 'logo-blue-3028';
6+
const GRADIENT_WHITE_INVERTED = 'logo-white-3028';
7+
58
export interface HeroLogoProps extends React.HTMLAttributes<HTMLDivElement> {
69
children: ReactElement<{
710
fill?: string;
11+
stroke?: string;
12+
strokeWidth?: number;
813
className?: string;
914
}>;
1015
}
@@ -13,20 +18,22 @@ export function HeroLogo({ children, className, ...rest }: HeroLogoProps) {
1318
return (
1419
<div className={cn('relative', className)} {...rest}>
1520
{cloneElement(children, {
16-
fill: `url(#${GRADIENT_WHITE_ID})`,
21+
stroke: `url(#${GRADIENT_WHITE_INVERTED})`,
22+
fill: `url(#${GRADIENT_BLUE})`,
1723
className: cn(
1824
'absolute inset-1/2 size-1/2 -translate-x-1/2 -translate-y-1/2',
1925
children.props.className,
2026
),
2127
})}
2228
<LogoBadgeBackground />
29+
<LogoGradientDefs />
2330
</div>
2431
);
2532
}
2633

2734
function LogoBadgeBackground() {
2835
return (
29-
<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
36+
<svg width="96" height="96" viewBox="0 0 96 96" fill="none">
3037
<rect width="96" height="96" rx="24" fill={`url(#${GRADIENT_GREEN_ID})`} />
3138
<rect
3239
x="0.5"
@@ -40,3 +47,33 @@ function LogoBadgeBackground() {
4047
</svg>
4148
);
4249
}
50+
51+
// these are not reused
52+
function LogoGradientDefs() {
53+
return (
54+
<svg viewBox="0 0 52 53" className="size-0">
55+
<linearGradient
56+
id={GRADIENT_BLUE}
57+
x1="0"
58+
y1="0.524872"
59+
x2="51.998"
60+
y2="52.5229"
61+
gradientUnits="userSpaceOnUse"
62+
>
63+
<stop stopColor="#A7D5CA" />
64+
<stop offset="1" stopColor="#86B6C1" />
65+
</linearGradient>
66+
<linearGradient
67+
id={GRADIENT_WHITE_INVERTED}
68+
x1="0"
69+
y1="0.524872"
70+
x2="52"
71+
y2="52.5249"
72+
gradientUnits="userSpaceOnUse"
73+
>
74+
<stop stopColor="white" stopOpacity="0.5" />
75+
<stop offset="1" stopColor="white" stopOpacity="0.2" />
76+
</linearGradient>
77+
</svg>
78+
);
79+
}

packages/components/src/components/hero/index.stories.tsx renamed to packages/components/src/components/hero/hero.stories.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Meta, StoryObj } from '@storybook/react';
44
import { hiveThemeDecorator } from '../../../../../.storybook/hive-theme-decorator';
55
import { ModulesLogo } from '../../logos';
66
import { CallToAction } from '../call-to-action';
7+
import { HiveGatewayIcon } from '../icons';
78
import { Hero, HeroDecorationFromLogo, HeroLogo } from './index';
89

910
export default {
@@ -26,6 +27,7 @@ export default {
2627
},
2728
parameters: {
2829
padding: true,
30+
forcedLightMode: true,
2931
},
3032
} satisfies Meta<ComponentProps<typeof Hero>>;
3133

@@ -35,7 +37,7 @@ export const Default: StoryObj<ComponentProps<typeof Hero>> = {
3537
text: 'GraphQL Modules is a toolset of libraries and guidelines dedicated to create reusable, maintainable, testable and extendable modules out of your GraphQL server.',
3638
top: (
3739
<HeroLogo>
38-
<ModulesLogo />
40+
<HiveGatewayIcon />
3941
</HeroLogo>
4042
),
4143
checkmarks: ['Fully open source', 'No vendor lock'],

packages/components/src/components/hero/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const Hero: FC<HeroProps> = props => {
2020
return (
2121
<div
2222
className={cn(
23-
'relative isolate flex max-w-[90rem] flex-col items-center justify-center gap-6 overflow-hidden rounded-3xl bg-blue-400 px-4 py-6 max-sm:mt-2 sm:py-12 md:gap-8 lg:py-24',
23+
'relative isolate flex max-w-[90rem] flex-col items-center justify-center gap-6 overflow-hidden rounded-3xl bg-blue-400 px-4 py-6 text-green-1000 max-sm:mt-2 sm:py-12 md:gap-8 lg:py-24',
2424
props.className,
2525
)}
2626
>

packages/components/src/components/icons/hive-gateway.svg

Lines changed: 10 additions & 3 deletions
Loading

0 commit comments

Comments
 (0)