style: Centered buttons and modals.

- Added the centered property to the OK button on the AgentsPage.
- Added centered option to modal confirmation dialog.
- Centred the delete button in the ProvidersList component.
- Added centered confirmation to reset modal.
This commit is contained in:
kangfenmao 2024-09-09 17:16:14 +08:00
parent 52d84afed6
commit 455d909c74
4 changed files with 4 additions and 0 deletions

View File

@ -33,6 +33,7 @@ const AppsPage: FC = () => {
icon: null,
closable: true,
maskClosable: true,
centered: true,
okButtonProps: { type: 'primary', disabled: Boolean(added) },
okText: added ? t('button.added') : t('button.add'),
onOk: () => onAddAgent(agent)

View File

@ -72,6 +72,7 @@ const Assistants: FC<Props> = ({ activeAssistant, setActiveAssistant, onCreateAs
window.modal.confirm({
title: t('chat.topics.delete.all.title'),
content: t('chat.topics.delete.all.content'),
centered: true,
okButtonProps: { danger: true },
onOk: removeAllTopics
})

View File

@ -71,6 +71,7 @@ const ProvidersList: FC = () => {
content: t('settings.provider.delete.content'),
okButtonProps: { danger: true },
okText: t('common.delete'),
centered: true,
onOk: () => {
setSelectedProvider(providers.filter((p) => p.isSystem)[0])
removeProvider(provider)

View File

@ -63,6 +63,7 @@ export async function reset() {
window.modal.confirm({
title: i18n.t('message.reset.double.confirm.title'),
content: i18n.t('message.reset.double.confirm.content'),
centered: true,
onOk: async () => {
await localStorage.clear()
await localforage.clear()