Skip to content

Commit

Permalink
remove unused prop
Browse files Browse the repository at this point in the history
  • Loading branch information
fechan committed Jul 29, 2024
1 parent 5bcbaf0 commit 87b6029
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
27 changes: 3 additions & 24 deletions client/src/components/EdgeOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { SendMessage } from "react-use-websocket";
import { Edge, useOnSelectionChange, useStoreApi } from "reactflow";
import { GraphUpdateCallbacks } from "../GraphUpdateCallbacks";
import { useFactoryStore } from "../stores/factory";
import { FilterSyntax } from "./FilterSyntax";

interface EdgeOptionsProps {
sendMessage: SendMessage,
addReqNeedingLayout: (reqId: string) => void,
};

export function EdgeOptions({ sendMessage, addReqNeedingLayout }: EdgeOptionsProps) {
export function EdgeOptions({ sendMessage }: EdgeOptionsProps) {
const [ selectedEdges, setSelectedEdges ] = useState([] as Edge[]);

const pipes = useFactoryStore(state => state.factory.pipes);
Expand Down Expand Up @@ -88,28 +88,7 @@ export function EdgeOptions({ sendMessage, addReqNeedingLayout }: EdgeOptionsPro
value={ filter }
onInput={ e => setFilter((e.target as HTMLInputElement).value) }
/>
<details className="text-sm text-neutral-700 mt-1 w-full">
<summary className="cursor-pointer">Advanced syntax</summary>

<p>
Prefix a term with an exclamation mark (!) to exclude it:
<blockquote className="ps-5">!cobblestone</blockquote>
</p>

<p>
Filter supports JEI prefixes for:
<ul className="list-disc ps-5">
<li>@mod_name</li>
<li>&item_id</li>
<li>$ore_dict</li>
</ul>
</p>

<p>
To match multiple filters, use the pipe (|) character:
<blockquote className="ps-5">iron ore | dirt | cobblestone</blockquote>
</p>
</details>
<FilterSyntax />
</div>

<div className="text-right box-border">
Expand Down
26 changes: 26 additions & 0 deletions client/src/components/FilterSyntax.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export function FilterSyntax () {
return (
<details className="text-sm text-neutral-700 mt-1 w-full">
<summary className="cursor-pointer">Advanced syntax</summary>

<p>
Prefix a term with an exclamation mark (!) to exclude it:
<blockquote className="ps-5">!cobblestone</blockquote>
</p>

<p>
Filter supports JEI prefixes for:
</p>
<ul className="list-disc ps-5">
<li>@mod_name</li>
<li>&item_id</li>
<li>$ore_dict</li>
</ul>

<p>
To match multiple filters, use the pipe (|) character:
<blockquote className="ps-5">iron ore | dirt | cobblestone</blockquote>
</p>
</details>
)
}
2 changes: 2 additions & 0 deletions client/src/components/TempEdgeOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Dispatch, SetStateAction, useState } from "react";
import { SendMessage } from "react-use-websocket";
import { Edge } from "reactflow";
import { v4 as uuidv4 } from "uuid";
import { FilterSyntax } from "./FilterSyntax";

export interface TempEdgeOptionsProps {
sendMessage: SendMessage,
Expand Down Expand Up @@ -65,6 +66,7 @@ export function TempEdgeOptions({ tempEdge, setTempEdge, sendMessage, onCancel }
value={ filter }
onInput={ e => setFilter((e.target as HTMLInputElement).value) }
/>
<FilterSyntax />
</div>

<div className="text-right box-border">
Expand Down

0 comments on commit 87b6029

Please sign in to comment.