feat: app icon enhancements (#7095)
This commit is contained in:
@@ -37,11 +37,14 @@ import type {
|
||||
import { addFileInfos, sortAgentSorts } from '@/app/components/tools/utils'
|
||||
import { useToastContext } from '@/app/components/base/toast'
|
||||
import { changeLanguage } from '@/i18n/i18next-config'
|
||||
import { useAppFavicon } from '@/hooks/use-app-favicon'
|
||||
|
||||
export const useChatWithHistory = (installedAppInfo?: InstalledApp) => {
|
||||
const isInstalledApp = useMemo(() => !!installedAppInfo, [installedAppInfo])
|
||||
const { data: appInfo, isLoading: appInfoLoading, error: appInfoError } = useSWR(installedAppInfo ? null : 'appInfo', fetchAppInfo)
|
||||
|
||||
useAppFavicon(!installedAppInfo, appInfo?.site.icon, appInfo?.site.icon_background)
|
||||
|
||||
const appData = useMemo(() => {
|
||||
if (isInstalledApp) {
|
||||
const { id, app } = installedAppInfo!
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
import type { ChangeEvent, FC } from 'react'
|
||||
import React, { useState } from 'react'
|
||||
import data from '@emoji-mart/data'
|
||||
import type { Emoji, EmojiMartData } from '@emoji-mart/data'
|
||||
import { SearchIndex, init } from 'emoji-mart'
|
||||
import type { EmojiMartData } from '@emoji-mart/data'
|
||||
import { init } from 'emoji-mart'
|
||||
import {
|
||||
MagnifyingGlassIcon,
|
||||
} from '@heroicons/react/24/outline'
|
||||
@@ -13,8 +13,8 @@ import s from './style.module.css'
|
||||
import cn from '@/utils/classnames'
|
||||
import Divider from '@/app/components/base/divider'
|
||||
import Button from '@/app/components/base/button'
|
||||
|
||||
import Modal from '@/app/components/base/modal'
|
||||
import { searchEmoji } from '@/utils/emoji'
|
||||
|
||||
declare global {
|
||||
namespace JSX {
|
||||
@@ -30,15 +30,6 @@ declare global {
|
||||
|
||||
init({ data })
|
||||
|
||||
async function search(value: string) {
|
||||
const emojis: Emoji[] = await SearchIndex.search(value) || []
|
||||
|
||||
const results = emojis.map((emoji) => {
|
||||
return emoji.skins[0].native
|
||||
})
|
||||
return results
|
||||
}
|
||||
|
||||
const backgroundColors = [
|
||||
'#FFEAD5',
|
||||
'#E4FBCC',
|
||||
@@ -105,7 +96,7 @@ const EmojiPicker: FC<IEmojiPickerProps> = ({
|
||||
}
|
||||
else {
|
||||
setIsSearching(true)
|
||||
const emojis = await search(e.target.value)
|
||||
const emojis = await searchEmoji(e.target.value)
|
||||
setSearchedEmojis(emojis)
|
||||
}
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user