From 6dd97428c7a0bbc9b22b78414ed04584413d2bb2 Mon Sep 17 00:00:00 2001 From: Pavel <14926950+prichodko@users.noreply.github.com> Date: Thu, 29 Jun 2023 15:28:18 +0100 Subject: [PATCH] [website] Add Brand page (#431) * add brand route * implement brand page * move rgbToHex to utils * x * update responsive styles --- apps/website/src/config/routes.ts | 2 +- apps/website/src/pages/brand.tsx | 243 +++++++++++++++++++++++++++ apps/website/src/utils/rgb-to-hex.ts | 11 ++ 3 files changed, 255 insertions(+), 1 deletion(-) create mode 100644 apps/website/src/pages/brand.tsx create mode 100644 apps/website/src/utils/rgb-to-hex.ts diff --git a/apps/website/src/config/routes.ts b/apps/website/src/config/routes.ts index 065cc60e..8ca80c1d 100644 --- a/apps/website/src/config/routes.ts +++ b/apps/website/src/config/routes.ts @@ -22,7 +22,7 @@ export const ROUTES = { { name: 'Mission', href: '/' }, { name: 'Principles', href: '/' }, { name: 'Team', href: '/' }, - { name: 'Press Kit', href: '/' }, + { name: 'Brand', href: '/brand' }, ], Help: [ { name: 'Overview', href: '/help' }, diff --git a/apps/website/src/pages/brand.tsx b/apps/website/src/pages/brand.tsx new file mode 100644 index 00000000..6b4e5208 --- /dev/null +++ b/apps/website/src/pages/brand.tsx @@ -0,0 +1,243 @@ +import { customisation, neutral, white } from '@status-im/colors' +import { Button, Tag, Text } from '@status-im/components' +import { DownloadIcon } from '@status-im/icons' + +import { AppLayout, Content } from '@/layouts/app-layout' +import { rgbToHex } from '@/utils/rgb-to-hex' + +import type { GetStaticProps, Page } from 'next' + +export const getStaticProps: GetStaticProps = async () => { + const transformColor = (name: string, rgba: string, invert = false) => { + const [r, g, b] = rgba.match(/\d+/g)!.map(Number) + return { + name, + rgb: { r, g, b }, + hex: rgbToHex({ r, g, b }), + invert, + } + } + + return { + props: { + colors: { + main: [ + transformColor('Dark', neutral['100']), + transformColor('White', white['100'], true), + transformColor('Blue', customisation['blue-50']), + ], + custom: [ + transformColor('Purple', customisation['purple-50']), + transformColor('Orange', customisation['orange-50']), + transformColor('Army', customisation['army-50']), + transformColor('Turquoise', customisation['turquoise-50']), + transformColor('Sky', customisation['sky-50']), + transformColor('Yellow', customisation['yellow-50']), + transformColor('Pink', customisation['pink-50']), + transformColor('Cooper', customisation['cooper-50']), + transformColor('Camel', customisation['camel-50']), + transformColor('Magenta', customisation['magenta-50']), + ], + }, + }, + } +} + +type Props = { + colors: { + main: Color[] + custom: Color[] + } +} + +const BrandPage: Page = props => { + const { colors } = props + + return ( + +
+
+ +
+

+ Get Status +
+ brand assets +

+
+ + This ZIP file contains Status logos, partnership badges, and product + assets. + + + +
+
+ +
+ + + +
+ +
+ + +
+ +
+ +
+ +
+
+

+ Download assets +

+
+ + ZIP file contains Status logos, partnership badges, and product + assets. + +
+ +
+
+
+ ) +} + +type BrandSectionProps = { + title: string + description: string + children: React.ReactNode +} + +const BrandSection = (props: BrandSectionProps) => { + const { title, description, children } = props + + return ( +
+
+
+

{title}

+ + {description} + +
+ + +
+ +
+ {children} +
+
+ ) +} + +const LogoSection = ( + props: Omit & { logos: number[] } +) => { + const { logos, ...sectionProps } = props + + return ( + + {logos.map((logo, index) => ( +
+ LOGO HERE {logo} +
+ ))} +
+ ) +} + +type Color = { + name: string + rgb: { r: number; g: number; b: number } + hex: string + invert: boolean +} + +const ColorSection = ( + props: Omit & { colors: Color[] } +) => { + const { colors, ...sectionProps } = props + + return ( + + {colors.map(({ hex, rgb, name, invert }) => { + const textColor = invert ? '$neutral-100' : '$white-100' + + return ( +
+ + {name} + +
+ + {hex} + + + RGB {[rgb.r, rgb.g, rgb.b].join(',')} + +
+
+ ) + })} +
+ ) +} + +const AssetSection = ( + props: Omit & { assets: number[] } +) => { + const { assets, ...sectionProps } = props + + return ( + + {assets.map((asset, index) => ( +
+ ASSET HERE {asset} +
+ ))} +
+ ) +} + +BrandPage.getLayout = page => {page} + +export default BrandPage diff --git a/apps/website/src/utils/rgb-to-hex.ts b/apps/website/src/utils/rgb-to-hex.ts new file mode 100644 index 00000000..9d5a8dce --- /dev/null +++ b/apps/website/src/utils/rgb-to-hex.ts @@ -0,0 +1,11 @@ +export function rgbToHex(color: { r: number; g: number; b: number }): string { + // Convert decimal values to hexadecimal + const red = color.r.toString(16).padStart(2, '0') + const green = color.g.toString(16).padStart(2, '0') + const blue = color.b.toString(16).padStart(2, '0') + + // Concatenate the hexadecimal values + const hexValue = `#${red}${green}${blue}` + + return hexValue +}