Skip to content

Commit

Permalink
chore(frontend): format with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
eatyourgreens committed May 24, 2024
1 parent c92e25a commit ccf3213
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 25 deletions.
12 changes: 7 additions & 5 deletions frontend/src/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ const ToolbarLink = styled(Link)({

const ToolbarLinkWithRef = (props, ref) => (
<ToolbarLink component={RouterNavLink} ref={ref} {...props} />
);
const ToolbarNavLink = forwardRef<HTMLAnchorElement, LinkProps & RouterLinkProps>(ToolbarLinkWithRef);
);
const ToolbarNavLink = forwardRef<HTMLAnchorElement, LinkProps & RouterLinkProps>(
ToolbarLinkWithRef,
);

const DrawerLinkWithRef = (props, ref) => (
<DrawerLink component={RouterNavLink} ref={ref} {...props} />
Expand Down Expand Up @@ -94,18 +96,18 @@ const MobileNavContent: FC<{ navItems: NavItemConfig[] }> = ({ navItems }) => {
<MobileDrawer open={drawerOpen} onClose={closeDrawer}>
<Toolbar /> {/* Prevents app bar from concealing content*/}
<List>
<ListItem disablePadding >
<ListItem disablePadding>
<DrawerNavLink to="/" onClick={closeDrawer}>
Home
</DrawerNavLink>
</ListItem>
{navItems.map(({ to, title, tooltip }) => (
<NavTooltip key={to} title={tooltip} placement="right">
<ListItem disablePadding >
<ListItem disablePadding>
<DrawerNavLink to={to} onClick={closeDrawer}>
{title}
</DrawerNavLink>
</ListItem>
</ListItem>
</NavTooltip>
))}
</List>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/lib/data-map/MapContextProviderWithLimits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export const MapContextProviderWithLimits: FC<{

const extendedContext = useMemo(
() => ({
...omit(baseContext, 'viewport'),
viewport: { ...plainViewport, minPitch, maxPitch, minZoom, maxZoom } as any
}),
...omit(baseContext, 'viewport'),
viewport: { ...plainViewport, minPitch, maxPitch, minZoom, maxZoom } as any,
}),
[baseContext, plainViewport, minPitch, maxPitch, minZoom, maxZoom],
);
return <MapContext.Provider value={extendedContext}>{children}</MapContext.Provider>;
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/lib/data-map/interactions/use-interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ export function useInteractions(
const setInteractionGroupHover = useSetInteractionGroupState(hoverState);
const setInteractionGroupSelection = useSetInteractionGroupState(selectionState);

const interactionGroupLookup = useMemo(
() => keyBy(interactionGroups, 'id'),
[interactionGroups],
);
const interactionGroupLookup = useMemo(() => keyBy(interactionGroups, 'id'), [interactionGroups]);

const primaryGroup = interactionGroups[0].id;
const primaryGroupPickingRadius = interactionGroupLookup[primaryGroup].pickingRadius;
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/lib/recoil/grouped-family.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ export function groupedFamily<FVT, FPT>(
(group) =>
({ get }) => {
const groupParams = get(paramsFamily(group));
const deps = fromPairs(
groupParams.map((param) => [param, family(paramFn(group, param))]),
);
const deps = fromPairs(groupParams.map((param) => [param, family(paramFn(group, param))]));
return get(waitForAll(deps));
},
});
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/GuidePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ export const GuidePage = () => (
<p>
On the “Adaptation” page, the second sidebar section contains controls to show drought risk
and drought-related adaptation options. Select for example “Population at risk” to see areas
coloured by risk and &ldquo;Population protected&rdquo; to see points representing approximate locations
of options to reduce the impacts of drought.
coloured by risk and &ldquo;Population protected&rdquo; to see points representing approximate
locations of options to reduce the impacts of drought.
</p>
<p>
<img alt="" src="/guide_media/image21.png" />
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/IntroPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export const IntroPage = () => (
in the Environmental Change Institute, University of Oxford, with the Government of
Jamaica (GoJ), funded by UK Aid through the UK Foreign and Commonwealth Development
Office (FCDO). The initiative forms part of the Coalition for Climate Resilient
Investment&rsquo;s (CCRI) work on &ldquo;Systemic Resilience&rdquo; in collaboration with the
Green Climate Fund.
Investment&rsquo;s (CCRI) work on &ldquo;Systemic Resilience&rdquo; in collaboration
with the Green Climate Fund.
</p>

<Stack
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/state/is-retina.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import { atom } from 'recoil';
interface WindowWithDevicePixelRatio extends Window {
devicePixelRatio: number;
screen: ScreenWithDPR;
};
}

interface ScreenWithDPR extends Screen {
deviceXDPI: number;
logicalXDPI: number;
}


function checkIsRetina() {
// taken from Leaflet source: https://github.com/Leaflet/Leaflet/blob/ee71642691c2c71605bacff69456760cfbc80a2a/src/core/Browser.js#L119
const windowWithDPR = window as unknown as WindowWithDevicePixelRatio;
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/state/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ export const viewStateEffect: StateEffect<string> = ({ set }, view, previousView
const viewSectionsConfig = VIEW_SECTIONS[view];

const previousViewSectionsConfig = VIEW_SECTIONS[previousView];
const removedSections = difference(
keys(previousViewSectionsConfig),
keys(viewSectionsConfig),
);
const removedSections = difference(keys(previousViewSectionsConfig), keys(viewSectionsConfig));

removedSections.forEach((section) => {
set(sectionVisibilityState(section), false);
Expand Down

0 comments on commit ccf3213

Please sign in to comment.