@@ -2,20 +2,95 @@ import { Alert, Button, Flex, Input, Modal, Typography } from 'antd';
22import { useState } from 'react' ;
33import styled from 'styled-components' ;
44
5+ import { COLOR } from '../../constants/theme' ;
56import { useUpdateSettings } from '../../hooks/useUpdateSettings' ;
67import { SettingsPatch } from '../../types' ;
78
89const { Text } = Typography ;
910
11+ // Modal chrome per Figma: 464px wide, 24px padding, 12px (Spacing/md) radius,
12+ // 3px translucent-white border, 20px/500/28px title, black close icon, and a
13+ // 12px gap between the footer buttons.
14+ const StyledModal = styled ( Modal ) `
15+ .ant-modal-content {
16+ padding: 24px;
17+ border-radius: 12px;
18+ border: 3px solid rgba(255, 255, 255, 0.25);
19+ }
20+
21+ .ant-modal-header {
22+ margin-bottom: 24px;
23+ }
24+
25+ .ant-modal-title {
26+ font-weight: 500;
27+ font-size: 20px;
28+ line-height: 28px;
29+ color: ${ COLOR . TEXT_TITLE } ;
30+ }
31+
32+ .ant-modal-close {
33+ top: 24px;
34+ inset-inline-end: 24px;
35+ color: ${ COLOR . BLACK } ;
36+ }
37+
38+ .ant-modal-close-icon {
39+ color: ${ COLOR . BLACK } ;
40+ }
41+
42+ .ant-modal-body {
43+ margin-bottom: 24px;
44+ }
45+
46+ .ant-modal-footer {
47+ margin-top: 0;
48+ display: flex;
49+ justify-content: flex-end;
50+ gap: 12px;
51+ }
52+
53+ .ant-modal-footer > .ant-btn + .ant-btn {
54+ margin-inline-start: 0;
55+ }
56+ ` ;
57+
58+ // Explanatory body copy — 16px / 400 / 24px, rgba(54, 63, 73, 1).
59+ const BodyText = styled . p `
60+ margin: 0;
61+ font-weight: 400;
62+ font-size: 16px;
63+ line-height: 24px;
64+ color: ${ COLOR . TEXT_SECONDARY } ;
65+ ` ;
66+
67+ // Field label — 14px tertiary, matching Pearl's password fields.
68+ const PasswordLabel = styled . label `
69+ font-size: 14px;
70+ line-height: 20px;
71+ color: ${ COLOR . TEXT_TERTIARY } ;
72+ ` ;
73+
74+ // Password field styled like Pearl's (olas-operate-app): small size, 6px 12px
75+ // padding, 16px text.
76+ const PasswordField = styled ( Input . Password ) `
77+ padding: 6px 12px;
78+
79+ input.ant-input {
80+ font-size: 16px;
81+ }
82+ ` ;
83+
1084// Disabled state per design: brand fill at 40% opacity with inset shadows,
1185// instead of antd's washed-out gray.
1286const ConfirmButton = styled ( Button ) `
1387 &:disabled {
1488 border-radius: 10px;
1589 opacity: 0.4;
16- color: #ffffff ;
90+ color: ${ COLOR . WHITE } ;
1791 border-color: transparent;
18- background: linear-gradient(0deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%), #7e22ce;
92+ background:
93+ linear-gradient(0deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%), ${ COLOR . PRIMARY } ;
1994 background-blend-mode: overlay, normal;
2095 box-shadow:
2196 0 -1px 0 0 rgba(0, 0, 0, 0.05) inset,
@@ -50,10 +125,12 @@ export const PasswordModal = ({
50125 } ;
51126
52127 return (
53- < Modal
128+ < StyledModal
54129 open
130+ width = { 464 }
55131 title = { title }
56132 onCancel = { onClose }
133+ styles = { { mask : { backgroundColor : COLOR . MASK } } }
57134 footer = { [
58135 < Button key = "cancel" onClick = { onClose } >
59136 Cancel
@@ -69,18 +146,22 @@ export const PasswordModal = ({
69146 </ ConfirmButton > ,
70147 ] }
71148 >
72- < Flex vertical gap = { 12 } >
73- < Text > { body } </ Text >
74- < label htmlFor = "connect-password" >
75- Enter your password < Text type = "danger" > *</ Text >
76- </ label >
77- < Input . Password
78- id = "connect-password"
79- value = { password }
80- onChange = { ( e ) => setPassword ( e . target . value ) }
81- />
149+ < Flex vertical gap = { 24 } >
150+ < BodyText > { body } </ BodyText >
151+ < Flex vertical gap = { 4 } >
152+ < PasswordLabel htmlFor = "connect-password" >
153+ Enter your password < Text type = "danger" > *</ Text >
154+ </ PasswordLabel >
155+ < PasswordField
156+ id = "connect-password"
157+ size = "small"
158+ placeholder = "Enter your password"
159+ value = { password }
160+ onChange = { ( e ) => setPassword ( e . target . value ) }
161+ />
162+ </ Flex >
82163 { error && < Alert type = "error" showIcon message = { error . message } /> }
83164 </ Flex >
84- </ Modal >
165+ </ StyledModal >
85166 ) ;
86167} ;
0 commit comments