Skip to content

Commit 48e5269

Browse files
Add padding to product logos (#1791)
Co-authored-by: Dimitri POSTOLOV <[email protected]>
1 parent 26e64a4 commit 48e5269

File tree

5 files changed

+53
-18
lines changed

5 files changed

+53
-18
lines changed

.changeset/late-kids-fix.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@theguild/components": patch
3+
---
4+
5+
Add padding to product logos

packages/components/src/components/explore-main-product-cards.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { HTMLAttributes } from 'react';
22
import { cn } from '../cn';
3-
import { PRODUCTS } from '../products';
3+
import { FOUR_MAIN_PRODUCTS } from '../products';
44
import { Heading } from './heading';
55
import { ArrowIcon } from './icons';
66
import { TextLink } from './text-link';
@@ -28,7 +28,7 @@ export function ExploreMainProductCards({ className, ...rest }: ExploreMainProdu
2828
</TextLink>
2929
</div>
3030
<ul className="-mx-12 -my-2 flex shrink-0 grow gap-[22px] overflow-auto px-12 py-2 [@media(max-width:1490px)]:w-full [@media(min-width:1490px)]:overflow-visible [&>:nth-child(n+4)]:[@media(min-width:1490px)]:hidden">
31-
{[PRODUCTS.HIVE, PRODUCTS.HIVE_GATEWAY, PRODUCTS.YOGA, PRODUCTS.MESH].map(product => (
31+
{FOUR_MAIN_PRODUCTS.map(product => (
3232
<MainProductCard key={product.name} as="li" product={product} />
3333
))}
3434
</ul>

packages/components/src/components/tools-and-libraries-cards/index.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { cn } from '../../cn';
2-
import { ProductInfo, PRODUCTS, SIX_HIGHLIGHTED_PRODUCTS } from '../../products';
2+
import {
3+
FOUR_MAIN_PRODUCTS,
4+
ProductInfo,
5+
PRODUCTS,
6+
SIX_HIGHLIGHTED_PRODUCTS,
7+
} from '../../products';
38
import { CallToAction } from '../call-to-action';
49
import { HighlightDecoration } from '../decorations';
510
import { Heading } from '../heading';
@@ -28,8 +33,8 @@ export function ToolsAndLibrariesCards({ className }: { className?: string }) {
2833
Discover the complete ecosystem of tools and libraries
2934
</Heading>
3035
<p className="text-green-800">Complete GraphQL Federation Stack</p>
31-
<ul className="-mx-12 -my-2 flex grid-cols-2 flex-row gap-[22px] overflow-auto px-12 py-2 lg:grid xl:grid-cols-4">
32-
{[PRODUCTS.HIVE, PRODUCTS.HIVE_GATEWAY, PRODUCTS.YOGA, PRODUCTS.MESH].map(product => (
36+
<ul className="-mx-12 -my-2 flex grid-cols-2 gap-[22px] overflow-auto px-12 py-2 lg:grid xl:grid-cols-4">
37+
{FOUR_MAIN_PRODUCTS.map(product => (
3338
<MainProductCard key={product.name} as="li" product={product} />
3439
))}
3540
</ul>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Meta, StoryObj } from '@storybook/react';
2+
import { hiveThemeDecorator } from '../../../.storybook/hive-theme-decorator';
3+
import { PRODUCTS_MENU_LIST } from './products';
4+
5+
export default {
6+
title: 'Components/PRODUCTS_MENU_LIST',
7+
component: () => null,
8+
decorators: [hiveThemeDecorator],
9+
parameters: {
10+
padding: true,
11+
},
12+
} satisfies Meta;
13+
14+
export const Default: StoryObj = {
15+
name: 'PRODUCTS_MENU_LIST',
16+
render() {
17+
return (
18+
<div className="flex flex-col gap-2">
19+
{Object.values(PRODUCTS_MENU_LIST).map(product => product.title)}
20+
</div>
21+
);
22+
},
23+
};

packages/components/src/products.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,13 @@ export const PRODUCTS: Record<ProductType, ProductInfo> = {
222222
},
223223
};
224224

225+
export const FOUR_MAIN_PRODUCTS = [
226+
PRODUCTS.HIVE,
227+
PRODUCTS.HIVE_GATEWAY,
228+
PRODUCTS.YOGA,
229+
PRODUCTS.MESH,
230+
];
231+
225232
export const SIX_HIGHLIGHTED_PRODUCTS = [
226233
PRODUCTS.CODEGEN,
227234
PRODUCTS.INSPECTOR,
@@ -234,14 +241,7 @@ export const SIX_HIGHLIGHTED_PRODUCTS = [
234241
/** List of products displayed in hamburger menu. */
235242
export const PRODUCTS_MENU_LIST: MenuItem['items'] = Object.fromEntries(
236243
(
237-
[
238-
'The GraphQL Stack',
239-
PRODUCTS.MESH,
240-
PRODUCTS.YOGA,
241-
PRODUCTS.CODEGEN,
242-
'Libraries',
243-
...SIX_HIGHLIGHTED_PRODUCTS,
244-
] as const
244+
['The GraphQL Stack', ...FOUR_MAIN_PRODUCTS, 'Libraries', ...SIX_HIGHLIGHTED_PRODUCTS] as const
245245
).map((item, i) => {
246246
if (typeof item === 'string') {
247247
return [
@@ -257,7 +257,7 @@ export const PRODUCTS_MENU_LIST: MenuItem['items'] = Object.fromEntries(
257257
</style>
258258
<span className="ml-2 font-medium text-gray-500 dark:text-neutral-400">{item}</span>
259259
</>
260-
) as any as string,
260+
) as unknown as string,
261261
},
262262
];
263263
}
@@ -270,12 +270,14 @@ export const PRODUCTS_MENU_LIST: MenuItem['items'] = Object.fromEntries(
270270
newWindow: true,
271271
title: (
272272
<div className="flex items-center gap-2">
273-
<Logo
273+
<div
274274
className={cn(
275-
'size-4 translate-y-[0.25px]',
276-
i > 3 && 'rounded-sm bg-gray-500 text-[8px] text-white dark:bg-white/10',
275+
'flex translate-y-[0.25px]',
276+
i > 6 && 'rounded-sm bg-gray-500 text-white dark:bg-white/10',
277277
)}
278-
/>
278+
>
279+
<Logo className="size-4 text-[8px]" />
280+
</div>
279281
{item.name}
280282
</div>
281283
),

0 commit comments

Comments
 (0)