fixed edit folder move error message and style

This commit is contained in:
ronronscelestes 2022-06-07 19:09:45 +02:00
parent 7501348524
commit cc76f01140
3 changed files with 6 additions and 4 deletions

View File

@ -11,7 +11,7 @@ import getSelectStyles from './utils/getSelectStyles';
const ReactSelect = ({ components, styles, ...props }) => {
const theme = useTheme();
const customStyles = getSelectStyles(theme);
const customStyles = getSelectStyles(theme, props);
return (
<Select

View File

@ -1,4 +1,4 @@
const getSelectStyles = theme => {
const getSelectStyles = (theme, { 'aria-errormessage': error }) => {
return {
clearIndicator: base => ({ ...base, padding: 0, paddingRight: theme.spaces[3] }),
container: base => ({
@ -13,6 +13,8 @@ const getSelectStyles = theme => {
if (state.isFocused) {
border = `1px solid ${theme.colors.primary600} !important`;
} else if (error) {
border = `1px solid ${theme.colors.danger600} !important`;
} else {
border = `1px solid ${theme.colors.neutral200} !important`;
}

View File

@ -45,10 +45,10 @@ export const EditFolderDialog = ({ onClose, folder, parentFolderId }) => {
const submitButtonRef = useRef(null);
const [showConfirmDialog, setShowConfirmDialog] = useState(false);
const { formatMessage, formatDate } = useIntl();
const { editFolder, isLoading: isEditFolderLoading } = useEditFolder();
const { editFolder } = useEditFolder();
const { remove } = useBulkRemove();
const toggleNotification = useNotification();
const isLoading = isLoadingPermissions || folderStructureIsLoading || isEditFolderLoading;
const isLoading = isLoadingPermissions || folderStructureIsLoading;
const isEditing = !!folder;
const formDisabled = (folder && !canUpdate) || (!folder && !canCreate);
const initialFormData = !folderStructureIsLoading && {