-
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.
Add difficulty slider to search filters (#41)
* Add difficulty slider to search filters * Remove logs * Refactor to have values internal to models lib
- Loading branch information
Showing
10 changed files
with
207 additions
and
118 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* A Topo represents drawn diagrams on top of photo, intending | ||
* to show route lines, sections of a wall, or a topo of a crag | ||
* showing areas from afar. | ||
* | ||
* Features: | ||
* * Vector based canvas editor to generate topos | ||
* * A Topo can be associated with any Photoable, and also have | ||
* additional relationships with crags, areas, boulders, or routes. | ||
* * Crag -- topos annotate areas in the crag | ||
* * Area -- topos annotate boulders in an area | ||
* * Boulder -- topos annotate the routes on a boulder. | ||
* * Route -- topo annotates a single route on a single image. | ||
* * A Topo will have various tools for generating diagrams | ||
* * Path -- basic paths, or even a closed polygon | ||
* * Icons -- signal hold types, or mark flexing holds, etc. | ||
* * Labels -- while associations will help us relate which path applies to what, | ||
* labels can bake that into the image. | ||
*/ |
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,37 @@ | ||
"use client"; | ||
import { searchParamsParsers } from "@/app/_components/search/searchParams"; | ||
import useQueryState from "@/app/_util/useQueryState"; | ||
import { Slider } from "@mui/material"; | ||
import { grades } from "models"; | ||
|
||
export default function DifficultySlider() { | ||
const [difficultyMin, setDifficultyMin] = useQueryState( | ||
"vMin", | ||
searchParamsParsers.vMin | ||
); | ||
const [difficultyMax, setDifficultyMax] = useQueryState( | ||
"vMax", | ||
searchParamsParsers.vMax | ||
); | ||
// VB - V17 | ||
const marks = Object.values(grades.V).map((g) => ({ | ||
value: g.value, | ||
label: g.raw, | ||
})); | ||
return ( | ||
<Slider | ||
aria-label="v scale" | ||
value={[difficultyMin, difficultyMax]} | ||
max={marks[marks.length - 1].value} | ||
step={null} | ||
marks={marks} | ||
onChange={(_, _values: unknown) => { | ||
const values = _values as [number, number]; | ||
setDifficultyMin(values[0]); | ||
setDifficultyMax(values[1]); | ||
}} | ||
valueLabelDisplay="off" | ||
valueLabelFormat={(_, i) => marks[i].label} | ||
/> | ||
); | ||
} |
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
Oops, something went wrong.