-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update RangeField component (#815)
* feat: Refactor TextField component * feat: Update RangeField component * feat: Update RangeField usage component * fix: Validate range value * fix: Update local value with the prop
- Loading branch information
Showing
18 changed files
with
419 additions
and
242 deletions.
There are no files selected for viewing
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
94 changes: 0 additions & 94 deletions
94
packages/@dcl/inspector/src/components/EntityInspector/RangeField/RangeField.css
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
packages/@dcl/inspector/src/components/EntityInspector/RangeField/RangeField.tsx
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
packages/@dcl/inspector/src/components/ui/ErrorMessage/ErrorMessage.css
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,15 @@ | ||
.ErrorMessage { | ||
display: flex; | ||
align-items: center; | ||
color: var(--error-main); | ||
font-size: 12px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 100%; | ||
min-height: 16px; | ||
gap: 2px; | ||
} | ||
|
||
.ErrorMessage svg { | ||
margin: 0 !important; | ||
} |
22 changes: 22 additions & 0 deletions
22
packages/@dcl/inspector/src/components/ui/ErrorMessage/ErrorMessage.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react' | ||
import cx from 'classnames' | ||
import { IoAlertCircleOutline as AlertIcon } from 'react-icons/io5' | ||
|
||
import type { Props } from './types' | ||
|
||
import './ErrorMessage.css' | ||
|
||
const ErrorMessage: React.FC<Props> = ({ className, error }) => { | ||
if (!error || typeof error !== 'string') { | ||
return null | ||
} | ||
|
||
return ( | ||
<p className={cx('ErrorMessage', className)}> | ||
<AlertIcon /> | ||
<span>{error}</span> | ||
</p> | ||
) | ||
} | ||
|
||
export default React.memo(ErrorMessage) |
2 changes: 2 additions & 0 deletions
2
packages/@dcl/inspector/src/components/ui/ErrorMessage/index.ts
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 ErrorMessage from './ErrorMessage' | ||
export { ErrorMessage } |
4 changes: 4 additions & 0 deletions
4
packages/@dcl/inspector/src/components/ui/ErrorMessage/types.ts
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 @@ | ||
export type Props = { | ||
error?: string | boolean | ||
className?: string | ||
} |
Oops, something went wrong.