mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user