Skip to content

Commit

Permalink
优化部分代码
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrickill committed Sep 3, 2024
1 parent 984bc2e commit 3b70337
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/web/components/common/MyMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export type Props = {
icon?: IconNameType | string;
label: string | React.ReactNode;
description?: string;
onClick: () => any;
onClick?: () => any;
menuItemStyles?: MenuItemProps;
}[];
}[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ const AppCard = ({
chatConfig: appDetail.chatConfig,
appName: appDetail.name
}),
onClick: () => {},
menuItemStyles: {
p: 0
p: 0,
cursor: 'default'
}
}
]
Expand Down Expand Up @@ -236,7 +236,8 @@ function ExportPopover({
color={'myGray.600'}
_hover={{
bg: 'myGray.05',
color: 'primary.600'
color: 'primary.600',
cursor: 'pointer'
}}
borderRadius={'xs'}
onClick={onExportWorkflow}
Expand All @@ -250,7 +251,8 @@ function ExportPopover({
color={'myGray.600'}
_hover={{
bg: 'myGray.05',
color: 'primary.600'
color: 'primary.600',
cursor: 'pointer'
}}
borderRadius={'xs'}
onClick={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,23 +148,23 @@ const ImportSettings = ({ onClose }: Props) => {
<Button
px={5}
py={2}
onClick={() => {
onClick={async () => {
if (!value) {
return onClose();
}
try {
const data = JSON.parse(value);
initData(data);
await initData(data);
toast({
title: t('app:import_configs_success'),
status: 'success'
});
onClose();
} catch (error) {
toast({
title: appT('import_configs_failed')
title: t('app:import_configs_failed')
});
}
toast({
title: t('app:import_configs_success'),
status: 'success'
});
}}
fontWeight={'500'}
>
Expand Down

0 comments on commit 3b70337

Please sign in to comment.