No groups match that.
+ )}
+ {us.length > 0 && (
+ <>
+
{children}
@@ -828,20 +934,6 @@ export default function OrgListMap({ view = "map", accent = FALLBACK_COLOR }) {
const shared = { selected, setSelected, hovered, setHovered: hoverOnMap };
const onMapIds = new Set(regionAreas.map(a => a.region_id));
- const block = (region, indent) => (
-
- );
-
return (
/* Wider than the section heading above it, the map needs the
room. CONTENT_MAX is the knob; drop it toward 72rem to pull
@@ -877,26 +969,16 @@ export default function OrgListMap({ view = "map", accent = FALLBACK_COLOR }) {
{/* List, h-0 + min-h-full makes this column take its height
from the map column rather than the other way round, so a
- long list scrolls instead of stretching the section. */}
-
-
- {US_TITLE}
-
- {domestic.map(r => block(r, true))}
-
-
+
+
- {INTL_TITLE}
-
- {international.map(r => block(r, true))}
-
-
- {virtual.map(r => block(r, false))}
+ {list}
diff --git a/src/pages/sections/QrCodeMaker.tsx b/src/pages/sections/QrCodeMaker.tsx
index a31205b..b0e380b 100644
--- a/src/pages/sections/QrCodeMaker.tsx
+++ b/src/pages/sections/QrCodeMaker.tsx
@@ -39,6 +39,7 @@ import { useNavSections } from '../../lib/navSections.ts'
import { awardHref, blogHref, eventHref, orgHref, personHref, teamHref } from '../../lib/hrefs.ts'
import { siteUrl } from '../../lib/site.ts'
import { useDirectory, type Directory } from '../../lib/useContent.ts'
+import { FILTER_FROM, OptionFilter, narrow } from '../../components/OptionFilter.tsx'
import { accentText, BRAND } from '../../lib/color.ts'
const MUTED = 'var(--color-muted)'
@@ -269,6 +270,16 @@ export default function QrCodeMaker() {
const groups = useMemo(() => groupsFor(kind, directory), [kind, directory])
const choices = useMemo(() => groups.flatMap((group) => group.choices), [groups])
+ // Past FILTER_FROM records, a box above the select narrows them;
+ // the one chosen always stays.
+ const [needle, setNeedle] = useState('')
+ const shownGroups = useMemo(
+ () =>
+ groups
+ .map((group) => ({ ...group, choices: narrow(group.choices, needle, (c) => c.label, (c) => c.path === path) }))
+ .filter((group) => group.choices.length > 0),
+ [groups, needle, path],
+ )
// A new kind, or the directory arriving, can leave the current
// path outside the list; fall back to its first entry.
@@ -308,7 +319,10 @@ export default function QrCodeMaker() {
return (
-
setKind(v as Kind)}>
+ {
+ setKind(v as Kind)
+ setNeedle('')
+ }}>
{KINDS.map(([value, label]) => (
{label}
@@ -343,33 +357,38 @@ export default function QrCodeMaker() {
) : choices.length === 0 ? (
Nothing published here yet.
) : (
- {
- setPath(v)
- setSection('')
- }}
- >
- {groups.map((group, i) =>
- group.label ? (
-
- {group.choices.map((c) => (
-
+
+ {
+ setPath(v)
+ setSection('')
+ }}
+ >
+ {shownGroups.map((group, i) =>
+ group.label ? (
+
+ {group.choices.map((c) => (
+
+ {c.label}
+
+ ))}
+
+ ) : (
+ group.choices.map((c) => (
+
{c.label}
- ))}
-
- ) : (
- group.choices.map((c) => (
-
- {c.label}
-
- ))
- ),
+ ))
+ ),
+ )}
+
+ {choices.length > FILTER_FROM && (
+
)}
-
+
)}
{sections.length > 0 && (