diff --git a/web/app/(commonLayout)/apps/NewAppDialog.tsx b/web/app/(commonLayout)/apps/NewAppDialog.tsx
index 3b434fa3b2..419c91c3c0 100644
--- a/web/app/(commonLayout)/apps/NewAppDialog.tsx
+++ b/web/app/(commonLayout)/apps/NewAppDialog.tsx
@@ -17,6 +17,8 @@ import { createApp, fetchAppTemplates } from '@/service/apps'
import AppIcon from '@/app/components/base/app-icon'
import AppsContext from '@/context/app-context'
+import EmojiPicker from '@/app/components/base/emoji-picker'
+
type NewAppDialogProps = {
show: boolean
onClose?: () => void
@@ -31,6 +33,7 @@ const NewAppDialog = ({ show, onClose }: NewAppDialogProps) => {
const [newAppMode, setNewAppMode] = useState
()
const [isWithTemplate, setIsWithTemplate] = useState(false)
const [selectedTemplateIndex, setSelectedTemplateIndex] = useState(-1)
+ const [showEmojiPicker, setShowEmojiPicker] = useState(false)
const mutateApps = useContextSelector(AppsContext, state => state.mutateApps)
const { data: templates, mutate } = useSWR({ url: '/app-templates' }, fetchAppTemplates)
@@ -93,10 +96,15 @@ const NewAppDialog = ({ show, onClose }: NewAppDialogProps) => {
>
}
>
+ {showEmojiPicker && {
+ console.log(emoji, background)
+ setShowEmojiPicker(false)
+ }} />}
+
{t('app.newApp.captionName')}
diff --git a/web/app/components/base/app-icon/index.tsx b/web/app/components/base/app-icon/index.tsx
index d85bfca286..cc2f7a193f 100644
--- a/web/app/components/base/app-icon/index.tsx
+++ b/web/app/components/base/app-icon/index.tsx
@@ -9,6 +9,7 @@ export type AppIconProps = {
background?: string
className?: string
innerIcon?: React.ReactNode
+ onClick?: () => void
}
const AppIcon: FC = ({
@@ -17,6 +18,7 @@ const AppIcon: FC = ({
background,
className,
innerIcon,
+ onClick,
}) => {
return (
= ({
style={{
background,
}}
+ onClick={onClick}
>
{innerIcon ? innerIcon : <>🤖>}
diff --git a/web/app/components/base/emoji-picker/index.tsx b/web/app/components/base/emoji-picker/index.tsx
index b9f49ec339..833bd9a530 100644
--- a/web/app/components/base/emoji-picker/index.tsx
+++ b/web/app/components/base/emoji-picker/index.tsx
@@ -12,6 +12,7 @@ import {
MagnifyingGlassIcon
} from '@heroicons/react/24/outline'
import React from 'react'
+import Modal from '@/app/components/base/modal'
declare global {
namespace JSX {
@@ -95,7 +96,6 @@ const EmojiSelect: FC = ({
}) => {
const { categories, emojis } = data as any
- console.log(categories, emojis);
return
{categories.map((category: any) => {
return
@@ -122,16 +122,21 @@ const EmojiSelect: FC
= ({
}
interface IEmojiPickerProps {
+ isModal?: boolean
onSelect?: (emoji: string, background: string) => void
}
const EmojiPicker: FC = ({
+ isModal = true,
onSelect
}) => {
const [selectedEmoji, setSelectedEmoji] = useState('')
- const [selectBackground, setSelectBackground] = useState('')
const Elem = () => {
- return
+ return isModal ?
{ }}
+ isShow
+ className={cn(s.container, '!w-[362px] !p-0')}
+ >
@@ -145,7 +150,6 @@ const EmojiPicker: FC
= ({
setSelectedEmoji(itm)
}} />
{
- setSelectBackground(color)
onSelect && onSelect(selectedEmoji, color)
}} />
@@ -154,11 +158,10 @@ const EmojiPicker: FC = ({
OK
-
+ : <>
+ >
}
- return <>
-
- >
+ return
}
export default EmojiPicker
diff --git a/web/app/components/base/modal/index.tsx b/web/app/components/base/modal/index.tsx
index bc33ac8e0a..fc5c06adc5 100644
--- a/web/app/components/base/modal/index.tsx
+++ b/web/app/components/base/modal/index.tsx
@@ -23,51 +23,51 @@ export default function Modal({
closable = false,
}: IModal) {
return (
-
-
+
)
}