From 73210a869048d6468b55717660d0ca558d0c2aab Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期一, 24 十一月 2025 09:49:43 +0800
Subject: [PATCH] 优化
---
app/(commonLayout)/apps/NewAppCard.tsx | 38 +++++++++++++++-----------------------
1 files changed, 15 insertions(+), 23 deletions(-)
diff --git "a/app/\050commonLayout\051/apps/NewAppCard.tsx" "b/app/\050commonLayout\051/apps/NewAppCard.tsx"
index 0b42577..701de12 100644
--- "a/app/\050commonLayout\051/apps/NewAppCard.tsx"
+++ "b/app/\050commonLayout\051/apps/NewAppCard.tsx"
@@ -1,6 +1,6 @@
'use client'
-import { useMemo, useState } from 'react'
+import { forwardRef, useMemo, useState } from 'react'
import {
useRouter,
useSearchParams,
@@ -10,7 +10,7 @@
import CreateAppModal from '@/app/components/app/create-app-modal'
import CreateFromDSLModal, { CreateFromDSLModalTab } from '@/app/components/app/create-from-dsl-modal'
import { useProviderContext } from '@/context/provider-context'
-import { FileArrow01, FilePlus01, FilePlus02 } from '@/app/components/base/icons/src/vender/line/files'
+import { FilePlus01 } from '@/app/components/base/icons/src/vender/line/files'
import cn from '@/utils/classnames'
export type CreateAppCardProps = {
@@ -18,15 +18,7 @@
onSuccess?: () => void
}
-const CreateAppCard = (
- {
- ref,
- className,
- onSuccess,
- }: CreateAppCardProps & {
- ref: React.RefObject<HTMLDivElement>;
- },
-) => {
+const CreateAppCard = forwardRef<HTMLDivElement, CreateAppCardProps>(({ className, onSuccess }, ref) => {
const { t } = useTranslation()
const { onPlanInfoChanged } = useProviderContext()
const searchParams = useSearchParams()
@@ -47,24 +39,24 @@
return (
<div
ref={ref}
- className={cn('relative col-span-1 inline-flex h-[160px] flex-col justify-between rounded-xl border-[0.5px] border-components-card-border bg-components-card-bg', className)}
+ className={cn('relative col-span-1 inline-flex flex-col justify-between h-[160px] bg-components-card-bg rounded-xl border-[0.5px] border-components-card-border', className)}
>
- <div className='grow rounded-t-xl p-2'>
- <div className='px-6 pb-1 pt-2 text-xs font-medium leading-[18px] text-text-tertiary'>{t('app.createApp')}</div>
- <button className='mb-1 flex w-full cursor-pointer items-center rounded-lg px-6 py-[7px] text-[13px] font-medium leading-[18px] text-text-tertiary hover:bg-state-base-hover hover:text-text-secondary' onClick={() => setShowNewAppModal(true)}>
- <FilePlus01 className='mr-2 h-4 w-4 shrink-0' />
- {t('app.newApp.startFromBlank')}
+ <div className='grow p-2 rounded-t-xl'>
+ <div className='px-6 pt-2 pb-1 text-xs font-medium leading-[18px] text-text-tertiary'>{t('app.createApp')}</div>
+ <button className='w-full flex items-center mb-1 px-6 py-[7px] rounded-lg text-[13px] font-medium leading-[18px] text-text-tertiary cursor-pointer hover:text-text-secondary hover:bg-state-base-hover' onClick={() => setShowNewAppModal(true)}>
+ <FilePlus01 className='shrink-0 mr-2 w-4 h-4' />
+ 鍒涘缓鏅鸿兘浣�
</button>
- <button className='flex w-full cursor-pointer items-center rounded-lg px-6 py-[7px] text-[13px] font-medium leading-[18px] text-text-tertiary hover:bg-state-base-hover hover:text-text-secondary' onClick={() => setShowNewAppTemplateDialog(true)}>
- <FilePlus02 className='mr-2 h-4 w-4 shrink-0' />
+ {/* <button className='w-full flex items-center px-6 py-[7px] rounded-lg text-[13px] font-medium leading-[18px] text-text-tertiary cursor-pointer hover:text-text-secondary hover:bg-state-base-hover' onClick={() => setShowNewAppTemplateDialog(true)}>
+ <FilePlus02 className='shrink-0 mr-2 w-4 h-4' />
{t('app.newApp.startFromTemplate')}
</button>
<button
onClick={() => setShowCreateFromDSLModal(true)}
- className='flex w-full cursor-pointer items-center rounded-lg px-6 py-[7px] text-[13px] font-medium leading-[18px] text-text-tertiary hover:bg-state-base-hover hover:text-text-secondary'>
- <FileArrow01 className='mr-2 h-4 w-4 shrink-0' />
+ className='w-full flex items-center px-6 py-[7px] rounded-lg text-[13px] font-medium leading-[18px] text-text-tertiary cursor-pointer hover:text-text-secondary hover:bg-state-base-hover'>
+ <FileArrow01 className='shrink-0 mr-2 w-4 h-4' />
{t('app.importDSL')}
- </button>
+ </button> */}
</div>
<CreateAppModal
@@ -111,7 +103,7 @@
/>
</div>
)
-}
+})
CreateAppCard.displayName = 'CreateAppCard'
export default CreateAppCard
--
Gitblit v1.8.0