-
Notifications
You must be signed in to change notification settings - Fork 4
feat(projects): Filter by award category #168
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
Changes from 1 commit
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 |
|---|---|---|
|
|
@@ -36,6 +36,7 @@ export function ProjectsPage({isAdmin = false}: {isAdmin?: boolean}) { | |
| const {yearId} = useParams<{yearId: string}>(); | ||
| const [kind, setKind] = useState<'project' | 'idea'>('project'); | ||
| const [group, setGroup] = useState(''); | ||
| const [category, setCategory] = useState(''); | ||
| const [searchInput, setSearchInput] = useState(''); | ||
| const [search, setSearch] = useState(''); | ||
| const [cursor, setCursor] = useState<string | undefined>(); | ||
|
|
@@ -49,6 +50,7 @@ export function ProjectsPage({isAdmin = false}: {isAdmin?: boolean}) { | |
| yearId, | ||
| kind, | ||
| kind === 'project' ? group || undefined : undefined, | ||
| kind === 'project' ? category || undefined : undefined, | ||
| search || undefined, | ||
| cursor, | ||
| ); | ||
|
|
@@ -226,6 +228,25 @@ export function ProjectsPage({isAdmin = false}: {isAdmin?: boolean}) { | |
| </select> | ||
| </label> | ||
| )} | ||
| {kind === 'project' && ballot.data && ballot.data.categories.length > 0 && ( | ||
| <label> | ||
| <span>Award category</span> | ||
| <select | ||
| value={category} | ||
| onChange={(event) => { | ||
| setCategory(event.target.value); | ||
| resetPagination(); | ||
| }} | ||
| > | ||
| <option value="">All award categories</option> | ||
| {ballot.data.categories.map((item) => ( | ||
| <option value={item.id} key={item.id}> | ||
| {item.name} | ||
| </option> | ||
| ))} | ||
| </select> | ||
| </label> | ||
| )} | ||
|
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. Empty state ignores category filterLow Severity The empty-results copy only treats Reviewed by Cursor Bugbot for commit f0133ae. Configure here. |
||
| <div className="projectViewToggle" role="group" aria-label="Project view"> | ||
| {(['grid', 'list'] as const).map((option) => ( | ||
| <button | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.