Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/modules/integration-picker/IntegrationPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ export const IntegrationPicker: React.FC<IntegrationPickerProps> = ({
glassFooter
footer={
connectionState.success ? (
<SuccessCardFooter
onClose={() => onClose?.()}
showFooterLinks={showFooterLinks}
/>
<SuccessCardFooter onClose={onClose} showFooterLinks={showFooterLinks} />
) : (
<CardFooter
selectedIntegration={selectedIntegration}
Expand Down
39 changes: 27 additions & 12 deletions src/modules/integration-picker/components/successCardFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,38 @@ import {
} from '@stackone/malachite';

interface CardFooterProps {
onClose: () => void;
onClose?: () => void;
showFooterLinks?: boolean;
}

const SuccessCardFooter: React.FC<CardFooterProps> = ({ showFooterLinks = true, onClose }) => {
const hasFooterLinks = showFooterLinks;
const hasClose = Boolean(onClose);

if (!hasFooterLinks && !hasClose) {
return null;
}

return (
<Spacer direction="horizontal" size={4} justifyContent="space-between">
{showFooterLinks && <FooterLinks fullWidth />}
<Padded vertical="none" horizontal="small" fullHeight={false}>
<Flex direction={FlexDirection.Horizontal} justify={FlexJustify.Right}>
<Spacer direction="horizontal" size={10}>
<Button size="small" variant="filled" onClick={onClose}>
Close
</Button>
</Spacer>
</Flex>
</Padded>
<Spacer
direction="horizontal"
size={4}
justifyContent={
hasFooterLinks && hasClose ? 'space-between' : hasClose ? 'end' : undefined
}
>
{hasFooterLinks && <FooterLinks fullWidth />}
{hasClose && (
<Padded vertical="none" horizontal="small" fullHeight={false}>
<Flex direction={FlexDirection.Horizontal} justify={FlexJustify.Right}>
<Spacer direction="horizontal" size={10}>
<Button size="small" variant="filled" onClick={onClose}>
Close
</Button>
</Spacer>
</Flex>
</Padded>
)}
</Spacer>
);
};
Expand Down
Loading