carnet uix layout
This commit is contained in:
parent
0c0b564673
commit
4427aa9937
@ -32,6 +32,7 @@ export default function CarnetPage() {
|
|||||||
const [isMobile, setIsMobile] = useState(false);
|
const [isMobile, setIsMobile] = useState(false);
|
||||||
const [showNav, setShowNav] = useState(true);
|
const [showNav, setShowNav] = useState(true);
|
||||||
const [showNotes, setShowNotes] = useState(true);
|
const [showNotes, setShowNotes] = useState(true);
|
||||||
|
const [nextcloudFolders, setNextcloudFolders] = useState<string[]>([]);
|
||||||
|
|
||||||
// Panel widths state
|
// Panel widths state
|
||||||
const [navWidth, setNavWidth] = useState(220);
|
const [navWidth, setNavWidth] = useState(220);
|
||||||
@ -43,6 +44,24 @@ export default function CarnetPage() {
|
|||||||
const isSmallScreen = useMediaQuery("(max-width: 768px)");
|
const isSmallScreen = useMediaQuery("(max-width: 768px)");
|
||||||
const isMediumScreen = useMediaQuery("(max-width: 1024px)");
|
const isMediumScreen = useMediaQuery("(max-width: 1024px)");
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const fetchNextcloudFolders = async () => {
|
||||||
|
try {
|
||||||
|
const response = await fetch('/api/nextcloud/status');
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error('Failed to fetch Nextcloud folders');
|
||||||
|
}
|
||||||
|
const data = await response.json();
|
||||||
|
setNextcloudFolders(data.folders || []);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error fetching Nextcloud folders:', err);
|
||||||
|
setNextcloudFolders([]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
fetchNextcloudFolders();
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (status === "unauthenticated") {
|
if (status === "unauthenticated") {
|
||||||
redirect("/signin");
|
redirect("/signin");
|
||||||
@ -114,7 +133,12 @@ export default function CarnetPage() {
|
|||||||
className="flex flex-col h-full bg-carnet-sidebar"
|
className="flex flex-col h-full bg-carnet-sidebar"
|
||||||
style={{ width: `${navWidth}px` }}
|
style={{ width: `${navWidth}px` }}
|
||||||
>
|
>
|
||||||
<Navigation onLayoutChange={setLayoutMode} />
|
<Navigation
|
||||||
|
layout={layoutMode}
|
||||||
|
onLayoutChange={setLayoutMode}
|
||||||
|
nextcloudFolders={nextcloudFolders}
|
||||||
|
onFolderSelect={() => {}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Navigation Resizer */}
|
{/* Navigation Resizer */}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user