fix: session list UX in mobile

This commit is contained in:
Tristan Yang
2023-06-21 18:49:55 +08:00
parent 880cf98185
commit 53695252b6
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -113,7 +113,7 @@ const SessionList: FC<Props> = ({ tempSession }) => {
]); ]);
return ( return (
<> <div className="h-full pb-14 md:pb-0 overflow-auto">
{pinSessions.length ? ( {pinSessions.length ? (
<ul className="flex flex-col gap-0.5 py-1 px-2 bg-primary-500/10"> <ul className="flex flex-col gap-0.5 py-1 px-2 bg-primary-500/10">
{pinSessions.map((p) => { {pinSessions.map((p) => {
@@ -133,7 +133,7 @@ const SessionList: FC<Props> = ({ tempSession }) => {
})} })}
</ul> </ul>
) : null} ) : null}
<ul ref={ref} className="flex flex-1 flex-col gap-0.5 p-2 overflow-auto"> <ul ref={ref} className="flex flex-1 flex-col gap-0.5 p-2">
<ViewportList initialPrerender={10} viewportRef={ref} items={sessions}> <ViewportList initialPrerender={10} viewportRef={ref} items={sessions}>
{(s) => { {(s) => {
const { type, id, mid = 0 } = s; const { type, id, mid = 0 } = s;
@@ -168,7 +168,7 @@ const SessionList: FC<Props> = ({ tempSession }) => {
}} }}
/> />
)} )}
</> </div>
); );
}; };
export default memo(SessionList); export default memo(SessionList);
+1 -1
View File
@@ -89,7 +89,7 @@ function ChatPage() {
)} )}
<div <div
className={clsx( className={clsx(
"left-container pb-14 md:pb-0 flex-col md:rounded-l-2xl w-full h-screen md:h-full md:max-w-[250px] md:min-w-[268px] shadow-[rgb(0_0_0_/_10%)_-1px_0px_0px_inset] bg-white dark:!bg-gray-800", "left-container flex-col md:rounded-l-2xl w-full h-screen md:h-full md:max-w-[250px] md:min-w-[268px] shadow-[rgb(0_0_0_/_10%)_-1px_0px_0px_inset] bg-white dark:!bg-gray-800",
isMainPath ? "flex" : "hidden md:flex" isMainPath ? "flex" : "hidden md:flex"
)} )}
> >