add dialog

This commit is contained in:
lishiyun1227 2023-04-17 14:09:33 +08:00
parent ea67ff73a9
commit ecfb649c01
2 changed files with 9 additions and 4 deletions

View File

@ -134,6 +134,12 @@
} }
.content-input{ .content-input{
padding: 20px; padding: 20px;
margin-bottom: 30px;
}
button{
background-color: #009999;
padding: 9px 20px;
} }
} }
} }

View File

@ -324,7 +324,6 @@ export function PromptHints(props: {
); );
} }
function useScrollToBottom() { function useScrollToBottom() {
// for auto-scroll // for auto-scroll
const scrollRef = useRef<HTMLDivElement>(null); const scrollRef = useRef<HTMLDivElement>(null);
@ -592,11 +591,12 @@ export function Chat(props: {
) { ) {
const copiedHello = Object.assign({}, BOT_HELLO); const copiedHello = Object.assign({}, BOT_HELLO);
if (!accessStore.isAuthorized()) { if (!accessStore.isAuthorized()) {
setDialog(true)
// copiedHello.content = Locale.Error.Unauthorized; // copiedHello.content = Locale.Error.Unauthorized;
setDialog(true)
} }
context.push(copiedHello); context.push(copiedHello);
} }
const handleClick = () =>{ const handleClick = () =>{
accessStore.updateCode(dialogValue); accessStore.updateCode(dialogValue);
setDialog(false) setDialog(false)
@ -851,10 +851,9 @@ export function Chat(props: {
setDialogValue(e.currentTarget.value); setDialogValue(e.currentTarget.value);
}} /> }} />
</div> </div>
<button style="margin-top: 30px" onClick={handleClick}></button> <button onClick={handleClick}></button>
</div> </div>
</div> : ''} </div> : ''}
</div> </div>
); );
} }