feat: 更新提示词逻辑,支持模板选择前的提示信息
This commit is contained in:
parent
474b4ca8b7
commit
d24c15fc37
|
|
@ -31,11 +31,10 @@ type Template = {
|
|||
* ========================= */
|
||||
const Generate = observer(function Generate() {
|
||||
const router = useRouter()
|
||||
const env = process.env.EXPO_PUBLIC_ENV
|
||||
|
||||
const { user, isAuthenticated } = userStore
|
||||
|
||||
const [prompt, setPrompt] = useState(`${env} update`)
|
||||
const [prompt, setPrompt] = useState(`输入提示词`)
|
||||
const [selectedTemplateId, setSelectedTemplateId] = useState('')
|
||||
const [meImg, setMeImg] = useState({ uri: '', url: '' })
|
||||
const [friendImg, setFriendImg] = useState({ uri: '', url: '' })
|
||||
|
|
@ -268,7 +267,7 @@ const Generate = observer(function Generate() {
|
|||
onPickMe={onPickMe}
|
||||
selectedTemplate={selectedTemplate}
|
||||
/>
|
||||
{!!textCount && <PromptSection prompt={prompt} onChangePrompt={setPrompt} />}
|
||||
<PromptSection prompt={prompt} onChangePrompt={setPrompt} />
|
||||
<TemplateSectionHeader onRandom={handleRandom} />
|
||||
</Block>
|
||||
</Block>
|
||||
|
|
@ -417,9 +416,10 @@ const UploadSection = memo<UploadSectionProps>(function UploadSection({
|
|||
|
||||
type PromptSectionProps = {
|
||||
prompt: string
|
||||
editable?: boolean
|
||||
onChangePrompt: (v: string) => void
|
||||
}
|
||||
const PromptSection = memo<PromptSectionProps>(function PromptSection({ prompt, onChangePrompt }) {
|
||||
const PromptSection = memo<PromptSectionProps>(function PromptSection({ prompt, onChangePrompt, editable = true }) {
|
||||
return (
|
||||
<Block className="mt-[24px] -skew-x-6">
|
||||
<Block className="mb-[4px] flex-row items-center px-[4px]">
|
||||
|
|
@ -428,13 +428,15 @@ const PromptSection = memo<PromptSectionProps>(function PromptSection({ prompt,
|
|||
</Block>
|
||||
</Block>
|
||||
|
||||
<Block className="border-[3px] border-black bg-white p-[4px]">
|
||||
<Block className={`border-[3px] border-black bg-white p-[4px]`}>
|
||||
<Input
|
||||
multiline
|
||||
className="font-700 min-h-[50px] w-full bg-transparent p-[8px] text-[14px] leading-[18px] text-black"
|
||||
className="w-full bg-transparent p-[8px] text-[14px] leading-[18px] text-black"
|
||||
style={{ height: 50 }}
|
||||
numberOfLines={2}
|
||||
placeholder="描述画面细节..."
|
||||
placeholder={editable ? '描述画面细节...' : '请先选择模板'}
|
||||
value={prompt}
|
||||
editable={editable}
|
||||
onChangeText={onChangePrompt}
|
||||
/>
|
||||
</Block>
|
||||
|
|
|
|||
Loading…
Reference in New Issue