Improve FAQ & video rendering, tighten homepage and CSS
This commit is contained in:
parent
05a1f316e1
commit
c69bb0d614
48 changed files with 4689 additions and 1077 deletions
|
|
@ -40,6 +40,9 @@ interface UseMapDataOptions {
|
|||
viewFeature: string | null;
|
||||
activeFeature: string | null;
|
||||
travelTimeEntries: TravelTimeEntry[];
|
||||
/** Share-link code from the URL; appended to data fetches so the backend
|
||||
* grants bbox-scoped access for unlicensed recipients. */
|
||||
shareCode?: string;
|
||||
}
|
||||
|
||||
export function useMapData({
|
||||
|
|
@ -48,6 +51,7 @@ export function useMapData({
|
|||
viewFeature,
|
||||
activeFeature,
|
||||
travelTimeEntries,
|
||||
shareCode,
|
||||
}: UseMapDataOptions) {
|
||||
const [rawData, setRawData] = useState<HexagonData[]>([]);
|
||||
const [postcodeData, setPostcodeData] = useState<PostcodeFeature[]>([]);
|
||||
|
|
@ -148,6 +152,7 @@ export function useMapData({
|
|||
params.set('fields', fieldsParam);
|
||||
if (dragTravelParam) params.set('travel', dragTravelParam);
|
||||
if (viewFeatureIsEnum && dataViewFeature) params.set('enum_dist', dataViewFeature);
|
||||
if (shareCode) params.set('share', shareCode);
|
||||
|
||||
fetch(apiUrl('postcodes', params), authHeaders({ signal: dragAbortRef.current.signal }))
|
||||
.then((res) => res.json())
|
||||
|
|
@ -166,6 +171,7 @@ export function useMapData({
|
|||
params.set('fields', fieldsParam);
|
||||
if (dragTravelParam) params.set('travel', dragTravelParam);
|
||||
if (viewFeatureIsEnum && dataViewFeature) params.set('enum_dist', dataViewFeature);
|
||||
if (shareCode) params.set('share', shareCode);
|
||||
|
||||
fetch(apiUrl('hexagons', params), authHeaders({ signal: dragAbortRef.current.signal }))
|
||||
.then((res) => res.json())
|
||||
|
|
@ -194,6 +200,7 @@ export function useMapData({
|
|||
buildTravelParam,
|
||||
dataViewFeature,
|
||||
viewFeatureIsEnum,
|
||||
shareCode,
|
||||
]);
|
||||
|
||||
// Fetch hexagons or postcodes when bounds/filters change
|
||||
|
|
@ -226,6 +233,7 @@ export function useMapData({
|
|||
params.set('travel', travelParam);
|
||||
}
|
||||
if (viewFeatureIsEnum && dataViewFeature) params.set('enum_dist', dataViewFeature);
|
||||
if (shareCode) params.set('share', shareCode);
|
||||
const res = await fetch(
|
||||
apiUrl('postcodes', params),
|
||||
authHeaders({
|
||||
|
|
@ -260,6 +268,7 @@ export function useMapData({
|
|||
params.set('travel', travelParam);
|
||||
}
|
||||
if (viewFeatureIsEnum && dataViewFeature) params.set('enum_dist', dataViewFeature);
|
||||
if (shareCode) params.set('share', shareCode);
|
||||
const res = await fetch(
|
||||
apiUrl('hexagons', params),
|
||||
authHeaders({
|
||||
|
|
@ -311,6 +320,7 @@ export function useMapData({
|
|||
viewFeatureIsEnum,
|
||||
usePostcodeView,
|
||||
travelParam,
|
||||
shareCode,
|
||||
]);
|
||||
|
||||
// Use drag data when it matches the current view feature, otherwise fall back to rawData
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ export function useUrlSync(
|
|||
features: FeatureMeta[],
|
||||
selectedPOICategories: Set<string>,
|
||||
rightPaneTab: 'properties' | 'area',
|
||||
travelTimeEntries?: TravelTimeEntry[]
|
||||
travelTimeEntries?: TravelTimeEntry[],
|
||||
share?: string
|
||||
) {
|
||||
const urlDebounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
|
|
@ -26,7 +27,8 @@ export function useUrlSync(
|
|||
features,
|
||||
selectedPOICategories,
|
||||
rightPaneTab,
|
||||
travelTimeEntries
|
||||
travelTimeEntries,
|
||||
share
|
||||
);
|
||||
const search = params.toString();
|
||||
const newUrl = search ? `${window.location.pathname}?${search}` : window.location.pathname;
|
||||
|
|
@ -36,5 +38,13 @@ export function useUrlSync(
|
|||
return () => {
|
||||
if (urlDebounceRef.current) clearTimeout(urlDebounceRef.current);
|
||||
};
|
||||
}, [currentView, filters, features, selectedPOICategories, rightPaneTab, travelTimeEntries]);
|
||||
}, [
|
||||
currentView,
|
||||
filters,
|
||||
features,
|
||||
selectedPOICategories,
|
||||
rightPaneTab,
|
||||
travelTimeEntries,
|
||||
share,
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue