Added style to file drop
This commit is contained in:
parent
8119d5922b
commit
539e508e12
3 changed files with 86 additions and 34 deletions
|
|
@ -7,6 +7,7 @@ import { useNavigate } from "react-router-dom";
|
||||||
import { CardComponent } from "../../components/cardComponent";
|
import { CardComponent } from "../../components/cardComponent";
|
||||||
import IconComponent from "../../components/genericIconComponent";
|
import IconComponent from "../../components/genericIconComponent";
|
||||||
import Header from "../../components/headerComponent";
|
import Header from "../../components/headerComponent";
|
||||||
|
import { SkeletonCardComponent } from "../../components/skeletonCardComponent";
|
||||||
import { getExamples } from "../../controllers/API";
|
import { getExamples } from "../../controllers/API";
|
||||||
import { FlowType } from "../../types/flow";
|
import { FlowType } from "../../types/flow";
|
||||||
export default function CommunityPage(): JSX.Element {
|
export default function CommunityPage(): JSX.Element {
|
||||||
|
|
@ -74,7 +75,14 @@ export default function CommunityPage(): JSX.Element {
|
||||||
new and powerful features.
|
new and powerful features.
|
||||||
</span>
|
</span>
|
||||||
<div className="community-pages-flows-panel">
|
<div className="community-pages-flows-panel">
|
||||||
{!loadingExamples &&
|
{loadingExamples ? (
|
||||||
|
<>
|
||||||
|
<SkeletonCardComponent />
|
||||||
|
<SkeletonCardComponent />
|
||||||
|
<SkeletonCardComponent />
|
||||||
|
<SkeletonCardComponent />
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
examples.map((flow, idx) => (
|
examples.map((flow, idx) => (
|
||||||
<CardComponent
|
<CardComponent
|
||||||
key={idx}
|
key={idx}
|
||||||
|
|
@ -99,7 +107,8 @@ export default function CommunityPage(): JSX.Element {
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
))}
|
))
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { useContext, useEffect } from "react";
|
import { useContext, useEffect, useState } from "react";
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router-dom";
|
||||||
import DropdownButton from "../../components/DropdownButtonComponent";
|
import DropdownButton from "../../components/DropdownButtonComponent";
|
||||||
import { CardComponent } from "../../components/cardComponent";
|
import { CardComponent } from "../../components/cardComponent";
|
||||||
|
|
@ -35,6 +35,28 @@ export default function HomePage(): JSX.Element {
|
||||||
}, []);
|
}, []);
|
||||||
const navigate = useNavigate();
|
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
|
// Personal flows display
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
@ -78,40 +100,59 @@ export default function HomePage(): JSX.Element {
|
||||||
<span className="main-page-description-text">
|
<span className="main-page-description-text">
|
||||||
Manage your personal projects. Download or upload your collection.
|
Manage your personal projects. Download or upload your collection.
|
||||||
</span>
|
</span>
|
||||||
<div className="main-page-flows-display">
|
<div
|
||||||
{isLoading && flows.length == 0 ? (
|
onDragOver={dragOver}
|
||||||
|
onDragEnter={dragEnter}
|
||||||
|
onDragLeave={dragLeave}
|
||||||
|
onDrop={fileDrop}
|
||||||
|
className={
|
||||||
|
"h-full w-full " + (isDragging
|
||||||
|
? "flex flex-col items-center justify-center mb-24 gap-4 text-2xl font-light"
|
||||||
|
: "")
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{isDragging ? (
|
||||||
<>
|
<>
|
||||||
<SkeletonCardComponent />
|
<IconComponent name="ArrowUpToLine" className="h-12 w-12 stroke-1" />
|
||||||
<SkeletonCardComponent />
|
Drop your flow here
|
||||||
<SkeletonCardComponent />
|
|
||||||
<SkeletonCardComponent />
|
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
flows.map((flow, idx) => (
|
<div className="main-page-flows-display">
|
||||||
<CardComponent
|
{isLoading && flows.length == 0 ? (
|
||||||
key={idx}
|
<>
|
||||||
flow={flow}
|
<SkeletonCardComponent />
|
||||||
id={flow.id}
|
<SkeletonCardComponent />
|
||||||
button={
|
<SkeletonCardComponent />
|
||||||
<Link to={"/flow/" + flow.id}>
|
<SkeletonCardComponent />
|
||||||
<Button
|
</>
|
||||||
variant="outline"
|
) : (
|
||||||
size="sm"
|
flows.map((flow, idx) => (
|
||||||
className="whitespace-nowrap "
|
<CardComponent
|
||||||
>
|
key={idx}
|
||||||
<IconComponent
|
flow={flow}
|
||||||
name="ExternalLink"
|
id={flow.id}
|
||||||
className="main-page-nav-button"
|
button={
|
||||||
/>
|
<Link to={"/flow/" + flow.id}>
|
||||||
Edit Flow
|
<Button
|
||||||
</Button>
|
variant="outline"
|
||||||
</Link>
|
size="sm"
|
||||||
}
|
className="whitespace-nowrap "
|
||||||
onDelete={() => {
|
>
|
||||||
removeFlow(flow.id);
|
<IconComponent
|
||||||
}}
|
name="ExternalLink"
|
||||||
/>
|
className="main-page-nav-button"
|
||||||
))
|
/>
|
||||||
|
Edit Flow
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
|
}
|
||||||
|
onDelete={() => {
|
||||||
|
removeFlow(flow.id);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import {
|
import {
|
||||||
|
ArrowUpToLine,
|
||||||
Bell,
|
Bell,
|
||||||
Check,
|
Check,
|
||||||
CheckCircle2,
|
CheckCircle2,
|
||||||
|
|
@ -188,6 +189,7 @@ export const nodeNames: { [char: string]: string } = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const nodeIconsLucide: iconsType = {
|
export const nodeIconsLucide: iconsType = {
|
||||||
|
ArrowUpToLine: ArrowUpToLine,
|
||||||
Chroma: ChromaIcon,
|
Chroma: ChromaIcon,
|
||||||
AirbyteJSONLoader: AirbyteIcon,
|
AirbyteJSONLoader: AirbyteIcon,
|
||||||
Anthropic: AnthropicIcon,
|
Anthropic: AnthropicIcon,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue