From e9df675c4826df32b18e19618db09ebb1d8650ae Mon Sep 17 00:00:00 2001 From: Nikolaj Frey Date: Sun, 21 Jul 2024 12:19:02 +0800 Subject: [PATCH] =?UTF-8?q?Added=20build-remix=20script=20=F0=9F=A4=A3=20f?= =?UTF-8?q?eature/random-nik-things?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- remix/app/components/Branding/Branding.tsx | 10 +-- remix/app/components/Branding/Logo.tsx | 71 +++++++++++++--------- 3 files changed, 48 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 78044ca..a4e1485 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "scripts": { "app": "npm run remix", "remix": "npm run dev --prefix remix", + "build-remix": "npm run build --prefix remix", "next": "npm run dev --prefix next", "api": "npm run dev --prefix api", - "build": "npm run build --prefix next", "postinstall": "pnpm i --prefix next ; pnpm i --prefix=api" }, "repository": { diff --git a/remix/app/components/Branding/Branding.tsx b/remix/app/components/Branding/Branding.tsx index eeb6b83..cb6d004 100644 --- a/remix/app/components/Branding/Branding.tsx +++ b/remix/app/components/Branding/Branding.tsx @@ -1,12 +1,12 @@ -import { Box, Heading } from '@chakra-ui/react'; +import { Box, Center, Flex, Heading } from '@chakra-ui/react'; import { Logo } from './Logo'; export const Branding = () => { return ( - + Branding - ello - - + Logo + + ); }; diff --git a/remix/app/components/Branding/Logo.tsx b/remix/app/components/Branding/Logo.tsx index 53f44de..180b0e7 100644 --- a/remix/app/components/Branding/Logo.tsx +++ b/remix/app/components/Branding/Logo.tsx @@ -16,7 +16,9 @@ export const Logo = (props) => { const [squares, setSquares] = useState(9); - const [width, setWidth] = useState(props?.width || 300); + const initialWidth = props?.width || 300; + + const [width, setWidth] = useState(initialWidth); // logo is a T/plus shape made of two intersecting squares // you can toggle border sides on both squares to create different shapes @@ -48,11 +50,11 @@ export const Logo = (props) => { padding: `${padding}px` }; - const innerBox = ; + const InnerBox = (props: any = {}) => ; const Square = (props: any = {}) => ( - - {innerBox} + + ); @@ -60,34 +62,45 @@ export const Logo = (props) => { <> {/* these are the controls */} {/* border radius use chakra slider */} - - - Logo Controls - - - Border Radius - - - - - - 🟡 - - - Padding - - - - - - 🟡 - - + {props?.editable && ( + + + Logo Controls + + + Width {width}px + + + + + + 🟡 + + + Border Radius {borderRadius}px + + + + + + 🟡 + + + Padding {padding}px + + + + + + 🟡 + + + )} {squaresArray.map((_, index) => { const odd = index % 2 === 0; - - ; + const even = !odd; + return ; })}