From cf52c6dfb49e99dc474243f7f9ca6775e5f1c18f Mon Sep 17 00:00:00 2001 From: Matheus Littig Date: Mon, 26 Feb 2024 10:36:01 -0400 Subject: [PATCH 1/2] refactor: changing tab button styles --- .../src/components/playground/playground.tsx | 2 +- packages/@zipper-ui/src/components/tab-button.tsx | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/zipper.dev/src/components/playground/playground.tsx b/apps/zipper.dev/src/components/playground/playground.tsx index ec1f047e0..d536727a5 100644 --- a/apps/zipper.dev/src/components/playground/playground.tsx +++ b/apps/zipper.dev/src/components/playground/playground.tsx @@ -264,7 +264,7 @@ export function Playground({ )} {/* TAB PANELS */} - + {/* CODE */} = ({ Date: Mon, 4 Mar 2024 09:00:28 -0400 Subject: [PATCH 2/2] fix: minor design tweaks --- .../playground-sidebar-script-item.tsx | 50 +++++++++++-------- .../playground/playground-sidebar.tsx | 41 ++++++++++----- 2 files changed, 57 insertions(+), 34 deletions(-) diff --git a/apps/zipper.dev/src/components/playground/playground-sidebar-script-item.tsx b/apps/zipper.dev/src/components/playground/playground-sidebar-script-item.tsx index e899ab1ad..2e8aabb77 100644 --- a/apps/zipper.dev/src/components/playground/playground-sidebar-script-item.tsx +++ b/apps/zipper.dev/src/components/playground/playground-sidebar-script-item.tsx @@ -10,6 +10,8 @@ import { Link, Icon, useColorModeValue, + Box, + IconButton, } from '@chakra-ui/react'; import NextLink from 'next/link'; import { Script } from '@prisma/client'; @@ -31,6 +33,7 @@ import { isReadme, } from '~/utils/playground.utils'; import { useEditorContext } from '../context/editor-context'; +import { brandColors, theme } from '@zipper/ui'; export type ScriptItemProps = { script: Script; @@ -46,7 +49,10 @@ export type ScriptItemProps = { }; const ScriptIcon = ({ script, ...propsPassedIn }: { script: Script } & any) => { - const props = { ...propsPassedIn, size: '14px' }; + const props = { + ...propsPassedIn, + size: '14px', + }; if (isReadme(script)) return ; else if (isMain(script)) return ; else if (isHandler(script)) return ; @@ -79,18 +85,19 @@ export const ScriptItem: React.FC = ({ const isDirty = isModelDirty(script.filename); const hasErrors = modelHasErrors(script.filename); - const highlightColor = useColorModeValue('blackAlpha.400', 'whiteAlpha.400'); + const highlightColor = useColorModeValue('primary.50', 'purple.900'); const errorColor = useColorModeValue('red.400', 'red.600'); + const isSelected = currentScript?.id === script.id; + return ( @@ -132,21 +139,17 @@ export const ScriptItem: React.FC = ({ setCurrentScript(script); }} > - - - - + + + + {script.filename === 'readme.md' ? 'README.md' : script.filename} @@ -155,7 +158,12 @@ export const ScriptItem: React.FC = ({ )} {canUserEdit && ( - + = ({ }} /> - + onDuplicate(script.id)}> Duplicate diff --git a/apps/zipper.dev/src/components/playground/playground-sidebar.tsx b/apps/zipper.dev/src/components/playground/playground-sidebar.tsx index acb2b70f5..08ca2c64e 100644 --- a/apps/zipper.dev/src/components/playground/playground-sidebar.tsx +++ b/apps/zipper.dev/src/components/playground/playground-sidebar.tsx @@ -165,20 +165,23 @@ export function PlaygroundSidebar({ <> - - + + Files {app.canUserEdit && ( @@ -230,21 +233,31 @@ export function PlaygroundSidebar({ - +

- + Guide +

@@ -255,6 +268,8 @@ export function PlaygroundSidebar({ p={3} gap={3} color="fg.400" + borderBottom="1px solid" + borderColor="fg.200" bg={ doc.index === selectedTutorial.index ? colorMode === 'dark'