-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pick grid to battle with, using search criteria
- Loading branch information
1 parent
3995566
commit 7f6f456
Showing
5 changed files
with
92 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { useState } from "react"; | ||
import ListGrids from "./ListGrids"; | ||
import { GridSource } from "../Models"; | ||
import { FloatingLabel, Select } from "flowbite-react"; | ||
|
||
type Props = { | ||
pageSize: number; | ||
onGridChosen: (gridId: string) => void; | ||
}; | ||
|
||
export default function SearchGrids({ pageSize, onGridChosen }: Props) { | ||
const [query, setQuery] = useState(""); | ||
const [source, setSource] = useState<GridSource>("NYT"); | ||
|
||
return ( | ||
<div> | ||
<form onSubmit={(e) => e.preventDefault()} className="flex gap-2"> | ||
<div className="grow"> | ||
<FloatingLabel sizing="sm" variant="outlined" label="Search by Name or ID" value={query} onChange={(e) => setQuery(e.target.value)} /> | ||
</div> | ||
<Select value={source} onChange={(e) => setSource(e.target.value as GridSource)}> | ||
<option value="NYT">NYT</option> | ||
<option value="Custom">User Submitted</option> | ||
</Select> | ||
</form> | ||
<ListGrids onGridChosen={onGridChosen} pageSize={pageSize} query={query} source={source} /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters