summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/components/Modal.tsx
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2023-10-24 13:34:02 +0200
committerOskar Nyberg <oskar@mullvad.net>2023-10-30 18:03:44 +0100
commitdb89a8d51de88ca08599fa331f6376ef477d15e8 (patch)
tree6f484297196d8cd377d090f69aff12d3c51ea5a4 /gui/src/renderer/components/Modal.tsx
parent754b15058eaf37dba76387f803e623a94698242f (diff)
downloadmullvadvpn-db89a8d51de88ca08599fa331f6376ef477d15e8.tar.xz
mullvadvpn-db89a8d51de88ca08599fa331f6376ef477d15e8.zip
Adjust codebase to breaking changes in styled components v6
Diffstat (limited to 'gui/src/renderer/components/Modal.tsx')
-rw-r--r--gui/src/renderer/components/Modal.tsx22
1 files changed, 11 insertions, 11 deletions
diff --git a/gui/src/renderer/components/Modal.tsx b/gui/src/renderer/components/Modal.tsx
index d9be9e767d..e87e2113f2 100644
--- a/gui/src/renderer/components/Modal.tsx
+++ b/gui/src/renderer/components/Modal.tsx
@@ -25,9 +25,9 @@ const ModalContent = styled.div({
overflow: 'hidden',
});
-const ModalBackground = styled.div({}, (props: { visible: boolean }) => ({
- backgroundColor: props.visible ? 'rgba(0,0,0,0.5)' : 'rgba(0,0,0,0)',
- backdropFilter: props.visible ? 'blur(1.5px)' : '',
+const ModalBackground = styled.div<{ $visible: boolean }>((props) => ({
+ backgroundColor: props.$visible ? 'rgba(0,0,0,0.5)' : 'rgba(0,0,0,0)',
+ backdropFilter: props.$visible ? 'blur(1.5px)' : '',
position: 'absolute',
display: 'flex',
flexDirection: 'column',
@@ -37,7 +37,7 @@ const ModalBackground = styled.div({}, (props: { visible: boolean }) => ({
right: 0,
bottom: 0,
transition: 'background-color 150ms ease-out',
- pointerEvents: props.visible ? 'auto' : 'none',
+ pointerEvents: props.$visible ? 'auto' : 'none',
zIndex: 2,
}));
@@ -111,11 +111,11 @@ const ModalAlertContainer = styled.div({
padding: '14px',
});
-const StyledModalAlert = styled.div({}, (props: { visible: boolean; closing: boolean }) => {
+const StyledModalAlert = styled.div<{ $visible: boolean; $closing: boolean }>((props) => {
let transform = '';
- if (props.visible && props.closing) {
+ if (props.$visible && props.$closing) {
transform = 'scale(80%)';
- } else if (!props.visible) {
+ } else if (!props.$visible) {
transform = 'translateY(10px) scale(98%)';
}
@@ -126,7 +126,7 @@ const StyledModalAlert = styled.div({}, (props: { visible: boolean; closing: boo
borderRadius: '11px',
padding: '16px 0 16px 16px',
maxHeight: '80vh',
- opacity: props.visible && !props.closing ? 1 : 0,
+ opacity: props.$visible && !props.$closing ? 1 : 0,
transform,
boxShadow: ' 0px 15px 35px 5px rgba(0,0,0,0.5)',
transition: 'all 150ms ease-out',
@@ -254,15 +254,15 @@ class ModalAlertImpl extends React.Component<IModalAlertImplProps, IModalAlertSt
private renderModal() {
return (
<BackAction action={this.close}>
- <ModalBackground visible={this.state.visible && !this.props.closing}>
+ <ModalBackground $visible={this.state.visible && !this.props.closing}>
<ModalAlertContainer>
<StyledModalAlert
ref={this.modalRef}
tabIndex={-1}
role="dialog"
aria-modal
- visible={this.state.visible}
- closing={this.props.closing}
+ $visible={this.state.visible}
+ $closing={this.props.closing}
onTransitionEnd={this.onTransitionEnd}>
<StyledCustomScrollbars>
{this.props.type && (