浏览代码

fix: robot emoji (#217)

tags/0.3.1
Yuhao 2 年前
父节点
当前提交
d43279a1cc
没有帐户链接到提交者的电子邮件

+ 2
- 2
web/app/(commonLayout)/apps/NewAppDialog.tsx 查看文件



// Emoji Picker // Emoji Picker
const [showEmojiPicker, setShowEmojiPicker] = useState(false) const [showEmojiPicker, setShowEmojiPicker] = useState(false)
const [emoji, setEmoji] = useState({ icon: '🤖', icon_background: '#FFEAD5' })
const [emoji, setEmoji] = useState({ icon: '🤖', icon_background: '#FFEAD5' })


const mutateApps = useContextSelector(AppsContext, state => state.mutateApps) const mutateApps = useContextSelector(AppsContext, state => state.mutateApps)


setShowEmojiPicker(false) setShowEmojiPicker(false)
}} }}
onClose={() => { onClose={() => {
setEmoji({ icon: '🤖', icon_background: '#FFEAD5' })
setEmoji({ icon: '🤖', icon_background: '#FFEAD5' })
setShowEmojiPicker(false) setShowEmojiPicker(false)
}} }}
/>} />}

+ 1
- 1
web/app/components/base/app-icon/index.tsx 查看文件

}} }}
onClick={onClick} onClick={onClick}
> >
{innerIcon ? innerIcon : icon && icon !== '' ? <em-emoji id={icon} /> : <em-emoji id={'robot'} />}
{innerIcon ? innerIcon : icon && icon !== '' ? <em-emoji id={icon} /> : <em-emoji id='🤖' />}
</span> </span>
) )
} }

+ 2
- 2
web/app/components/explore/create-app-modal/index.tsx 查看文件

const [name, setName] = React.useState('') const [name, setName] = React.useState('')


const [showEmojiPicker, setShowEmojiPicker] = useState(false) const [showEmojiPicker, setShowEmojiPicker] = useState(false)
const [emoji, setEmoji] = useState({ icon: '🤖', icon_background: '#FFEAD5' })
const [emoji, setEmoji] = useState({ icon: '🤖', icon_background: '#FFEAD5' })


const submit = () => { const submit = () => {
if(!name.trim()) { if(!name.trim()) {
setShowEmojiPicker(false) setShowEmojiPicker(false)
}} }}
onClose={() => { onClose={() => {
setEmoji({ icon: '🤖', icon_background: '#FFEAD5' })
setEmoji({ icon: '🤖', icon_background: '#FFEAD5' })
setShowEmojiPicker(false) setShowEmojiPicker(false)
}} }}
/>} />}

+ 0
- 22
web/app/components/share/text-generation/icons/app-icon.svg
文件差异内容过多而无法显示
查看文件


+ 3
- 2
web/app/components/share/text-generation/index.tsx 查看文件

import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints' import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
import cn from 'classnames' import cn from 'classnames'
import { useBoolean, useClickAway } from 'ahooks' import { useBoolean, useClickAway } from 'ahooks'
import { useContext } from 'use-context-selector'
import ConfigScence from '@/app/components/share/text-generation/config-scence' import ConfigScence from '@/app/components/share/text-generation/config-scence'
import NoData from '@/app/components/share/text-generation/no-data' import NoData from '@/app/components/share/text-generation/no-data'
// import History from '@/app/components/share/text-generation/history' // import History from '@/app/components/share/text-generation/history'
import type { SiteInfo } from '@/models/share' import type { SiteInfo } from '@/models/share'
import type { PromptConfig, MoreLikeThisConfig, SavedMessage } from '@/models/debug' import type { PromptConfig, MoreLikeThisConfig, SavedMessage } from '@/models/debug'
import Toast from '@/app/components/base/toast' import Toast from '@/app/components/base/toast'
import AppIcon from '@/app/components/base/app-icon'
import { Feedbacktype } from '@/app/components/app/chat' import { Feedbacktype } from '@/app/components/app/chat'
import { changeLanguage } from '@/i18n/i18next-config' import { changeLanguage } from '@/i18n/i18next-config'
import Loading from '@/app/components/base/loading' import Loading from '@/app/components/base/loading'
import Button from '../../base/button' import Button from '../../base/button'
import { App } from '@/types/app' import { App } from '@/types/app'
import { InstalledApp } from '@/models/explore' import { InstalledApp } from '@/models/explore'
import { appDefaultIconBackground } from '@/config'


export type IMainProps = { export type IMainProps = {
isInstalledApp?: boolean, isInstalledApp?: boolean,
<div className='mb-6'> <div className='mb-6'>
<div className='flex justify-between items-center'> <div className='flex justify-between items-center'>
<div className='flex items-center space-x-3'> <div className='flex items-center space-x-3'>
<div className={cn(s.appIcon, 'shrink-0')}></div>
<AppIcon size="small" icon={siteInfo.icon} background={siteInfo.icon_background || appDefaultIconBackground} />
<div className='text-lg text-gray-800 font-semibold'>{siteInfo.title}</div> <div className='text-lg text-gray-800 font-semibold'>{siteInfo.title}</div>
</div> </div>
{!isPC && ( {!isPC && (

+ 0
- 7
web/app/components/share/text-generation/style.module.css 查看文件

box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.08), 0px 4px 6px -2px rgba(16, 24, 40, 0.03); box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.08), 0px 4px 6px -2px rgba(16, 24, 40, 0.03);
} }


.appIcon {
width: 32px;
height: 32px;
background: url(./icons/app-icon.svg) center center no-repeat;
background-size: contain;
}

.starIcon { .starIcon {
width: 16px; width: 16px;
height: 16px; height: 16px;

正在加载...
取消
保存