-
Notifications
You must be signed in to change notification settings - Fork 680
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: revert textedit changes (#1375)
* Revert "style: with buttons" This reverts commit c40c2a6. * Revert "refactor: fix <TextEdit /> bugs" This reverts commit 6dc700e.
- Loading branch information
Showing
4 changed files
with
60 additions
and
45 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
37 changes: 37 additions & 0 deletions
37
src/frontend/components/property-type/currency/currency-input-wrapper.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,37 @@ | ||
import { CurrencyInput, CurrencyInputProps } from '@adminjs/design-system' | ||
import React, { FC, useState } from 'react' | ||
|
||
import allowOverride from '../../../hoc/allow-override' | ||
|
||
export type CurrencyInputWrapperProps = { | ||
id: string; | ||
initial: string; | ||
options?: CurrencyInputProps | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
onChange: (value: string | undefined) => void; | ||
} | ||
|
||
const CurrencyInputWrapper: FC<CurrencyInputWrapperProps> = (props) => { | ||
const { id, initial, onChange, options } = props | ||
const [value, setValue] = useState<string | undefined>(initial) | ||
const onValueChange = (currentValue: string | undefined): void => { | ||
setValue(currentValue) | ||
onChange(currentValue) | ||
} | ||
return ( | ||
<CurrencyInput | ||
id={id} | ||
name={id} | ||
value={value} | ||
onValueChange={onValueChange} | ||
{...options} | ||
/> | ||
) | ||
} | ||
|
||
const OverridableCurrencyInputWrapper = allowOverride(CurrencyInputWrapper, 'CurrencyPropertyInputWrapper') | ||
|
||
export { | ||
OverridableCurrencyInputWrapper as CurrencyInputWrapper, | ||
OverridableCurrencyInputWrapper as default, | ||
} |
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