Skip to content

Commit

Permalink
fix: fixed typescript bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jeafreezy committed Oct 30, 2024
1 parent 323d24e commit e294a1e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions frontend/src/components/map/draw-control.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Map } from "maplibre-gl";

// @ts-expect-error bad type definition
const DrawControl = ({ map }: { map: Map | null }) => {
const handleDraw = () => {};

Expand Down
3 changes: 0 additions & 3 deletions frontend/src/components/map/map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ const MapComponent: React.FC<MapComponentProps> = ({
// Update basemap.
useEffect(() => {
if (!map) return;
{
/* @ts-expect-error bad type definition */
}
map.setStyle(MAP_STYLES[selectedBasemap]);
}, [selectedBasemap]);

Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/ui/button/icon-button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ButtonVariant } from "@/types";
import { ButtonSize, ButtonVariant } from "@/types";
import { Button } from "@/components/ui/button";
import { cn } from "@/utils";

Expand All @@ -12,6 +12,7 @@ type ButtonWithIconProps = {
className?: string;
iconClassName?: string;
disabled?: boolean;
size?:ButtonSize
};
const ButtonWithIcon: React.FC<ButtonWithIconProps> = ({
onClick,
Expand All @@ -23,6 +24,7 @@ const ButtonWithIcon: React.FC<ButtonWithIconProps> = ({
className,
iconClassName,
disabled,
size
}) => {
return (
<div role="button">
Expand All @@ -32,6 +34,7 @@ const ButtonWithIcon: React.FC<ButtonWithIconProps> = ({
capitalizeText={capitalizeText}
className={className}
disabled={disabled}
size={size}
>
{PrefixIcon && <PrefixIcon className={cn(`icon ${iconClassName}`)} />}
<p>{label}</p>
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// MAP SETTINGS

import { StyleSpecification } from "maplibre-gl";

// References -
// - https://medium.com/@go2garret/free-basemap-tiles-for-maplibre-18374fab60cb
// - https://codepen.io/g2g/pen/rNRJBZg

export const MAP_STYLES = {
export const MAP_STYLES: Record<string, string | StyleSpecification> = {
OSM: {
version: 8,
sources: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const OrderingFilter: React.FC<OrderingFilterProps> = ({
<CheckboxGroup
options={ORDERING_FIELDS}
disabled={disabled}
// @ts-expect-error bad type definition
onCheck={onSortSelect}
defaultSelectedOption={
ORDERING_FIELDS.find(
Expand Down

0 comments on commit e294a1e

Please sign in to comment.