-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React flow #41
React flow #41
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
npm install | ||
npm startgit c | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
import { useState } from "react"; | ||
import { | ||
BaseEdge, | ||
EdgeLabelRenderer, | ||
EdgeProps, | ||
getSmoothStepPath | ||
} from "reactflow"; | ||
import { New } from "../components"; | ||
import { BaseEdge, EdgeProps, getSmoothStepPath } from "reactflow"; | ||
|
||
export const NoEdge: React.FC<EdgeProps> = ({ | ||
id, | ||
|
@@ -29,7 +23,7 @@ export const NoEdge: React.FC<EdgeProps> = ({ | |
return ( | ||
<> | ||
<BaseEdge id={id} path={edgePath} style={{ backgroundColor: "black" }} /> | ||
<EdgeLabelRenderer> | ||
{/* <EdgeLabelRenderer> | ||
<div | ||
style={{ | ||
position: "absolute", | ||
Comment on lines
23
to
29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Commented-out code found. If this code is not intended for future use, consider removing it to keep the codebase clean. If it might be used later, please add a comment explaining the conditions under which it should be re-enabled. |
||
|
@@ -44,7 +38,7 @@ export const NoEdge: React.FC<EdgeProps> = ({ | |
> | ||
<New></New> | ||
</div> | ||
</EdgeLabelRenderer> | ||
</EdgeLabelRenderer> */} | ||
</> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import { Typography } from "@material-tailwind/react"; | ||
|
||
function classNames(...classes: any) { | ||
return classes.filter(Boolean).join(" "); | ||
} | ||
export interface WorkflowFormParm { | ||
title: string; | ||
} | ||
|
||
export const WorkflowForm: React.FC<WorkflowFormParm> = ({ title }) => { | ||
return ( | ||
<> | ||
<div className="pl-4 py-4 shadow-md lg:flex lg:items-center lg:justify-between"> | ||
<div className="min-w-0"> | ||
<h2 className="text-lg font-bold leading-7 text-gray-900 sm:truncate sm:tracking-tight"> | ||
Back End Developer | ||
</h2> | ||
</div> | ||
<div className="mt-5 flex lg:ml-4 lg:mt-0"> | ||
{/* <span className="hidden sm:block"> | ||
<button | ||
type="button" | ||
className="inline-flex items-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50" | ||
> | ||
<PencilIcon | ||
className="-ml-0.5 mr-1.5 h-5 w-5 text-gray-400" | ||
aria-hidden="true" | ||
/> | ||
</button> | ||
</span> */} | ||
|
||
{/* <span className="sm:ml-3"> | ||
<button | ||
type="button" | ||
className="inline-flex items-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600" | ||
> | ||
<CheckIcon | ||
className="-ml-0.5 mr-1.5 h-5 w-5" | ||
aria-hidden="true" | ||
/> | ||
Save | ||
</button> | ||
</span> */} | ||
</div> | ||
</div> | ||
<div className="flex "> | ||
<Typography variant="h5" color="blue-gray"> | ||
Recent Transactions | ||
</Typography> | ||
</div> | ||
{/* <Card className="w-full"> | ||
<CardHeader | ||
floated={false} | ||
shadow={false} | ||
className="rounded-none bg-indigo-200" | ||
> | ||
<div className="mb-4 flex "> | ||
<Typography variant="h5" color="blue-gray"> | ||
Recent Transactions | ||
</Typography> | ||
</div> | ||
</CardHeader> | ||
<CardBody> | ||
<Typography variant="h5" color="blue-gray" className="mb-2"> | ||
UI/UX Review Check | ||
</Typography> | ||
<Typography> | ||
The place is close to Barceloneta Beach and bus stop just 2 min by | ||
walk and near to "Naviglio" where you can enjoy the main | ||
night life in Barcelona. | ||
</Typography> | ||
</CardBody> | ||
<CardFooter className="pt-0"> | ||
<Button>Read More</Button> | ||
</CardFooter> | ||
</Card> */} | ||
</> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
import { useState } from "react"; | ||
import { useEffect, useState } from "react"; | ||
import { NodeProps, Position, useNodeId } from "reactflow"; | ||
import { classNames } from ".."; | ||
import CustomHandle from "../handler/test"; | ||
|
||
export const ActionNode: React.FC<NodeProps> = ({ data, xPos, yPos }) => { | ||
Check notice on line 6 in src/components/flow/node/action.tsx
|
||
const [selected, setValueSelected] = useState({} as any); | ||
const [open, setOpen] = useState(false); | ||
const nodeId = useNodeId(); | ||
console.log("x - ", xPos, ", y -", yPos); | ||
let bgColor = | ||
data?.payload?.type_field == "Assertion" ? "bg-red-100" : "bg-indigo-100"; | ||
|
||
useEffect(() => { | ||
classNames; | ||
}, [data]); | ||
Comment on lines
+13
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
return ( | ||
<> | ||
<CustomHandle | ||
|
@@ -17,9 +23,14 @@ | |
isConnectable={true} | ||
isConnectableStart={false} | ||
/> | ||
<div className="h-10 w-44 border-white bg-indigo-400 rounded-lg shadow-sm hover:shadow-md"> | ||
<div className="self-center p-2 align-middle text-center"> | ||
[ {data.label} ]{/* [ {data?.payload?.type_field} ] */} | ||
<div | ||
className={classNames( | ||
"h-10 w-44 border-white rounded-lg shadow-sm hover:shadow-md", | ||
bgColor | ||
)} | ||
> | ||
<div className="self-center p-2 align-middle text-center "> | ||
[ {data?.payload?.type_field} ] - {data?.payload?.name} | ||
</div> | ||
</div> | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be a typo in the command
npm startgit c
. It likely should benpm start
to correctly start the project.Committable suggestion