From 1444c61d64187db9d722f739ee6d0eb32d4b1a18 Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Thu, 22 Jul 2021 21:56:45 +0200 Subject: [PATCH] Moved all of r3f's UI elements to Studio --- .../Toolbar/TransformControlsSpaceSelect.tsx | 8 +- .../Toolbar/ViewportShadingSelect.tsx | 12 +- .../Toolbar/utils/CompactModeSelect.tsx | 115 ------------------ .../src/components/Toolbar/utils/Tooltip.tsx | 26 ---- 4 files changed, 10 insertions(+), 151 deletions(-) delete mode 100644 packages/plugin-r3f/src/components/Toolbar/utils/CompactModeSelect.tsx delete mode 100644 packages/plugin-r3f/src/components/Toolbar/utils/Tooltip.tsx diff --git a/packages/plugin-r3f/src/components/Toolbar/TransformControlsSpaceSelect.tsx b/packages/plugin-r3f/src/components/Toolbar/TransformControlsSpaceSelect.tsx index 8e89a09..c6fa155 100644 --- a/packages/plugin-r3f/src/components/Toolbar/TransformControlsSpaceSelect.tsx +++ b/packages/plugin-r3f/src/components/Toolbar/TransformControlsSpaceSelect.tsx @@ -2,7 +2,7 @@ import type {VFC} from 'react' import React from 'react' import type {TransformControlsSpace} from '../../store' import {BiCube, BiGlobe} from 'react-icons/all' -import CompactModeSelect from './utils/CompactModeSelect' +import {ToolbarSwitchSelect} from '@theatre/studio' export interface TransformControlsSpaceSelectProps { value: TransformControlsSpace @@ -13,17 +13,17 @@ const TransformControlsSpaceSelect: VFC = ({ value, onChange, }) => ( - , }, { - option: 'local', + value: 'local', label: 'Space: Local', icon: , }, diff --git a/packages/plugin-r3f/src/components/Toolbar/ViewportShadingSelect.tsx b/packages/plugin-r3f/src/components/Toolbar/ViewportShadingSelect.tsx index 1f6718e..f3b1abc 100644 --- a/packages/plugin-r3f/src/components/Toolbar/ViewportShadingSelect.tsx +++ b/packages/plugin-r3f/src/components/Toolbar/ViewportShadingSelect.tsx @@ -2,7 +2,7 @@ import type {VFC} from 'react' import React from 'react' import type {ViewportShading} from '../../store' import {FaCube, GiCube, GiIceCube, BiCube} from 'react-icons/all' -import CompactModeSelect from './utils/CompactModeSelect' +import {ToolbarSwitchSelect} from '@theatre/studio' export interface ViewportShadingSelectProps { value: ViewportShading @@ -13,27 +13,27 @@ const ViewportShadingSelect: VFC = ({ value, onChange, }) => ( - , }, { - option: 'flat', + value: 'flat', label: 'Display: Flat', icon: , }, { - option: 'solid', + value: 'solid', label: 'Display: Solid', icon: , }, { - option: 'rendered', + value: 'rendered', label: 'Display: Rendered', icon: , }, diff --git a/packages/plugin-r3f/src/components/Toolbar/utils/CompactModeSelect.tsx b/packages/plugin-r3f/src/components/Toolbar/utils/CompactModeSelect.tsx deleted file mode 100644 index 2635023..0000000 --- a/packages/plugin-r3f/src/components/Toolbar/utils/CompactModeSelect.tsx +++ /dev/null @@ -1,115 +0,0 @@ -import type {ReactElement, ReactNode} from 'react' -import React from 'react' -import type {IconType} from 'react-icons' -import {Group, Button} from 'reakit' -import styled from 'styled-components' -import {Tooltip, TooltipReference, useTooltipState} from './Tooltip' - -interface OptionButtonProps