mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-06 13:19:33 +08:00
feat: add transition animations to various popups and dialogs for improved user experience
This commit is contained in:
parent
cb950ecde1
commit
4f1414d5c6
@ -312,6 +312,7 @@ const ObsidianExportDialog: React.FC<ObsidianExportDialogProps> = ({
|
|||||||
closable
|
closable
|
||||||
maskClosable
|
maskClosable
|
||||||
centered
|
centered
|
||||||
|
transitionName="animation-move-down"
|
||||||
okButtonProps={{
|
okButtonProps={{
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
disabled: vaults.length === 0 || loading || !!error
|
disabled: vaults.length === 0 || loading || !!error
|
||||||
|
|||||||
@ -150,7 +150,7 @@ const PopupContainer: React.FC<Props> = ({ resolve }) => {
|
|||||||
open={open}
|
open={open}
|
||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
afterClose={onClose}
|
afterClose={onClose}
|
||||||
transitionName="ant-move-up"
|
transitionName="animation-move-down"
|
||||||
styles={{
|
styles={{
|
||||||
content: {
|
content: {
|
||||||
borderRadius: 20,
|
borderRadius: 20,
|
||||||
|
|||||||
@ -70,6 +70,7 @@ const PopupContainer: React.FC<Props> = ({ resolve }) => {
|
|||||||
cancelButtonProps={{ disabled: isDisabled }}
|
cancelButtonProps={{ disabled: isDisabled }}
|
||||||
okText={t('backup.confirm.button')}
|
okText={t('backup.confirm.button')}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
{!progressData && <div>{t('backup.content')}</div>}
|
{!progressData && <div>{t('backup.content')}</div>}
|
||||||
{progressData && (
|
{progressData && (
|
||||||
|
|||||||
@ -63,6 +63,7 @@ const PromptPopupContainer: React.FC<Props> = ({
|
|||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
afterClose={onClose}
|
afterClose={onClose}
|
||||||
afterOpenChange={handleAfterOpenChange}
|
afterOpenChange={handleAfterOpenChange}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
<Box mb={8}>{message}</Box>
|
<Box mb={8}>{message}</Box>
|
||||||
<Input.TextArea
|
<Input.TextArea
|
||||||
|
|||||||
@ -70,6 +70,7 @@ const PopupContainer: React.FC<Props> = ({ resolve }) => {
|
|||||||
okButtonProps={{ disabled: isDisabled }}
|
okButtonProps={{ disabled: isDisabled }}
|
||||||
cancelButtonProps={{ disabled: isDisabled }}
|
cancelButtonProps={{ disabled: isDisabled }}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
{!progressData && <div>{t('restore.content')}</div>}
|
{!progressData && <div>{t('restore.content')}</div>}
|
||||||
{progressData && (
|
{progressData && (
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import styled from 'styled-components'
|
|||||||
import { useScrollState } from './hook'
|
import { useScrollState } from './hook'
|
||||||
import { FlatListItem } from './types'
|
import { FlatListItem } from './types'
|
||||||
|
|
||||||
const PAGE_SIZE = 9
|
const PAGE_SIZE = 10
|
||||||
const ITEM_HEIGHT = 36
|
const ITEM_HEIGHT = 36
|
||||||
|
|
||||||
interface PopupParams {
|
interface PopupParams {
|
||||||
|
|||||||
@ -255,6 +255,7 @@ export function WebdavBackupManager({ visible, onClose, webdavConfig, restoreMet
|
|||||||
onCancel={onClose}
|
onCancel={onClose}
|
||||||
width={800}
|
width={800}
|
||||||
centered
|
centered
|
||||||
|
transitionName="animation-move-down"
|
||||||
footer={[
|
footer={[
|
||||||
<Button key="refresh" icon={<ReloadOutlined />} onClick={fetchBackupFiles} disabled={loading}>
|
<Button key="refresh" icon={<ReloadOutlined />} onClick={fetchBackupFiles} disabled={loading}>
|
||||||
{t('settings.data.webdav.backup.manager.refresh')}
|
{t('settings.data.webdav.backup.manager.refresh')}
|
||||||
|
|||||||
@ -77,6 +77,7 @@ export function WebdavBackupModal({
|
|||||||
onOk={handleBackup}
|
onOk={handleBackup}
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
okButtonProps={{ loading: backuping }}
|
okButtonProps={{ loading: backuping }}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
<Input
|
<Input
|
||||||
value={customFileName}
|
value={customFileName}
|
||||||
@ -208,6 +209,7 @@ export function WebdavRestoreModal({
|
|||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
okButtonProps={{ loading: restoring }}
|
okButtonProps={{ loading: restoring }}
|
||||||
width={600}
|
width={600}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
<div style={{ position: 'relative' }}>
|
<div style={{ position: 'relative' }}>
|
||||||
<Select
|
<Select
|
||||||
|
|||||||
@ -141,6 +141,7 @@ const PopupContainer: React.FC<Props> = ({ resolve }) => {
|
|||||||
afterClose={onClose}
|
afterClose={onClose}
|
||||||
okText={t('agents.add.title')}
|
okText={t('agents.add.title')}
|
||||||
width={800}
|
width={800}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
<Form
|
<Form
|
||||||
ref={formRef}
|
ref={formRef}
|
||||||
|
|||||||
@ -94,7 +94,13 @@ const PopupContainer: React.FC<Props> = ({ resolve }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal title={t('agents.import.title')} open={open} onCancel={onCancel} footer={null} centered>
|
<Modal
|
||||||
|
title={t('agents.import.title')}
|
||||||
|
open={open}
|
||||||
|
onCancel={onCancel}
|
||||||
|
footer={null}
|
||||||
|
transitionName="animation-move-down"
|
||||||
|
centered>
|
||||||
<Form form={form} onFinish={onFinish} layout="vertical">
|
<Form form={form} onFinish={onFinish} layout="vertical">
|
||||||
<Form.Item>
|
<Form.Item>
|
||||||
<Radio.Group value={importType} onChange={(e) => setImportType(e.target.value)}>
|
<Radio.Group value={importType} onChange={(e) => setImportType(e.target.value)}>
|
||||||
|
|||||||
@ -39,6 +39,7 @@ const PopupContainer: React.FC = () => {
|
|||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
afterClose={onClose}
|
afterClose={onClose}
|
||||||
footer={null}
|
footer={null}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
<Container>
|
<Container>
|
||||||
{agents.length > 0 && (
|
{agents.length > 0 && (
|
||||||
|
|||||||
@ -178,6 +178,7 @@ const App: FC<Props> = ({ app, onClick, size = 60, isLast }) => {
|
|||||||
setFileList([])
|
setFileList([])
|
||||||
}}
|
}}
|
||||||
footer={null}
|
footer={null}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
<Form form={form} onFinish={handleAddCustomApp} layout="vertical">
|
<Form form={form} onFinish={handleAddCustomApp} layout="vertical">
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
|||||||
@ -163,6 +163,7 @@ const QuickPhrasesButton = ({ ref, setInputValue, resizeTextArea, ToolbarButton,
|
|||||||
setFormData({ title: '', content: '', location: 'global' })
|
setFormData({ title: '', content: '', location: 'global' })
|
||||||
}}
|
}}
|
||||||
width={520}
|
width={520}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
<Space direction="vertical" style={{ width: '100%' }} size="middle">
|
<Space direction="vertical" style={{ width: '100%' }} size="middle">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@ -199,6 +199,7 @@ const PopupContainer: React.FC<Props> = ({ resolve, chart }) => {
|
|||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
afterClose={onClose}
|
afterClose={onClose}
|
||||||
width={1000}
|
width={1000}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered
|
centered
|
||||||
footer={[
|
footer={[
|
||||||
<Space key="download-buttons">
|
<Space key="download-buttons">
|
||||||
|
|||||||
@ -224,6 +224,7 @@ const PlantUMLPopupCantaier: React.FC<PlantUMLPopupProps> = ({ resolve, diagram
|
|||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
afterClose={onClose}
|
afterClose={onClose}
|
||||||
width={1000}
|
width={1000}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered
|
centered
|
||||||
footer={[
|
footer={[
|
||||||
<Space key="download-buttons">
|
<Space key="download-buttons">
|
||||||
|
|||||||
@ -170,6 +170,7 @@ const MessageTools: FC<Props> = ({ blocks }) => {
|
|||||||
footer={null}
|
footer={null}
|
||||||
width="80%"
|
width="80%"
|
||||||
centered
|
centered
|
||||||
|
transitionName="animation-move-down"
|
||||||
styles={{ body: { maxHeight: '80vh', overflow: 'auto' } }}>
|
styles={{ body: { maxHeight: '80vh', overflow: 'auto' } }}>
|
||||||
{expandedResponse && (
|
{expandedResponse && (
|
||||||
<ExpandedResponseContainer style={{ fontFamily, fontSize }}>
|
<ExpandedResponseContainer style={{ fontFamily, fontSize }}>
|
||||||
|
|||||||
@ -125,6 +125,7 @@ const PopupContainer: React.FC<Props> = ({ base: _base, resolve }) => {
|
|||||||
afterClose={onClose}
|
afterClose={onClose}
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
<Form form={form} layout="vertical" className="compact-form">
|
<Form form={form} layout="vertical" className="compact-form">
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
|||||||
@ -136,6 +136,7 @@ const AssistantRegularPromptsSettings: FC<AssistantRegularPromptsSettingsProps>
|
|||||||
onOk={handleModalOk}
|
onOk={handleModalOk}
|
||||||
onCancel={() => setIsModalOpen(false)}
|
onCancel={() => setIsModalOpen(false)}
|
||||||
width={520}
|
width={520}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
<Space direction="vertical" style={{ width: '100%' }} size="middle">
|
<Space direction="vertical" style={{ width: '100%' }} size="middle">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@ -305,6 +305,7 @@ const PopupContainer: React.FC<Props> = ({ resolve }) => {
|
|||||||
onOk={onOk}
|
onOk={onOk}
|
||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
afterClose={onClose}
|
afterClose={onClose}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered
|
centered
|
||||||
width={800}
|
width={800}
|
||||||
footer={null}>
|
footer={null}>
|
||||||
|
|||||||
@ -85,6 +85,7 @@ const PopupContainer: React.FC<Props> = ({ title, provider, resolve }) => {
|
|||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
afterClose={onClose}
|
afterClose={onClose}
|
||||||
footer={null}
|
footer={null}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
<Form
|
<Form
|
||||||
form={form}
|
form={form}
|
||||||
|
|||||||
@ -152,6 +152,7 @@ const PopupContainer: React.FC<Props> = ({ provider, resolve }) => {
|
|||||||
afterClose={onClose}
|
afterClose={onClose}
|
||||||
width={360}
|
width={360}
|
||||||
closable={false}
|
closable={false}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered
|
centered
|
||||||
title={t('settings.provider.add.title')}
|
title={t('settings.provider.add.title')}
|
||||||
okButtonProps={{ disabled: buttonDisabled }}>
|
okButtonProps={{ disabled: buttonDisabled }}>
|
||||||
|
|||||||
@ -141,6 +141,7 @@ const PopupContainer: React.FC<Props> = ({ title, provider, model, apiKeys, type
|
|||||||
onOk={onOk}
|
onOk={onOk}
|
||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
afterClose={onClose}
|
afterClose={onClose}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered
|
centered
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
footer={
|
footer={
|
||||||
|
|||||||
@ -232,6 +232,7 @@ const PopupContainer: React.FC<Props> = ({ provider: _provider, resolve }) => {
|
|||||||
content: { padding: 0 },
|
content: { padding: 0 },
|
||||||
header: { padding: '16px 22px 30px 22px' }
|
header: { padding: '16px 22px 30px 22px' }
|
||||||
}}
|
}}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
<SearchContainer>
|
<SearchContainer>
|
||||||
<TopToolsWrapper>
|
<TopToolsWrapper>
|
||||||
|
|||||||
@ -132,6 +132,7 @@ const PopupContainer: React.FC<Props> = ({ title, apiKeys, resolve }) => {
|
|||||||
centered
|
centered
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
width={500}
|
width={500}
|
||||||
|
transitionName="animation-move-down"
|
||||||
footer={
|
footer={
|
||||||
<Space style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<Space style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||||
<Space>
|
<Space>
|
||||||
|
|||||||
@ -46,6 +46,7 @@ const ModelEditContent: FC<ModelEditContentProps> = ({ model, onUpdateModel, ope
|
|||||||
onCancel={handleClose}
|
onCancel={handleClose}
|
||||||
footer={null}
|
footer={null}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered
|
centered
|
||||||
afterOpenChange={(visible) => {
|
afterOpenChange={(visible) => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
|
|||||||
@ -45,6 +45,7 @@ const PopupContainer: FC<Props> = ({ provider: _provider, resolve }) => {
|
|||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
afterClose={onClose}
|
afterClose={onClose}
|
||||||
width={800}
|
width={800}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
<EditorContainer>
|
<EditorContainer>
|
||||||
<MarkdownEditor
|
<MarkdownEditor
|
||||||
|
|||||||
@ -118,6 +118,7 @@ const QuickPhraseSettings: FC = () => {
|
|||||||
onOk={handleModalOk}
|
onOk={handleModalOk}
|
||||||
onCancel={() => setIsModalOpen(false)}
|
onCancel={() => setIsModalOpen(false)}
|
||||||
width={520}
|
width={520}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
<Space direction="vertical" style={{ width: '100%' }} size="middle">
|
<Space direction="vertical" style={{ width: '100%' }} size="middle">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@ -62,6 +62,7 @@ const PopupContainer: React.FC<Props> = ({ title, resolve }) => {
|
|||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
afterClose={onClose}
|
afterClose={onClose}
|
||||||
footer={null}
|
footer={null}
|
||||||
|
transitionName="animation-move-down"
|
||||||
centered>
|
centered>
|
||||||
<Form
|
<Form
|
||||||
form={form}
|
form={form}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user