Skip to content

Commit 9cef3a2

Browse files
authored
Fix: Fixed the issue of not being able to select the time zone in the user center. (#11298)
… user center. ### What problem does this PR solve? Fix: Fixed the issue of not being able to select the time zone in the user center. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
1 parent e7e89d3 commit 9cef3a2

File tree

2 files changed

+12
-22
lines changed

2 files changed

+12
-22
lines changed

web/src/components/ui/modal/modal.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ const Modal: ModalType = ({
8686
onOk?.();
8787
}, [onOk, onOpenChange]);
8888
const handleChange = (open: boolean) => {
89+
if (!open && !maskClosable) {
90+
return;
91+
}
8992
onOpenChange?.(open);
9093
console.log('open', open, onOpenChange);
9194
if (open && !disabled) {
@@ -185,6 +188,7 @@ const Modal: ModalType = ({
185188
<button
186189
type="button"
187190
className="flex h-7 w-7 items-center justify-center rounded-full hover:bg-muted focus-visible:outline-none"
191+
onClick={handleCancel}
188192
>
189193
{closeIcon}
190194
</button>

web/src/pages/user-setting/profile/index.tsx

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,7 @@ import {
1313
} from '@/components/ui/form';
1414
import { Input } from '@/components/ui/input';
1515
import { Modal } from '@/components/ui/modal/modal';
16-
import {
17-
Select,
18-
SelectContent,
19-
SelectItem,
20-
SelectTrigger,
21-
SelectValue,
22-
} from '@/components/ui/select';
16+
import { RAGFlowSelect } from '@/components/ui/select';
2317
import { useTranslate } from '@/hooks/common-hooks';
2418
import { TimezoneList } from '@/pages/user-setting/constants';
2519
import { zodResolver } from '@hookform/resolvers/zod';
@@ -230,6 +224,7 @@ const ProfilePage: FC = () => {
230224
title={modalTitle[editType]}
231225
open={isEditing}
232226
showfooter={false}
227+
maskClosable={false}
233228
titleClassName="text-base"
234229
onOpenChange={(open) => {
235230
if (!open) {
@@ -281,23 +276,14 @@ const ProfilePage: FC = () => {
281276
<FormLabel className="text-sm text-text-secondary whitespace-nowrap">
282277
{t('timezone')}
283278
</FormLabel>
284-
<Select
279+
<RAGFlowSelect
280+
options={TimezoneList.map((timeStr) => {
281+
return { value: timeStr, label: timeStr };
282+
})}
283+
placeholder="Select a timeZone"
285284
onValueChange={field.onChange}
286285
value={field.value}
287-
>
288-
<FormControl className="w-full bg-bg-input border-border-default">
289-
<SelectTrigger>
290-
<SelectValue placeholder="Select a timeZone" />
291-
</SelectTrigger>
292-
</FormControl>
293-
<SelectContent>
294-
{TimezoneList.map((timeStr) => (
295-
<SelectItem key={timeStr} value={timeStr}>
296-
{timeStr}
297-
</SelectItem>
298-
))}
299-
</SelectContent>
300-
</Select>
286+
/>
301287
</div>
302288
<div className="flex w-full pt-1">
303289
<div className="w-1/4"></div>

0 commit comments

Comments
 (0)