Skip to content

Commit

Permalink
fix: update back button navigation on syncs configuration (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitd94 authored Apr 12, 2024
1 parent 14b2092 commit f685846
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ui/src/views/Activate/Syncs/EditSync/EditSync.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ const EditSync = (): JSX.Element | null => {
isDocumentsSectionRequired
isContinueCtaRequired
isBackRequired
navigateToListScreen
listScreenUrl='/activate/syncs'
/>
</Box>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ type SourceFormFooterProps = {
isDocumentsSectionRequired?: boolean;
isAlignToContentContainer?: boolean;
extra?: JSX.Element;
navigateToListScreen?: boolean;
listScreenUrl?: string;
};

const SourceFormFooter = ({
Expand All @@ -25,11 +27,13 @@ const SourceFormFooter = ({
onCtaClick,
isBackRequired,
extra,
listScreenUrl,
isCtaLoading = false,
isCtaDisabled = false,
isContinueCtaRequired = false,
isDocumentsSectionRequired = false,
secondaryCtaText = 'Back',
navigateToListScreen = false,
}: SourceFormFooterProps): JSX.Element => {
const [leftOffset, setLeftOffet] = useState<number>(0);
const { maxContentWidth } = useUiConfig();
Expand Down Expand Up @@ -93,7 +97,11 @@ const SourceFormFooter = ({
{extra}
{isBackRequired ? (
<Button
onClick={() => navigate(-1)}
onClick={() =>
navigateToListScreen && listScreenUrl
? navigate(listScreenUrl, { replace: true })
: navigate(-1)
}
marginRight={isContinueCtaRequired ? '10px' : '0'}
variant='ghost'
minWidth={0}
Expand Down

0 comments on commit f685846

Please sign in to comment.