summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/components/Modal.tsx
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2024-01-16 13:45:32 +0100
committerOskar Nyberg <oskar@mullvad.net>2024-01-29 09:33:49 +0100
commite5cfedffc08ccdcf7f703b2ae8e565ccc7407295 (patch)
tree1f2909d9db0ab53755c7f57c90c265bfdc133141 /gui/src/renderer/components/Modal.tsx
parent7a16c4b1fd1b210699dbeb8d72c64ebda9e55251 (diff)
downloadmullvadvpn-e5cfedffc08ccdcf7f703b2ae8e565ccc7407295.tar.xz
mullvadvpn-e5cfedffc08ccdcf7f703b2ae8e565ccc7407295.zip
Add small button component
Diffstat (limited to 'gui/src/renderer/components/Modal.tsx')
-rw-r--r--gui/src/renderer/components/Modal.tsx23
1 files changed, 17 insertions, 6 deletions
diff --git a/gui/src/renderer/components/Modal.tsx b/gui/src/renderer/components/Modal.tsx
index 60b7dd1473..64e92daa95 100644
--- a/gui/src/renderer/components/Modal.tsx
+++ b/gui/src/renderer/components/Modal.tsx
@@ -10,6 +10,7 @@ import { measurements, tinyText } from './common-styles';
import CustomScrollbars from './CustomScrollbars';
import ImageView from './ImageView';
import { BackAction } from './KeyboardNavigation';
+import { SmallButtonGrid } from './SmallButton';
const MODAL_CONTAINER_ID = 'modal-container';
@@ -147,6 +148,10 @@ const ModalAlertButtonGroupContainer = styled.div({
marginTop: measurements.buttonVerticalMargin,
});
+const StyledSmallButtonGrid = styled(SmallButtonGrid)({
+ marginRight: '16px',
+});
+
const ModalAlertButtonContainer = styled.div({
display: 'flex',
flexDirection: 'column',
@@ -157,7 +162,8 @@ interface IModalAlertProps {
type?: ModalAlertType;
iconColor?: string;
message?: string | Array<string>;
- buttons: React.ReactNode[];
+ buttons?: React.ReactNode[];
+ gridButtons?: React.ReactNode[];
children?: React.ReactNode;
close?: () => void;
}
@@ -277,11 +283,16 @@ class ModalAlertImpl extends React.Component<IModalAlertImplProps, IModalAlertSt
</StyledCustomScrollbars>
<ModalAlertButtonGroupContainer>
- <AppButton.ButtonGroup>
- {this.props.buttons.map((button, index) => (
- <ModalAlertButtonContainer key={index}>{button}</ModalAlertButtonContainer>
- ))}
- </AppButton.ButtonGroup>
+ {this.props.gridButtons && (
+ <StyledSmallButtonGrid>{this.props.gridButtons}</StyledSmallButtonGrid>
+ )}
+ {this.props.buttons && (
+ <AppButton.ButtonGroup>
+ {this.props.buttons.map((button, index) => (
+ <ModalAlertButtonContainer key={index}>{button}</ModalAlertButtonContainer>
+ ))}
+ </AppButton.ButtonGroup>
+ )}
</ModalAlertButtonGroupContainer>
</StyledModalAlert>
</ModalAlertContainer>