mirror of
https://github.com/strapi/strapi.git
synced 2025-08-01 21:36:25 +00:00
fixed edit folder move error message and style
This commit is contained in:
parent
7501348524
commit
cc76f01140
@ -11,7 +11,7 @@ import getSelectStyles from './utils/getSelectStyles';
|
|||||||
|
|
||||||
const ReactSelect = ({ components, styles, ...props }) => {
|
const ReactSelect = ({ components, styles, ...props }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const customStyles = getSelectStyles(theme);
|
const customStyles = getSelectStyles(theme, props);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Select
|
<Select
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const getSelectStyles = theme => {
|
const getSelectStyles = (theme, { 'aria-errormessage': error }) => {
|
||||||
return {
|
return {
|
||||||
clearIndicator: base => ({ ...base, padding: 0, paddingRight: theme.spaces[3] }),
|
clearIndicator: base => ({ ...base, padding: 0, paddingRight: theme.spaces[3] }),
|
||||||
container: base => ({
|
container: base => ({
|
||||||
@ -13,6 +13,8 @@ const getSelectStyles = theme => {
|
|||||||
|
|
||||||
if (state.isFocused) {
|
if (state.isFocused) {
|
||||||
border = `1px solid ${theme.colors.primary600} !important`;
|
border = `1px solid ${theme.colors.primary600} !important`;
|
||||||
|
} else if (error) {
|
||||||
|
border = `1px solid ${theme.colors.danger600} !important`;
|
||||||
} else {
|
} else {
|
||||||
border = `1px solid ${theme.colors.neutral200} !important`;
|
border = `1px solid ${theme.colors.neutral200} !important`;
|
||||||
}
|
}
|
||||||
|
@ -45,10 +45,10 @@ export const EditFolderDialog = ({ onClose, folder, parentFolderId }) => {
|
|||||||
const submitButtonRef = useRef(null);
|
const submitButtonRef = useRef(null);
|
||||||
const [showConfirmDialog, setShowConfirmDialog] = useState(false);
|
const [showConfirmDialog, setShowConfirmDialog] = useState(false);
|
||||||
const { formatMessage, formatDate } = useIntl();
|
const { formatMessage, formatDate } = useIntl();
|
||||||
const { editFolder, isLoading: isEditFolderLoading } = useEditFolder();
|
const { editFolder } = useEditFolder();
|
||||||
const { remove } = useBulkRemove();
|
const { remove } = useBulkRemove();
|
||||||
const toggleNotification = useNotification();
|
const toggleNotification = useNotification();
|
||||||
const isLoading = isLoadingPermissions || folderStructureIsLoading || isEditFolderLoading;
|
const isLoading = isLoadingPermissions || folderStructureIsLoading;
|
||||||
const isEditing = !!folder;
|
const isEditing = !!folder;
|
||||||
const formDisabled = (folder && !canUpdate) || (!folder && !canCreate);
|
const formDisabled = (folder && !canUpdate) || (!folder && !canCreate);
|
||||||
const initialFormData = !folderStructureIsLoading && {
|
const initialFormData = !folderStructureIsLoading && {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user