mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-25 13:02:15 +03:00
feat: only show Update View button if view can be persisted (#1533)
Closes #1499
This commit is contained in:
parent
9be069bedc
commit
110d5eaa9d
@ -67,6 +67,10 @@ export const UpdateViewButtonGroup = ({
|
||||
|
||||
const setViewEditMode = useSetRecoilState(viewEditModeState);
|
||||
|
||||
const canPersistView =
|
||||
currentViewId &&
|
||||
(canPersistViewFields || canPersistFilters || canPersistSorts);
|
||||
|
||||
const handleArrowDownButtonClick = useCallback(() => {
|
||||
setIsDropdownOpen((previousIsOpen) => !previousIsOpen);
|
||||
}, []);
|
||||
@ -95,17 +99,12 @@ export const UpdateViewButtonGroup = ({
|
||||
[],
|
||||
);
|
||||
|
||||
if (!canPersistView) return null;
|
||||
|
||||
return (
|
||||
<StyledContainer>
|
||||
<ButtonGroup size="small" accent="blue">
|
||||
<Button
|
||||
title="Update view"
|
||||
disabled={
|
||||
!currentViewId ||
|
||||
(!canPersistViewFields && !canPersistFilters && !canPersistSorts)
|
||||
}
|
||||
onClick={handleViewSubmit}
|
||||
/>
|
||||
<Button title="Update view" onClick={handleViewSubmit} />
|
||||
<Button
|
||||
size="small"
|
||||
Icon={IconChevronDown}
|
||||
|
Loading…
Reference in New Issue
Block a user