Scraper and plugin manager (#4242)

* Add package manager
* Add SettingModal validate
* Reverse modal button order
* Add plugin package management
* Refactor ClearableInput
This commit is contained in:
WithoutPants
2023-11-22 10:01:11 +11:00
committed by GitHub
parent d95ef4059a
commit 987fa80786
42 changed files with 3484 additions and 35 deletions

View File

@@ -253,6 +253,7 @@ export interface ISettingModal<T> {
close: (v?: T) => void;
renderField: (value: T | undefined, setValue: (v?: T) => void) => JSX.Element;
modalProps?: ModalProps;
validate?: (v: T) => boolean | undefined;
}
export const SettingModal = <T extends {}>(props: ISettingModal<T>) => {
@@ -265,6 +266,7 @@ export const SettingModal = <T extends {}>(props: ISettingModal<T>) => {
close,
renderField,
modalProps,
validate,
} = props;
const intl = useIntl();
@@ -299,6 +301,7 @@ export const SettingModal = <T extends {}>(props: ISettingModal<T>) => {
type="submit"
variant="primary"
onClick={() => close(currentValue)}
disabled={!currentValue || (validate && !validate(currentValue))}
>
<FormattedMessage id="actions.confirm" />
</Button>