-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove self-contained GLTF/GLB asset (#569)
* feat: add assset removal * feat: add Modal component + use it on ProjectAssetExplorer * fix: comments
- Loading branch information
1 parent
f7826d6
commit a1c5020
Showing
27 changed files
with
280 additions
and
40 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export type Props = { | ||
label?: string | ||
error?: boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
import React from 'react' | ||
import classNames from 'classnames' | ||
import cx from 'classnames' | ||
|
||
import { PropTypes } from './types' | ||
import './Button.css' | ||
|
||
function Button(props: PropTypes) { | ||
function Button({ size, type, ...props }: PropTypes) { | ||
return ( | ||
<button {...props} className={classNames('Button', props.className)}> | ||
<button {...props} className={cx('Button', size, type, props.className)}> | ||
{props.children} | ||
</button> | ||
) | ||
} | ||
|
||
export default Button | ||
export default Button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
export type PropTypes = React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> | ||
type Button = React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> | ||
|
||
export type PropTypes = Omit<Button, 'type' | 'size'> & { | ||
type?: 'danger' | 'etc' | ||
size?: 'big' | 'etc' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.Modal { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
margin-right: -50%; | ||
transform: translate(-50%, -50%); | ||
border: 1px solid var(--modal-content-border-color); | ||
background: var(--modal-content-bg-color); | ||
overflow: auto; | ||
border-radius: 3px; | ||
outline: none; | ||
padding: 20px; | ||
min-width: 500px; | ||
min-height: 200px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
} | ||
|
||
.ModalOverlay { | ||
position: fixed; | ||
inset: 0px; | ||
background-color: var(--modal-overlay-bg-color); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react' | ||
import _Modal from 'react-modal' | ||
|
||
import { Props } from './types' | ||
|
||
import './Modal.css' | ||
|
||
const Modal = ({ | ||
children, | ||
className = '', | ||
overlayClassName = '', | ||
...props | ||
}: Props) => { | ||
return ( | ||
<_Modal | ||
ariaHideApp={false} | ||
className={`${className} Modal`} | ||
overlayClassName={`${overlayClassName} ModalOverlay`} | ||
{...props} | ||
> | ||
{children} | ||
</_Modal> | ||
) | ||
} | ||
|
||
export default React.memo(Modal) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Modal from './Modal' | ||
export { Modal } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import React from 'react' | ||
import Modal from 'react-modal' | ||
|
||
export type Props = React.PropsWithChildren<Modal.Props> |
12 changes: 9 additions & 3 deletions
12
packages/@dcl/inspector/src/components/ProjectAssetExplorer/ContextMenu.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,8 @@ | |
|
||
.ProjectView .with-context-menu { | ||
height: 100%; | ||
} | ||
} | ||
|
||
.RemoveAsset.Modal > div button { | ||
margin-right: 12px; | ||
} |
Oops, something went wrong.