From d9a7813b07113a7ef3c2e1c1f42a8d8b4a4f56c5 Mon Sep 17 00:00:00 2001 From: Andy Chen Date: Tue, 13 Aug 2024 09:32:09 -0400 Subject: [PATCH 1/4] create sidebarbutton component --- packages/editor/src/components/toolbar/Toolbar.tsx | 6 +++--- packages/ui/src/primitives/tailwind/Button/index.tsx | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/editor/src/components/toolbar/Toolbar.tsx b/packages/editor/src/components/toolbar/Toolbar.tsx index 4ecf87012e..3ba4796d1c 100644 --- a/packages/editor/src/components/toolbar/Toolbar.tsx +++ b/packages/editor/src/components/toolbar/Toolbar.tsx @@ -34,6 +34,7 @@ import { GLTFModifiedState } from '@etherealengine/engine/src/gltf/GLTFDocumentS import { getMutableState, getState, useHookstate, useMutableState } from '@etherealengine/hyperflux' import { useFind } from '@etherealengine/spatial/src/common/functions/FeathersHooks' import { ContextMenu } from '@etherealengine/ui/src/components/tailwind/ContextMenu' +import { SidebarButton } from '@etherealengine/ui/src/components/tailwind/SidebarButton/SidebarButton' import Button from '@etherealengine/ui/src/primitives/tailwind/Button' import { t } from 'i18next' import React from 'react' @@ -201,10 +202,9 @@ export default function Toolbar() {
{toolbarMenu.map(({ name, action, hotkey }, index) => (
- +
))}
diff --git a/packages/ui/src/primitives/tailwind/Button/index.tsx b/packages/ui/src/primitives/tailwind/Button/index.tsx index 8e5721c730..ae2ea47f72 100644 --- a/packages/ui/src/primitives/tailwind/Button/index.tsx +++ b/packages/ui/src/primitives/tailwind/Button/index.tsx @@ -32,7 +32,7 @@ export interface ButtonProps extends React.HTMLAttributes { endIcon?: ReactNode children?: ReactNode size?: 'small' | 'medium' | 'large' - variant?: 'primary' | 'secondary' | 'outline' | 'danger' | 'success' | 'transparent' | 'sidebar' + variant?: 'primary' | 'secondary' | 'outline' | 'danger' | 'success' | 'transparent' disabled?: boolean fullWidth?: boolean rounded?: 'partial' | 'full' | 'none' @@ -59,8 +59,7 @@ const variants = { outline: 'border border-solid border-theme-primary bg-theme-surface-main dark:bg-theme-highlight text-theme-primary', danger: 'bg-red-500', success: 'bg-teal-700', - transparent: 'bg-transparent dark:bg-transparent', - sidebar: 'bg-[#141619]' + transparent: 'bg-transparent dark:bg-transparent' } const Button = React.forwardRef( From 0f870c7aee88da9310bba76ab6062d410ad90b06 Mon Sep 17 00:00:00 2001 From: Andy Chen Date: Tue, 13 Aug 2024 09:35:57 -0400 Subject: [PATCH 2/4] add sidebar button --- .../tailwind/SidebarButton/SidebarButton.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 packages/ui/src/components/tailwind/SidebarButton/SidebarButton.tsx diff --git a/packages/ui/src/components/tailwind/SidebarButton/SidebarButton.tsx b/packages/ui/src/components/tailwind/SidebarButton/SidebarButton.tsx new file mode 100644 index 0000000000..f5dbb5f33c --- /dev/null +++ b/packages/ui/src/components/tailwind/SidebarButton/SidebarButton.tsx @@ -0,0 +1,11 @@ +import Button from '@etherealengine/ui/src/primitives/tailwind/Button' +import React from 'react' +import { twMerge } from 'tailwind-merge' + +export function SidebarButton({ children, className, ...rest }) { + return ( + + ) +} From a37bf8d2cd8ba14f91e71995e1574b9cacc057c5 Mon Sep 17 00:00:00 2001 From: Andy Chen Date: Tue, 13 Aug 2024 09:36:54 -0400 Subject: [PATCH 3/4] auto --- .../tailwind/SidebarButton/SidebarButton.tsx | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/ui/src/components/tailwind/SidebarButton/SidebarButton.tsx b/packages/ui/src/components/tailwind/SidebarButton/SidebarButton.tsx index f5dbb5f33c..22cddb0dc1 100644 --- a/packages/ui/src/components/tailwind/SidebarButton/SidebarButton.tsx +++ b/packages/ui/src/components/tailwind/SidebarButton/SidebarButton.tsx @@ -1,3 +1,28 @@ +/* +CPAL-1.0 License + +The contents of this file are subject to the Common Public Attribution License +Version 1.0. (the "License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at +https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. +The License is based on the Mozilla Public License Version 1.1, but Sections 14 +and 15 have been added to cover use of software over a computer network and +provide for limited attribution for the Original Developer. In addition, +Exhibit A has been modified to be consistent with Exhibit B. + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the +specific language governing rights and limitations under the License. + +The Original Code is Ethereal Engine. + +The Original Developer is the Initial Developer. The Initial Developer of the +Original Code is the Ethereal Engine team. + +All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 +Ethereal Engine. All Rights Reserved. +*/ + import Button from '@etherealengine/ui/src/primitives/tailwind/Button' import React from 'react' import { twMerge } from 'tailwind-merge' From dc7b1c40078e29d023c22557c187624a0d5c2b3d Mon Sep 17 00:00:00 2001 From: Andy Chen Date: Wed, 14 Aug 2024 15:30:02 -0400 Subject: [PATCH 4/4] update import --- packages/editor/src/components/toolbar/Toolbar.tsx | 2 +- .../tailwind/SidebarButton/{SidebarButton.tsx => index.tsx} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/ui/src/components/tailwind/SidebarButton/{SidebarButton.tsx => index.tsx} (100%) diff --git a/packages/editor/src/components/toolbar/Toolbar.tsx b/packages/editor/src/components/toolbar/Toolbar.tsx index 3ba4796d1c..798b785122 100644 --- a/packages/editor/src/components/toolbar/Toolbar.tsx +++ b/packages/editor/src/components/toolbar/Toolbar.tsx @@ -34,7 +34,7 @@ import { GLTFModifiedState } from '@etherealengine/engine/src/gltf/GLTFDocumentS import { getMutableState, getState, useHookstate, useMutableState } from '@etherealengine/hyperflux' import { useFind } from '@etherealengine/spatial/src/common/functions/FeathersHooks' import { ContextMenu } from '@etherealengine/ui/src/components/tailwind/ContextMenu' -import { SidebarButton } from '@etherealengine/ui/src/components/tailwind/SidebarButton/SidebarButton' +import { SidebarButton } from '@etherealengine/ui/src/components/tailwind/SidebarButton' import Button from '@etherealengine/ui/src/primitives/tailwind/Button' import { t } from 'i18next' import React from 'react' diff --git a/packages/ui/src/components/tailwind/SidebarButton/SidebarButton.tsx b/packages/ui/src/components/tailwind/SidebarButton/index.tsx similarity index 100% rename from packages/ui/src/components/tailwind/SidebarButton/SidebarButton.tsx rename to packages/ui/src/components/tailwind/SidebarButton/index.tsx