mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-04-29 23:07:48 +08:00
Feat: Make the embedded page of chat compatible with mobile devices. (#13262)
### What problem does this PR solve? Feat: Make the embedded page of chat compatible with mobile devices. ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -20,15 +20,23 @@ export function EmbedContainer({
|
||||
|
||||
return (
|
||||
<section className="h-[100vh] flex justify-center items-center">
|
||||
<div className="w-40 flex gap-2 absolute left-3 top-12 items-center">
|
||||
<div className="hidden xl:flex w-40 gap-2 absolute left-3 top-12 items-center">
|
||||
<img src="/logo.svg" alt="" />
|
||||
<span className="text-2xl font-bold">{appConf.appName}</span>
|
||||
</div>
|
||||
<div className=" w-[80vw] border rounded-lg">
|
||||
<div className="flex justify-between items-center border-b p-3">
|
||||
<div className="flex gap-2 items-center">
|
||||
<RAGFlowAvatar avatar={avatar} name={title} isPerson />
|
||||
<div className="text-xl text-foreground">{title}</div>
|
||||
<div className="w-full h-full md:w-[80vw] md:h-auto border-0 md:border rounded-none md:rounded-lg">
|
||||
<div className="flex justify-between items-center border-b p-3 relative">
|
||||
<div className="flex gap-2 items-center absolute left-1/2 -translate-x-1/2 md:static md:left-auto md:translate-x-0">
|
||||
<RAGFlowAvatar
|
||||
avatar={avatar}
|
||||
name={title}
|
||||
isPerson
|
||||
className="size-5 md:size-10"
|
||||
/>
|
||||
<div className="md:text-xl text-foreground">{title}</div>
|
||||
</div>
|
||||
<div className="flex md:hidden items-center">
|
||||
<img src="/logo.svg" alt="" className="h-6" />
|
||||
</div>
|
||||
<Button
|
||||
variant={'secondary'}
|
||||
@ -37,7 +45,7 @@ export function EmbedContainer({
|
||||
>
|
||||
<div className="flex gap-1 items-center">
|
||||
<RefreshCcw size={14} />
|
||||
<span className="text-lg ">Reset</span>
|
||||
<span className="hidden text-lg md:inline-block">Reset</span>
|
||||
</div>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@ -126,7 +126,7 @@ const ChatContainer = () => {
|
||||
<div className="flex flex-1 flex-col p-2.5 h-[90vh] m-3">
|
||||
<div
|
||||
className={cn(
|
||||
'flex flex-1 flex-col overflow-auto scrollbar-auto m-auto w-5/6',
|
||||
'flex flex-1 flex-col overflow-auto scrollbar-auto m-auto md:w-5/6',
|
||||
)}
|
||||
ref={messageContainerRef}
|
||||
>
|
||||
@ -186,8 +186,8 @@ const ChatContainer = () => {
|
||||
<div ref={scrollRef} />
|
||||
</div>
|
||||
{isTaskMode || (
|
||||
<div className="flex w-full justify-center mb-8">
|
||||
<div className="w-5/6">
|
||||
<div className="flex w-full justify-center md:mb-8">
|
||||
<div className="w-full md:w-5/6">
|
||||
<NextMessageInput
|
||||
isShared
|
||||
value={value}
|
||||
|
||||
@ -71,10 +71,10 @@ const ChatContainer = () => {
|
||||
avatar={chatInfo.avatar}
|
||||
handleReset={removeAllMessagesExceptFirst}
|
||||
>
|
||||
<div className="flex flex-1 flex-col p-2.5 h-[90vh] m-3">
|
||||
<div className="flex flex-1 flex-col p-2.5 h-[90vh] m-3">
|
||||
<div
|
||||
className={
|
||||
'flex flex-1 flex-col overflow-auto scrollbar-auto m-auto w-5/6'
|
||||
'flex flex-1 flex-col overflow-auto scrollbar-auto m-auto w-full md:w-5/6'
|
||||
}
|
||||
ref={messageContainerRef}
|
||||
>
|
||||
@ -109,8 +109,8 @@ const ChatContainer = () => {
|
||||
</div>
|
||||
<div ref={scrollRef} />
|
||||
</div>
|
||||
<div className="flex w-full justify-center mb-8">
|
||||
<div className="w-5/6">
|
||||
<div className="flex w-full justify-center md:mb-8">
|
||||
<div className="w-full md:w-5/6">
|
||||
<NextMessageInput
|
||||
isShared
|
||||
value={value}
|
||||
|
||||
@ -15,6 +15,7 @@ import {
|
||||
useFetchTenantInfo,
|
||||
useFetchUserInfo,
|
||||
} from '@/hooks/use-user-setting-request';
|
||||
import { Routes } from '@/routes';
|
||||
import { Send, Settings } from 'lucide-react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@ -109,7 +110,7 @@ export default function SearchPage() {
|
||||
<EmbedAppModal
|
||||
open={openEmbed}
|
||||
setOpen={setOpenEmbed}
|
||||
url="/next-search/share"
|
||||
url={Routes.SearchShare}
|
||||
token={SearchData?.id as string}
|
||||
from={SharedFrom.Search}
|
||||
tenantId={tenantId}
|
||||
|
||||
Reference in New Issue
Block a user