-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/new-studio' into deploy/dev
- Loading branch information
Showing
54 changed files
with
1,300 additions
and
532 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
web/app/components/app/create-app-dialog/app-card/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
'use client' | ||
import { useTranslation } from 'react-i18next' | ||
import { PlusIcon } from '@heroicons/react/20/solid' | ||
import { AppTypeIcon, AppTypeLabel } from '../../type-selector' | ||
import Button from '@/app/components/base/button' | ||
import cn from '@/utils/classnames' | ||
import type { App } from '@/models/explore' | ||
import AppIcon from '@/app/components/base/app-icon' | ||
|
||
export type AppCardProps = { | ||
app: App | ||
canCreate: boolean | ||
onCreate: () => void | ||
} | ||
|
||
const AppCard = ({ | ||
app, | ||
onCreate, | ||
}: AppCardProps) => { | ||
const { t } = useTranslation() | ||
const { app: appBasicInfo } = app | ||
return ( | ||
<div className={cn('p-4 h-[132px] relative overflow-hidden flex flex-col group bg-components-panel-on-panel-item-bg border-[0.5px] border-components-panel-border rounded-xl shadow-xs hover:shadow-lg cursor-pointer')}> | ||
<div className='flex items-center gap-3 pb-2 grow-0 shrink-0'> | ||
<div className='relative shrink-0'> | ||
<AppIcon | ||
size='large' | ||
iconType={app.app.icon_type} | ||
icon={app.app.icon} | ||
background={app.app.icon_background} | ||
imageUrl={app.app.icon_url} | ||
/> | ||
<AppTypeIcon wrapperClassName='absolute -bottom-0.5 -right-0.5 w-4 h-4' className='w-3 h-3' type={appBasicInfo.mode} /> | ||
</div> | ||
<div className='grow flex flex-col gap-1'> | ||
<div className='line-clamp-1'> | ||
<span className='system-md-semibold text-text-secondary' title={appBasicInfo.name}>{appBasicInfo.name}</span> | ||
</div> | ||
<AppTypeLabel className='system-2xs-medium-uppercase text-text-tertiary' type={app.app.mode} /> | ||
</div> | ||
</div> | ||
<div className="py-1 system-xs-regular text-text-tertiary"> | ||
<div className='line-clamp-3'> | ||
{app.description} | ||
</div> | ||
</div> | ||
<div className={cn('hidden absolute bottom-0 left-0 right-0 p-4 pt-8 group-hover:flex bg-gradient-to-t from-[60.27%] from-components-panel-gradient-2 to-transparent')}> | ||
<div className={cn('flex items-center w-full space-x-2 h-8')}> | ||
<Button variant='primary' className='grow' onClick={() => onCreate()}> | ||
<PlusIcon className='w-4 h-4 mr-1' /> | ||
<span className='text-xs'>{t('app.newApp.useTemplate')}</span> | ||
</Button> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default AppCard |
Oops, something went wrong.