Skip to content

Commit 3a31e31

Browse files
committed
Improve styling of mobile preview
1 parent 513811c commit 3a31e31

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

manager-dashboard/app/components/MobilePreview/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ interface Props {
1717
popupIcons?: React.ReactNode;
1818
contentClassName?: string;
1919
popupClassName?: string;
20+
popupVerticalPosition?: 'top' | 'center';
2021
}
2122

2223
function MobilePreview(props: Props) {
@@ -31,6 +32,7 @@ function MobilePreview(props: Props) {
3132
popupIcons,
3233
contentClassName,
3334
popupClassName,
35+
popupVerticalPosition,
3436
} = props;
3537

3638
return (
@@ -57,7 +59,13 @@ function MobilePreview(props: Props) {
5759
</div>
5860
<div className={styles.contentContainer}>
5961
{(popupTitle || popupDescription || popupIcons) && (
60-
<div className={_cs(styles.popup, popupClassName)}>
62+
<div
63+
className={_cs(
64+
styles.popup,
65+
popupClassName,
66+
popupVerticalPosition === 'center' && styles.verticallyCentered,
67+
)}
68+
>
6169
<div className={styles.details}>
6270
<div className={styles.popupTitle}>
6371
{popupTitle}

manager-dashboard/app/components/MobilePreview/styles.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
border-radius: var(--radius-card-border);
66
background-color: var(--color-black);
77
padding: var(--spacing-small) 0;
8-
width: var(--width-mobile-preview);
8+
width: calc(var(--width-mobile-preview) + var(--width-separator-mobile-preview));
99
height: var(--height-mobile-preview);
1010
color: var(--color-text-on-dark);
1111

@@ -69,6 +69,11 @@
6969
width: calc(100% - 2 * var(--spacing-small));
7070
color: var(--color-text);
7171

72+
&.vertically-centered {
73+
top: 50%;
74+
transform: translateY(-50%);
75+
}
76+
7277
.details {
7378
flex-grow: 1;
7479

manager-dashboard/app/views/NewTutorial/ScenarioPageInput/ChangeDetectionGeoJsonPreview/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default function ChangeDetectionGeoJsonPreview(props: Props) {
5353
popupTitle={previewPopUp?.title || 'Title'}
5454
popupDescription={previewPopUp?.description || 'Description'}
5555
contentClassName={styles.content}
56-
popupClassName={styles.popup}
56+
popupVerticalPosition="center"
5757
>
5858
<GeoJsonPreview
5959
className={styles.mapPreview}

manager-dashboard/app/views/NewTutorial/ScenarioPageInput/ChangeDetectionGeoJsonPreview/styles.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,4 @@
1111
height: var(--height-mobile-preview-change-detection-content);
1212
}
1313
}
14-
15-
.popup {
16-
top: 50%!important;
17-
transform: translateY(-50%);
18-
}
1914
}

0 commit comments

Comments
 (0)