Skip to content

Commit de373ea

Browse files
committed
style the popup
1 parent 7223b17 commit de373ea

File tree

2 files changed

+65
-11
lines changed

2 files changed

+65
-11
lines changed

src/webviews/src/modules/key-details/components/rejson-details/rejson-object/RejsonConfirmDialog.tsx

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { VSCodeButton } from '@vscode/webview-ui-toolkit/react'
55
import * as l10n from '@vscode/l10n'
66

77
import { RiButton } from 'uiSrc/ui'
8+
import styles from '../styles.module.scss'
89

910
export interface ReJSONConfirmDialogProps {
1011
open: boolean
@@ -17,12 +18,21 @@ const ReJSONConfirmDialog = ({
1718
onClose,
1819
onConfirm,
1920
}: ReJSONConfirmDialogProps) => (
20-
<Popup modal open={open} closeOnDocumentClick={false} className="">
21-
<h1>{l10n.t('Duplicate JSON key detected')}</h1>
21+
<Popup
22+
modal
23+
open={open}
24+
closeOnDocumentClick={false}
25+
className={styles.confirmPopup}
26+
>
27+
<h1 className={styles.confirmPopupH1}>
28+
{l10n.t('Duplicate JSON key detected')}
29+
</h1>
2230

23-
<h2>{l10n.t('You already have the same JSON key.')}</h2>
31+
<h2 className={styles.confirmPopupH2}>
32+
{l10n.t('You already have the same JSON key.')}
33+
</h2>
2434

25-
<p>
35+
<p className={styles.confirmPopupText}>
2636
{l10n.t(
2737
'If you proceed, a value of the existing JSON key will be overwritten.',
2838
)}
@@ -32,13 +42,25 @@ const ReJSONConfirmDialog = ({
3242
<VscClose />
3343
</RiButton>
3444

35-
<VSCodeButton
36-
appearance="primary"
37-
data-testid="confirm-btn"
38-
onClick={onConfirm}
39-
>
40-
{l10n.t('Overwrite')}
41-
</VSCodeButton>
45+
<div className={styles.confirmPopupActions}>
46+
<VSCodeButton
47+
appearance="primary"
48+
data-testid="confirm-btn"
49+
className={styles.confirmPopupButton}
50+
onClick={onConfirm}
51+
>
52+
{l10n.t('Overwrite')}
53+
</VSCodeButton>
54+
55+
<VSCodeButton
56+
appearance="secondary"
57+
data-testid="cancel-btn"
58+
className={styles.confirmPopupButton}
59+
onClick={onClose}
60+
>
61+
{l10n.t('Cancel')}
62+
</VSCodeButton>
63+
</div>
4264
</Popup>
4365
)
4466

src/webviews/src/modules/key-details/components/rejson-details/styles.module.scss

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,35 @@
164164
.jsonButtonStyle {
165165
@apply z-[1];
166166
}
167+
168+
.confirmPopup {
169+
padding: 8px 16px;
170+
}
171+
172+
.confirmPopupH1 {
173+
@apply text-[16px] font-semibold;
174+
margin-bottom: 12px;
175+
}
176+
177+
.confirmPopupH2 {
178+
@apply text-[14px] font-normal;
179+
margin-bottom: 8px;
180+
}
181+
182+
.confirmPopupText {
183+
@apply text-[14px] font-normal;
184+
margin-bottom: 16px;
185+
}
186+
187+
.confirmPopupActions {
188+
@apply flex;
189+
}
190+
191+
.confirmPopupButton {
192+
@apply min-w-[85px];
193+
margin-right: 8px;
194+
195+
&:last-child {
196+
margin-right: 0;
197+
}
198+
}

0 commit comments

Comments
 (0)