Skip to content

Commit

Permalink
feat: add Modal component + use it on ProjectAssetExplorer
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoecheza committed May 5, 2023
1 parent 1375762 commit ddee27e
Show file tree
Hide file tree
Showing 14 changed files with 202 additions and 61 deletions.
109 changes: 64 additions & 45 deletions packages/@dcl/inspector/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion packages/@dcl/inspector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,9 @@
"start": "node ./build.js --watch"
},
"types": "dist/tooling-entrypoint.d.ts",
"typings": "dist/tooling-entrypoint.d.ts"
"typings": "dist/tooling-entrypoint.d.ts",
"dependencies": {
"@types/react-modal": "^3.16.0",
"react-modal": "^3.16.1"
}
}
2 changes: 1 addition & 1 deletion packages/@dcl/inspector/src/components/Block/Block.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}

.Block.broken {
border: 1px #d33c3c dashed;
border: 1px var(--primary) dashed;
padding: 0 5px 8px 5px;
border-radius: 2px;
}
14 changes: 14 additions & 0 deletions packages/@dcl/inspector/src/components/Button/Button.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,17 @@
width: 24px;
height: 24px;
}

.Button.big {
padding: 16px;
font-size: 16px;
}

.Button.danger {
background-color: var(--primary);
}

.Button.danger:hover,
.Button.danger.active {
background-color: var(--primary-darker)
}
9 changes: 4 additions & 5 deletions packages/@dcl/inspector/src/components/Button/Button.tsx
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
7 changes: 6 additions & 1 deletion packages/@dcl/inspector/src/components/Button/types.ts
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'
}
Loading

0 comments on commit ddee27e

Please sign in to comment.