Skip to content

Commit 527de98

Browse files
authored
Merge pull request #1181 from refly-ai/fix/modal-center
fix: center settings modal
2 parents 8ec4f03 + dfdb559 commit 527de98

File tree

11 files changed

+59
-22
lines changed

11 files changed

+59
-22
lines changed

apps/extension/src/entrypoints/floatingSphere-csui.content/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ export default defineContentScript({
3939
token: {
4040
colorPrimary: '#00968F',
4141
borderRadius: 6,
42+
// Modal specific tokens
43+
colorBgMask: 'var(--refly-modal-mask)',
44+
borderRadiusLG: 20,
45+
boxShadow: '0 8px 32px 0 #00000014',
4246
},
4347
}}
4448
>

apps/web-next/src/prepare/InitializationSuspense.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,21 @@ export function InitializationSuspense({ children }: InitializationSuspenseProps
3434

3535
useEffect(() => {
3636
const themeConfig = {
37-
token: isDarkMode
38-
? {
39-
controlItemBgActive: 'rgba(255, 255, 255, 0.08)',
40-
controlItemBgActiveHover: 'rgba(255, 255, 255, 0.12)',
41-
}
42-
: {
43-
controlItemBgActive: '#f1f1f0',
44-
controlItemBgActiveHover: '#e0e0e0',
45-
},
37+
token: {
38+
// Modal specific tokens
39+
colorBgMask: 'var(--refly-modal-mask)',
40+
borderRadiusLG: 20,
41+
boxShadow: '0 8px 32px 0 #00000014',
42+
...(isDarkMode
43+
? {
44+
controlItemBgActive: 'rgba(255, 255, 255, 0.08)',
45+
controlItemBgActiveHover: 'rgba(255, 255, 255, 0.12)',
46+
}
47+
: {
48+
controlItemBgActive: '#f1f1f0',
49+
controlItemBgActiveHover: '#e0e0e0',
50+
}),
51+
},
4652
algorithm: isDarkMode ? theme.darkAlgorithm : theme.defaultAlgorithm,
4753
};
4854
updateTheme(themeConfig);

apps/web-next/src/tokens.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
--refly-bg-float-z3: #ffffff;
88
--refly-bg-glass-content: #ffffffcc;
99
--refly-bg-canvas: #fbfbfb;
10-
--refly-modal-mask: #00000026;
10+
--refly-modal-mask: rgba(0, 0, 0, 0.15);
1111
--refly-Card-Border: rgba(0, 0, 0, 0.1);
1212
--refly-line: #1c232229;
1313
--refly-text-0: #1c1f23;
@@ -49,7 +49,7 @@
4949
--refly-bg-float-z3: #292929;
5050
--refly-bg-glass-content: #000000cc;
5151
--refly-bg-canvas: #1e1d1d;
52-
--refly-modal-mask: #00000026;
52+
--refly-modal-mask: rgba(0, 0, 0, 0.4);
5353
--refly-Card-Border: rgba(216, 216, 216, 0.1);
5454
--refly-line: #1c23221a;
5555
--refly-text-0: #f9f9f9;

apps/web/src/main.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ export const App = () => {
152152
token: {
153153
colorPrimary: '#0E9F77',
154154
borderRadius: 8,
155+
// Modal specific tokens
156+
colorBgMask: 'var(--refly-modal-mask)',
157+
borderRadiusLG: 20,
158+
boxShadow: '0 8px 32px 0 #00000014',
155159
...(shouldUseDarkTheme
156160
? {
157161
controlItemBgActive: 'rgba(255, 255, 255, 0.08)',
@@ -181,6 +185,10 @@ export const App = () => {
181185
token: {
182186
colorPrimary: '#0E9F77',
183187
borderRadius: 8,
188+
// Modal specific tokens
189+
colorBgMask: 'var(--refly-modal-mask)',
190+
borderRadiusLG: 20,
191+
boxShadow: '0 8px 32px 0 #00000014',
184192
...(shouldUseDarkTheme
185193
? {
186194
controlItemBgActive: 'rgba(255, 255, 255, 0.08)',

packages/ai-workspace-common/src/components/canvas/layout-control/index.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.help-modal {
22
.ant-modal-content {
33
padding: 24px;
4-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
54
}
65

76
.ant-modal-close {

packages/ai-workspace-common/src/components/settings/index.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
.ant-modal-content {
44
height: 80vh;
55
background: var(--refly-bg-content-z2);
6-
box-shadow: none;
76
padding: 0;
87
margin: 0;
98
box-sizing: border-box;
10-
border-radius: 20px;
119
}
1210

1311
.ant-modal-body {

packages/ai-workspace-common/src/components/settings/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,9 @@ const Settings: React.FC<SettingModalProps> = ({ visible, setVisible }) => {
183183
className="settings-modal"
184184
centered
185185
width={'90vw'}
186-
height={'85vh'}
186+
height={'80vh'}
187187
style={{
188188
maxWidth: '1400px',
189-
maxHeight: '800px',
190189
}}
191190
title={null}
192191
footer={null}

packages/ai-workspace-common/src/components/settings/subscribe-modal/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.subscribe-modal {
22
.ant-modal-content {
33
height: 100vh;
4+
border-radius: 0;
45
padding: 0;
56
margin: 0;
67
box-sizing: border-box;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Custom animation for SiderPopover
2+
.sider-popover-animation {
3+
.ant-popover-inner {
4+
animation: siderPopoverSlideIn 0.3s ease-out;
5+
}
6+
}
7+
8+
@keyframes siderPopoverSlideIn {
9+
0% {
10+
transform: translateX(-240px);
11+
opacity: 0;
12+
}
13+
100% {
14+
transform: translateX(0);
15+
opacity: 1;
16+
}
17+
}

packages/ai-workspace-common/src/components/sider/popover.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Logo } from '../common/logo';
66
import { GithubStar } from '../common/github-star';
77
import cn from 'classnames';
88
import { useState } from 'react';
9+
import './popover.scss';
910

1011
interface SiderPopoverProps {
1112
children?: React.ReactNode;
@@ -35,16 +36,12 @@ export const SiderPopover = (props: SiderPopoverProps) => {
3536
<Popover
3637
zIndex={11}
3738
overlayInnerStyle={{ padding: 0, boxShadow: 'none', border: 'none' }}
38-
className="shadow-none"
39+
overlayClassName="sider-popover-animation"
3940
arrow={false}
4041
placement="bottom"
4142
align={align}
4243
open={isVisible}
43-
content={
44-
<div className="animate-slide-in-left">
45-
<SiderLayout source="popover" />
46-
</div>
47-
}
44+
content={<SiderLayout source="popover" />}
4845
>
4946
{children || (
5047
<Button

0 commit comments

Comments
 (0)