From 491757ee7020abb01355ed6e8b3d97d587b3b571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Ara=C3=BAjo?= Date: Mon, 17 Jun 2024 20:44:41 -0300 Subject: [PATCH 1/3] refactor: merge horizontal logos --- components/Common/NodejsLogo/index.module.css | 12 +- components/Common/NodejsLogo/index.tsx | 6 +- .../Logos/{NodejsLight.tsx => Nodejs.tsx} | 9 +- components/Icons/Logos/NodejsDark.tsx | 118 ------------------ components/__design__/node-logos.stories.tsx | 10 +- 5 files changed, 10 insertions(+), 145 deletions(-) rename components/Icons/Logos/{NodejsLight.tsx => Nodejs.tsx} (97%) delete mode 100644 components/Icons/Logos/NodejsDark.tsx diff --git a/components/Common/NodejsLogo/index.module.css b/components/Common/NodejsLogo/index.module.css index 7899c8c8e92e4..2e74ac633f684 100644 --- a/components/Common/NodejsLogo/index.module.css +++ b/components/Common/NodejsLogo/index.module.css @@ -1,12 +1,4 @@ -.nodejsLogoDark { +.nodejsLogo { @apply h-6 - w-20 - dark:hidden; -} - -.nodejsLogoLight { - @apply hidden - h-6 - w-20 - dark:block; + w-20; } diff --git a/components/Common/NodejsLogo/index.tsx b/components/Common/NodejsLogo/index.tsx index 6fead1ab85adc..a70734476d676 100644 --- a/components/Common/NodejsLogo/index.tsx +++ b/components/Common/NodejsLogo/index.tsx @@ -1,8 +1,7 @@ import type { FC } from 'react'; -import NodejsDark from '@/components/Icons/Logos/NodejsDark'; +import Nodejs from '@/components/Icons/Logos/Nodejs'; import NodejsDarkPride from '@/components/Icons/Logos/NodejsDarkPride'; -import NodejsLight from '@/components/Icons/Logos/NodejsLight'; import NodejsLightPride from '@/components/Icons/Logos/NodejsLightPride'; import type { LogoVariant } from '@/types'; @@ -22,8 +21,7 @@ const NodejsLogo: FC = ({ variant = 'default' }) => ( )} {variant === 'default' && ( <> - - + )} diff --git a/components/Icons/Logos/NodejsLight.tsx b/components/Icons/Logos/Nodejs.tsx similarity index 97% rename from components/Icons/Logos/NodejsLight.tsx rename to components/Icons/Logos/Nodejs.tsx index d541b971f362a..d3ae93216cb9c 100644 --- a/components/Icons/Logos/NodejsLight.tsx +++ b/components/Icons/Logos/Nodejs.tsx @@ -1,12 +1,14 @@ +import classNames from 'classnames'; import type { FC, SVGProps } from 'react'; -const NodejsLight: FC> = props => ( +const Nodejs: FC> = ({ className, ...props }) => ( > = props => ( fillRule="evenodd" clipRule="evenodd" d="M43.6737 41.9539C43.6737 41.1204 43.2136 40.3334 42.4773 39.9165L23.0104 28.5712C22.6883 28.386 22.3201 28.2934 21.9519 28.2472C21.9059 28.2472 21.7679 28.2472 21.7679 28.2472C21.3997 28.2472 21.0315 28.386 20.7094 28.5712L1.19654 39.8701C0.460209 40.287 0 41.0743 0 41.9539L0.0460209 72.3315C0.0460209 72.7484 0.276126 73.165 0.644293 73.3502C1.01246 73.5819 1.47267 73.5819 1.79482 73.3502L13.3921 66.682C14.1284 66.2653 14.5886 65.4781 14.5886 64.6446V50.4282C14.5886 49.5947 15.0488 48.8074 15.7852 48.3908L20.7094 45.5197C21.0776 45.288 21.4917 45.1954 21.9059 45.1954C22.3201 45.1954 22.7343 45.288 23.0565 45.5197L27.9806 48.3908C28.7169 48.8074 29.1773 49.5947 29.1773 50.4282V64.6446C29.1773 65.4781 29.6375 66.2653 30.3738 66.682L41.8791 73.3502C42.2471 73.5819 42.7073 73.5819 43.0755 73.3502C43.4438 73.165 43.6737 72.7484 43.6737 72.3315V41.9539Z" - fill="white" /> > = props => ( ); -export default NodejsLight; +export default Nodejs; diff --git a/components/Icons/Logos/NodejsDark.tsx b/components/Icons/Logos/NodejsDark.tsx deleted file mode 100644 index f913d72cf8a4a..0000000000000 --- a/components/Icons/Logos/NodejsDark.tsx +++ /dev/null @@ -1,118 +0,0 @@ -import type { FC, SVGProps } from 'react'; - -const NodejsDark: FC> = props => ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -); - -export default NodejsDark; diff --git a/components/__design__/node-logos.stories.tsx b/components/__design__/node-logos.stories.tsx index 11f1311b47dc3..a8e1783c13bc0 100644 --- a/components/__design__/node-logos.stories.tsx +++ b/components/__design__/node-logos.stories.tsx @@ -2,9 +2,8 @@ import type { Meta as MetaObj, StoryObj } from '@storybook/react'; import JsIconGreen from '@/components/Icons/Logos/JsIconGreen'; import JsIconWhite from '@/components/Icons/Logos/JsIconWhite'; -import NodejsLogoDark from '@/components/Icons/Logos/NodejsDark'; +import NodejsLogo from '@/components/Icons/Logos/Nodejs'; import NodejsDarkPride from '@/components/Icons/Logos/NodejsDarkPride'; -import NodejsLogoLight from '@/components/Icons/Logos/NodejsLight'; import NodejsLightPride from '@/components/Icons/Logos/NodejsLightPride'; import NodejsStackedBlack from '@/components/Icons/Logos/NodejsStackedBlack'; import NodejsStackedDark from '@/components/Icons/Logos/NodejsStackedDark'; @@ -12,12 +11,7 @@ import NodejsStackedLight from '@/components/Icons/Logos/NodejsStackedLight'; import NodejsStackedWhite from '@/components/Icons/Logos/NodejsStackedWhite'; export const HorizontalLogos: StoryObj = { - render: () => ( -
- - -
- ), + render: () => , }; export const PrideLogos: StoryObj = { From fd8dd85b8a60d879821b9ba9ec01d5bd1ab9ea9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Ara=C3=BAjo?= Date: Tue, 18 Jun 2024 19:27:34 -0300 Subject: [PATCH 2/3] refactor: merge pride logos --- components/Common/NodejsLogo/index.tsx | 16 +-- components/Icons/Logos/NodejsLightPride.tsx | 111 ------------------ .../{NodejsDarkPride.tsx => NodejsPride.tsx} | 9 +- components/__design__/node-logos.stories.tsx | 10 +- 4 files changed, 9 insertions(+), 137 deletions(-) delete mode 100644 components/Icons/Logos/NodejsLightPride.tsx rename components/Icons/Logos/{NodejsDarkPride.tsx => NodejsPride.tsx} (97%) diff --git a/components/Common/NodejsLogo/index.tsx b/components/Common/NodejsLogo/index.tsx index a70734476d676..fffe240340263 100644 --- a/components/Common/NodejsLogo/index.tsx +++ b/components/Common/NodejsLogo/index.tsx @@ -1,8 +1,7 @@ import type { FC } from 'react'; import Nodejs from '@/components/Icons/Logos/Nodejs'; -import NodejsDarkPride from '@/components/Icons/Logos/NodejsDarkPride'; -import NodejsLightPride from '@/components/Icons/Logos/NodejsLightPride'; +import NodejsPride from '@/components/Icons/Logos/NodejsPride'; import type { LogoVariant } from '@/types'; import style from './index.module.css'; @@ -13,17 +12,8 @@ type NodejsLogoProps = { const NodejsLogo: FC = ({ variant = 'default' }) => ( <> - {variant === 'pride' && ( - <> - - - - )} - {variant === 'default' && ( - <> - - - )} + {variant === 'pride' && } + {variant === 'default' && } ); diff --git a/components/Icons/Logos/NodejsLightPride.tsx b/components/Icons/Logos/NodejsLightPride.tsx deleted file mode 100644 index f55f03d25287d..0000000000000 --- a/components/Icons/Logos/NodejsLightPride.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import type { FC, SVGProps } from 'react'; - -const NodejsLightPride: FC> = props => ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -); - -export default NodejsLightPride; diff --git a/components/Icons/Logos/NodejsDarkPride.tsx b/components/Icons/Logos/NodejsPride.tsx similarity index 97% rename from components/Icons/Logos/NodejsDarkPride.tsx rename to components/Icons/Logos/NodejsPride.tsx index c7eb7845f86b2..4dc5d9d1b550c 100644 --- a/components/Icons/Logos/NodejsDarkPride.tsx +++ b/components/Icons/Logos/NodejsPride.tsx @@ -1,12 +1,14 @@ +import classNames from 'classnames'; import type { FC, SVGProps } from 'react'; -const NodejsDarkPride: FC> = props => ( +const NodejsPride: FC> = ({ className, ...props }) => ( @@ -38,19 +40,16 @@ const NodejsDarkPride: FC> = props => ( fillRule="evenodd" clipRule="evenodd" d="M43.6671 41.9478C43.6671 41.1144 43.2071 40.3275 42.4709 39.9107L23.007 28.5671C22.6849 28.3819 22.3167 28.2893 21.9486 28.2432C21.9026 28.2432 21.7647 28.2432 21.7647 28.2432C21.3965 28.2432 21.0284 28.3819 20.7063 28.5671L1.19636 39.8643C0.46014 40.2811 0 41.0684 0 41.9478L0.046014 72.3209C0.046014 72.7377 0.276084 73.1542 0.644196 73.3394C1.0123 73.5711 1.47245 73.5711 1.79455 73.3394L13.3901 66.6722C14.1263 66.2556 14.5864 65.4685 14.5864 64.6351V50.4208C14.5864 49.5875 15.0465 48.8002 15.7828 48.3837L20.7063 45.5131C21.0744 45.2814 21.4885 45.1888 21.9026 45.1888C22.3167 45.1888 22.7309 45.2814 23.053 45.5131L27.9764 48.3837C28.7126 48.8002 29.1729 49.5875 29.1729 50.4208V64.6351C29.1729 65.4685 29.6331 66.2556 30.3692 66.6722L41.8728 73.3394C42.2408 73.5711 42.7009 73.5711 43.0691 73.3394C43.4373 73.1542 43.6671 72.7377 43.6671 72.3209V41.9478Z" - fill="#333333" /> > = props => ( ); -export default NodejsDarkPride; +export default NodejsPride; diff --git a/components/__design__/node-logos.stories.tsx b/components/__design__/node-logos.stories.tsx index a8e1783c13bc0..3f544da2cc619 100644 --- a/components/__design__/node-logos.stories.tsx +++ b/components/__design__/node-logos.stories.tsx @@ -3,8 +3,7 @@ import type { Meta as MetaObj, StoryObj } from '@storybook/react'; import JsIconGreen from '@/components/Icons/Logos/JsIconGreen'; import JsIconWhite from '@/components/Icons/Logos/JsIconWhite'; import NodejsLogo from '@/components/Icons/Logos/Nodejs'; -import NodejsDarkPride from '@/components/Icons/Logos/NodejsDarkPride'; -import NodejsLightPride from '@/components/Icons/Logos/NodejsLightPride'; +import NodejsPride from '@/components/Icons/Logos/NodejsPride'; import NodejsStackedBlack from '@/components/Icons/Logos/NodejsStackedBlack'; import NodejsStackedDark from '@/components/Icons/Logos/NodejsStackedDark'; import NodejsStackedLight from '@/components/Icons/Logos/NodejsStackedLight'; @@ -15,12 +14,7 @@ export const HorizontalLogos: StoryObj = { }; export const PrideLogos: StoryObj = { - render: () => ( -
- - -
- ), + render: () => , }; export const StackedLogos: StoryObj = { From 7af05ad20d24466d930ae56011920ece1f6b9b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Ara=C3=BAjo?= Date: Fri, 21 Jun 2024 17:19:18 -0300 Subject: [PATCH 3/3] refactor: merge default and pride logos --- components/Common/NodejsLogo/index.tsx | 6 +- components/Icons/Logos/Nodejs.tsx | 176 +++++++++++++------ components/Icons/Logos/NodejsPride.tsx | 110 ------------ components/__design__/node-logos.stories.tsx | 7 +- 4 files changed, 125 insertions(+), 174 deletions(-) delete mode 100644 components/Icons/Logos/NodejsPride.tsx diff --git a/components/Common/NodejsLogo/index.tsx b/components/Common/NodejsLogo/index.tsx index fffe240340263..7ca383e10c505 100644 --- a/components/Common/NodejsLogo/index.tsx +++ b/components/Common/NodejsLogo/index.tsx @@ -1,7 +1,6 @@ import type { FC } from 'react'; import Nodejs from '@/components/Icons/Logos/Nodejs'; -import NodejsPride from '@/components/Icons/Logos/NodejsPride'; import type { LogoVariant } from '@/types'; import style from './index.module.css'; @@ -11,10 +10,7 @@ type NodejsLogoProps = { }; const NodejsLogo: FC = ({ variant = 'default' }) => ( - <> - {variant === 'pride' && } - {variant === 'default' && } - + ); export default NodejsLogo; diff --git a/components/Icons/Logos/Nodejs.tsx b/components/Icons/Logos/Nodejs.tsx index d3ae93216cb9c..b2e23629c94fa 100644 --- a/components/Icons/Logos/Nodejs.tsx +++ b/components/Icons/Logos/Nodejs.tsx @@ -1,7 +1,17 @@ import classNames from 'classnames'; import type { FC, SVGProps } from 'react'; -const Nodejs: FC> = ({ className, ...props }) => ( +import type { LogoVariant } from '@/types'; + +type HexagonGridProps = SVGProps & { + variant?: LogoVariant; +}; + +const Nodejs: FC = ({ + className, + variant = 'default', + ...props +}) => ( > = ({ className, ...props }) => ( d="M181.551 48.7155C181.689 48.6228 181.874 48.6228 182.012 48.7155L185.739 50.8919C185.877 50.9845 185.969 51.1235 185.969 51.3087V55.6615C185.969 55.8468 185.877 55.9858 185.739 56.0784L182.012 58.2548C181.874 58.3474 181.689 58.3474 181.551 58.2548L177.824 56.0784C177.686 55.9858 177.594 55.8468 177.594 55.6615V51.3087C177.594 51.1235 177.686 50.9845 177.824 50.8919L181.551 48.7155Z" fill="#5FA04E" /> - - - + + {variant === 'pride' ? ( + <> + + + + + + + + + + + + + ) : ( + <> + + + + + )} - - - - - - - - - - - - - - - - - - - - - + {variant === 'pride' ? ( + + + + + + ) : ( + + + + + + + + + + + + + + + + + + + + + + )} ); diff --git a/components/Icons/Logos/NodejsPride.tsx b/components/Icons/Logos/NodejsPride.tsx deleted file mode 100644 index 4dc5d9d1b550c..0000000000000 --- a/components/Icons/Logos/NodejsPride.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import classNames from 'classnames'; -import type { FC, SVGProps } from 'react'; - -const NodejsPride: FC> = ({ className, ...props }) => ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -); - -export default NodejsPride; diff --git a/components/__design__/node-logos.stories.tsx b/components/__design__/node-logos.stories.tsx index 3f544da2cc619..157a5cd3df709 100644 --- a/components/__design__/node-logos.stories.tsx +++ b/components/__design__/node-logos.stories.tsx @@ -3,18 +3,17 @@ import type { Meta as MetaObj, StoryObj } from '@storybook/react'; import JsIconGreen from '@/components/Icons/Logos/JsIconGreen'; import JsIconWhite from '@/components/Icons/Logos/JsIconWhite'; import NodejsLogo from '@/components/Icons/Logos/Nodejs'; -import NodejsPride from '@/components/Icons/Logos/NodejsPride'; import NodejsStackedBlack from '@/components/Icons/Logos/NodejsStackedBlack'; import NodejsStackedDark from '@/components/Icons/Logos/NodejsStackedDark'; import NodejsStackedLight from '@/components/Icons/Logos/NodejsStackedLight'; import NodejsStackedWhite from '@/components/Icons/Logos/NodejsStackedWhite'; -export const HorizontalLogos: StoryObj = { +export const HorizontalLogo: StoryObj = { render: () => , }; -export const PrideLogos: StoryObj = { - render: () => , +export const PrideLogo: StoryObj = { + render: () => , }; export const StackedLogos: StoryObj = {