Skip to content

Commit bd21aea

Browse files
[Fix] Dialog fixed position breaking the view (#1186)
* [FIx] Dialog fixed position breaking the view * feat(dialog): add compatibility warning styling and className prop --------- Co-authored-by: Flavio F Lima <flavioislima@users.noreply.github.com> Co-authored-by: Brett <27568879+BrettCleary@users.noreply.github.com>
1 parent 4040583 commit bd21aea

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

src/frontend/components/UI/Dialog/index.css

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
.Dialog__element {
2-
top: 50%;
3-
left: 50%;
4-
transform: translate(-50%, -50%);
52
z-index: 1000;
63
display: flex;
74
flex-direction: column;
@@ -22,6 +19,12 @@
2219
--dialog-gap: 24px;
2320
}
2421

22+
.compatibility-warning {
23+
top: 50%;
24+
left: 50%;
25+
transform: translate(-50%, -50%);
26+
}
27+
2528
.Dialog__element[open] {
2629
opacity: 1;
2730
box-shadow: 0px 0px 0px 100vmax var(--modal-backdrop);

src/frontend/components/UI/DialogHandler/components/MessageBoxModal/index.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ interface MessageBoxModalProps {
2121
checkboxLabel?: string
2222
checkboxValue?: boolean
2323
isModal?: boolean
24+
className?: string
2425
}
2526

2627
const MessageBoxModal: React.FC<MessageBoxModalProps> = function (props) {
@@ -71,7 +72,10 @@ const MessageBoxModal: React.FC<MessageBoxModalProps> = function (props) {
7172
<Dialog
7273
onClose={props.onClose}
7374
showCloseButton
74-
className={classNames({ errorDialog: props.type === 'ERROR' })}
75+
className={classNames(
76+
{ errorDialog: props.type === 'ERROR' },
77+
props.className
78+
)}
7579
isModal={props.isModal}
7680
>
7781
<DialogHeader onClose={props.onClose}>{props.title}</DialogHeader>

src/frontend/components/UI/DialogHandler/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export default function DialogHandler() {
4444
buttons={dialogModalOptions.buttons ? dialogModalOptions.buttons : []}
4545
isModal={dialogModalOptions.isModal}
4646
onClose={() => handleClose()}
47+
className={dialogModalOptions.className}
4748
/>
4849
)}
4950
</>

src/frontend/helpers/library.ts

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ const launch = async ({
170170
'This Windows game will run using a compatibility layer. You might encounter some issues or the game might not work at all.'
171171
),
172172
title: t('infobox.warning', 'Warning'),
173+
className: 'compatibility-warning',
173174
buttons: [
174175
{
175176
text: t('gamepage:box.dont-show-again', "Don't show again"),

src/frontend/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export type DialogModalOptions = {
7474
type?: DialogType
7575
onClose?: () => void
7676
isModal?: boolean
77+
className?: string
7778
}
7879

7980
export interface ExternalLinkDialogOptions {

0 commit comments

Comments
 (0)