mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 05:54:44 +00:00
feat(webui): support responsive layout and transparent bg for left sidebar carousel
This commit is contained in:
@@ -100,6 +100,7 @@ export const FileViewerLeftSidebar: FC<FileViewerLeftSidebarProps> = ({
|
|||||||
if (activeFileInView && activeItemRef.current && !hasScrolledRef.current) {
|
if (activeFileInView && activeItemRef.current && !hasScrolledRef.current) {
|
||||||
activeItemRef.current.scrollIntoView({
|
activeItemRef.current.scrollIntoView({
|
||||||
block: 'center',
|
block: 'center',
|
||||||
|
inline: 'center',
|
||||||
behavior: 'smooth',
|
behavior: 'smooth',
|
||||||
})
|
})
|
||||||
hasScrolledRef.current = true
|
hasScrolledRef.current = true
|
||||||
@@ -107,8 +108,8 @@ export const FileViewerLeftSidebar: FC<FileViewerLeftSidebarProps> = ({
|
|||||||
}, [files, currentAssetId])
|
}, [files, currentAssetId])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full w-24 bg-gray-100 dark:bg-gray-950 flex flex-col flex-shrink-0 select-none">
|
<div className="h-24 md:h-full w-full md:w-24 bg-gray-100 dark:bg-gray-950 flex flex-row md:flex-col flex-shrink-0 select-none">
|
||||||
<div className="flex-1 overflow-y-auto py-4 flex flex-col items-center gap-3 no-scrollbar">
|
<div className="flex-1 overflow-x-auto overflow-y-hidden md:overflow-y-auto md:overflow-x-hidden px-4 md:px-0 py-2 md:py-4 flex flex-row md:flex-col items-center gap-3 no-scrollbar">
|
||||||
{files.map((file) => {
|
{files.map((file) => {
|
||||||
if (!file) return null
|
if (!file) return null
|
||||||
const isActive = file.id === currentAssetId
|
const isActive = file.id === currentAssetId
|
||||||
@@ -137,7 +138,10 @@ export const FileViewerLeftSidebar: FC<FileViewerLeftSidebarProps> = ({
|
|||||||
|
|
||||||
{/* Infinite Scroll Trigger */}
|
{/* Infinite Scroll Trigger */}
|
||||||
{hasMore && (
|
{hasMore && (
|
||||||
<div ref={ref} className="py-2 flex justify-center items-center w-full">
|
<div
|
||||||
|
ref={ref}
|
||||||
|
className="px-2 md:px-0 py-2 md:py-4 flex justify-center items-center h-full md:w-full flex-shrink-0"
|
||||||
|
>
|
||||||
{isFetchingNext && <Loader2 className="h-5 w-5 animate-spin text-muted-foreground" />}
|
{isFetchingNext && <Loader2 className="h-5 w-5 animate-spin text-muted-foreground" />}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ export function FileViewer({
|
|||||||
if (isUnsupported) {
|
if (isUnsupported) {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col flex-1 h-full overflow-hidden bg-gray-100 dark:bg-gray-950 relative">
|
<div className="flex flex-col flex-1 h-full overflow-hidden bg-gray-100 dark:bg-gray-950 relative">
|
||||||
<div className="flex-1 flex min-h-0 relative">
|
<div className="flex-1 flex flex-col-reverse md:flex-row min-h-0 relative">
|
||||||
{children}
|
{children}
|
||||||
<div className="flex-1 flex items-center justify-center">
|
<div className="flex-1 flex items-center justify-center">
|
||||||
<p className="text-muted-foreground">Preview unavailable</p>
|
<p className="text-muted-foreground">Preview unavailable</p>
|
||||||
@@ -227,7 +227,7 @@ export function FileViewer({
|
|||||||
<div className="flex flex-col flex-1 h-full overflow-hidden bg-gray-100 dark:bg-gray-950 relative">
|
<div className="flex flex-col flex-1 h-full overflow-hidden bg-gray-100 dark:bg-gray-950 relative">
|
||||||
{isImage && (
|
{isImage && (
|
||||||
<>
|
<>
|
||||||
<div className="flex-1 flex min-h-0 relative">
|
<div className="flex-1 flex flex-col-reverse md:flex-row min-h-0 relative">
|
||||||
{children}
|
{children}
|
||||||
<div ref={containerRef} className="flex-1 relative overflow-hidden">
|
<div ref={containerRef} className="flex-1 relative overflow-hidden">
|
||||||
<DrawingCanvas
|
<DrawingCanvas
|
||||||
|
|||||||
@@ -799,7 +799,7 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
|
|||||||
onMouseMove={handleMouseMove}
|
onMouseMove={handleMouseMove}
|
||||||
onMouseLeave={handleMouseLeave}
|
onMouseLeave={handleMouseLeave}
|
||||||
>
|
>
|
||||||
<div className="flex-1 flex min-h-0 relative">
|
<div className="flex-1 flex flex-col-reverse md:flex-row min-h-0 relative">
|
||||||
{/* Render Carousel/Sidebar here if not fullscreen */}
|
{/* Render Carousel/Sidebar here if not fullscreen */}
|
||||||
{!state.isFullScreen && children}
|
{!state.isFullScreen && children}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user