diff --git a/src/frontend/src/pages/CommunityPage/index.tsx b/src/frontend/src/pages/CommunityPage/index.tsx index c96bbdaf4..7f808f035 100644 --- a/src/frontend/src/pages/CommunityPage/index.tsx +++ b/src/frontend/src/pages/CommunityPage/index.tsx @@ -7,6 +7,7 @@ import { useNavigate } from "react-router-dom"; import { CardComponent } from "../../components/cardComponent"; import IconComponent from "../../components/genericIconComponent"; import Header from "../../components/headerComponent"; +import { SkeletonCardComponent } from "../../components/skeletonCardComponent"; import { getExamples } from "../../controllers/API"; import { FlowType } from "../../types/flow"; export default function CommunityPage(): JSX.Element { @@ -74,7 +75,14 @@ export default function CommunityPage(): JSX.Element { new and powerful features.
- {!loadingExamples && + {loadingExamples ? ( + <> + + + + + + ) : ( examples.map((flow, idx) => ( } /> - ))} + )) + )}
diff --git a/src/frontend/src/pages/MainPage/index.tsx b/src/frontend/src/pages/MainPage/index.tsx index 8365eb3f5..067a63fcc 100644 --- a/src/frontend/src/pages/MainPage/index.tsx +++ b/src/frontend/src/pages/MainPage/index.tsx @@ -1,4 +1,4 @@ -import { useContext, useEffect } from "react"; +import { useContext, useEffect, useState } from "react"; import { Link, useNavigate } from "react-router-dom"; import DropdownButton from "../../components/DropdownButtonComponent"; import { CardComponent } from "../../components/cardComponent"; @@ -35,6 +35,28 @@ export default function HomePage(): JSX.Element { }, []); const navigate = useNavigate(); + const [isDragging, setIsDragging] = useState(false); + + const dragOver = (e) => { + e.preventDefault(); + setIsDragging(true); + }; + + const dragEnter = (e) => { + e.preventDefault(); + setIsDragging(true); + }; + + const dragLeave = () => { + setIsDragging(false); + }; + + const fileDrop = (e) => { + e.preventDefault(); + setIsDragging(false); + // Handle file drop logic here + }; + // Personal flows display return ( <> @@ -78,40 +100,59 @@ export default function HomePage(): JSX.Element { Manage your personal projects. Download or upload your collection. -
- {isLoading && flows.length == 0 ? ( +
+ {isDragging ? ( <> - - - - + + Drop your flow here ) : ( - flows.map((flow, idx) => ( - - - - } - onDelete={() => { - removeFlow(flow.id); - }} - /> - )) +
+ {isLoading && flows.length == 0 ? ( + <> + + + + + + ) : ( + flows.map((flow, idx) => ( + + + + } + onDelete={() => { + removeFlow(flow.id); + }} + /> + )) + )} +
)}
diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts index caba6fc77..ec3692c80 100644 --- a/src/frontend/src/utils/styleUtils.ts +++ b/src/frontend/src/utils/styleUtils.ts @@ -1,4 +1,5 @@ import { + ArrowUpToLine, Bell, Check, CheckCircle2, @@ -188,6 +189,7 @@ export const nodeNames: { [char: string]: string } = { }; export const nodeIconsLucide: iconsType = { + ArrowUpToLine: ArrowUpToLine, Chroma: ChromaIcon, AirbyteJSONLoader: AirbyteIcon, Anthropic: AnthropicIcon,