From 004b91b3e635d15bf1601fa1c4b3c4d510e82048 Mon Sep 17 00:00:00 2001 From: Josh Field Date: Mon, 29 Jul 2024 21:36:12 +1000 Subject: [PATCH] remove unused files functions (#10749) --- .../editor/src/components/inputs/Button.tsx | 76 ------------------- .../src/components/layout/ContextMenu.tsx | 66 ---------------- .../editor/src/components/layout/Tooltip.tsx | 66 ---------------- 3 files changed, 208 deletions(-) delete mode 100755 packages/editor/src/components/layout/ContextMenu.tsx delete mode 100755 packages/editor/src/components/layout/Tooltip.tsx diff --git a/packages/editor/src/components/inputs/Button.tsx b/packages/editor/src/components/inputs/Button.tsx index 751e9c531f..ad1ca69654 100755 --- a/packages/editor/src/components/inputs/Button.tsx +++ b/packages/editor/src/components/inputs/Button.tsx @@ -65,79 +65,3 @@ export const MediumButton = ({ ) } -/** - * LargeButton used to create large size button. - * - * @type {Component} - */ -export const LargeButton = ({ - type = 'button' as 'button' | 'submit' | 'reset', - onClick, - children, - className = 'button', - ...rest -}) => { - const buttonClass = `large-button ${className}` - return ( - - ) -} -/** - * SecondaryButton is the button used for performing secondary action like cancel. - * - * @type {Component} - */ -export const SecondaryButton = ({ - type = 'button' as 'button' | 'submit' | 'reset', - onClick, - children, - className = 'button', - ...rest -}) => { - const buttonClass = `secondary-button ${className}` - return ( - - ) -} -/** - * MenuButton used to show menus like context menus. - * - * @type {Component} - */ -export const MenuButton = ({ - type = 'button' as 'button' | 'submit' | 'reset', - onClick, - children, - className = 'button', - ...rest -}) => { - const buttonClass = `menu-button ${className}` - return ( - - ) -} -/** - * PropertiesPanelButton used in property penal like in ScenePreviewCamera nodes we using it as set from viewport. - * - * @type {Component} - */ -export const PropertiesPanelButton = ({ - type = 'button' as 'button' | 'submit' | 'reset', - onClick, - children, - className = 'button', - ...rest -}) => { - const buttonClass = `properties-panel-button ${className}` - return ( - - ) -} diff --git a/packages/editor/src/components/layout/ContextMenu.tsx b/packages/editor/src/components/layout/ContextMenu.tsx deleted file mode 100755 index 29d9a1954d..0000000000 --- a/packages/editor/src/components/layout/ContextMenu.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/* -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 { Menu, PopoverPosition } from '@mui/material' -import React from 'react' - -import styles from './styles.module.scss' - -type ContextMenuProps = { - open: boolean - anchorEl: null | HTMLElement - anchorPosition: undefined | PopoverPosition - rootStyle?: React.CSSProperties | undefined - onClose: () => void -} - -export const ContextMenu = ({ - children, - open, - anchorEl, - anchorPosition, - rootStyle, - onClose -}: React.PropsWithChildren) => { - return ( - { - event.preventDefault() - event.stopPropagation() - }} - > - {children} - - ) -} diff --git a/packages/editor/src/components/layout/Tooltip.tsx b/packages/editor/src/components/layout/Tooltip.tsx deleted file mode 100755 index af73556e9c..0000000000 --- a/packages/editor/src/components/layout/Tooltip.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/* -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 { Tooltip, TooltipProps } from '@mui/material' -import createStyles from '@mui/styles/createStyles' -import makeStyles from '@mui/styles/makeStyles' -import React from 'react' - -const useStyles = makeStyles((theme: any) => { - return createStyles({ - tooltip: { - background: theme.panel - } - }) -}) - -/** - * @param {Object} props - * @param {string} props.info additional info added to the tooltip label - */ -export function InfoTooltip(props: TooltipProps & { info?: string }) { - if (!props.title) return <>{props.children} - - const title = props.info ? ( -

- {props.title} -


- {props.info} -

- ) : ( - props.title - ) - - const styles = useStyles({}) - - return ( - - {/* Span is required to trigger events like hover in safari for disabled elements */} - {props.children} - - ) -} - -export default Tooltip