From e161fcf03347e555fc64146a97b26cb777207dfd Mon Sep 17 00:00:00 2001 From: Samuel Therrien Date: Tue, 10 Dec 2024 17:32:42 -0500 Subject: [PATCH 1/7] Proper site type icons --- .vscode/settings.json | 1 + canopeum_backend/canopeum_backend/models.py | 7 -- .../src/assets/icons/site-type-canopeum.svg | 2 +- .../src/assets/icons/site-type-farm-land.svg | 2 +- .../src/assets/icons/x-contact-logo.svg | 2 +- .../src/components/CustomIconBadge.tsx | 18 --- .../analytics/AnalyticsSiteHeader.tsx | 9 +- .../src/components/analytics/ImageUpload.tsx | 8 +- .../components/analytics/SiteCountBadge.tsx | 3 +- .../components/analytics/SiteSummaryCard.tsx | 8 +- .../src/components/icons/CustomIcon.tsx | 18 ++- .../src/components/{ => icons}/IconBadge.tsx | 14 +-- .../src/components/icons/SiteTypeIcon.tsx | 36 ++++++ .../{assets => icons}/SiteTypePin.tsx | 3 +- .../src/components/icons/customIconList.ts | 15 --- .../src/components/settings/AdminCard.tsx | 6 +- .../components/social/SiteSocialHeader.tsx | 8 +- canopeum_frontend/src/models/SiteType.ts | 30 +---- canopeum_frontend/src/pages/MapPage.tsx | 10 +- canopeum_frontend/src/pages/Utilities.tsx | 107 +++++++++--------- 20 files changed, 152 insertions(+), 155 deletions(-) delete mode 100644 canopeum_frontend/src/components/CustomIconBadge.tsx rename canopeum_frontend/src/components/{ => icons}/IconBadge.tsx (52%) create mode 100644 canopeum_frontend/src/components/icons/SiteTypeIcon.tsx rename canopeum_frontend/src/components/{assets => icons}/SiteTypePin.tsx (90%) delete mode 100644 canopeum_frontend/src/components/icons/customIconList.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index 514138961..48b4fbc09 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -116,6 +116,7 @@ "!unused-imports/no-unused-imports", "!autofix/no-debugger", "!autofix/no-unused-vars", + "!@eslint-community/eslint-comments/no-unused-disable", "*" ], "eslint.rules.customizations": [ diff --git a/canopeum_backend/canopeum_backend/models.py b/canopeum_backend/canopeum_backend/models.py index 67e3e13e9..787f86827 100644 --- a/canopeum_backend/canopeum_backend/models.py +++ b/canopeum_backend/canopeum_backend/models.py @@ -138,13 +138,6 @@ class Internationalization(models.Model): class Sitetype(models.Model): name = models.ForeignKey(Internationalization, models.DO_NOTHING, blank=True, null=True) - @override - def delete(self, using=None, keep_parents=False): - # TODO: FIXME, should Sitetype subclass Asset - # or should it have a foreignkey asset like PostAsset??? - self.asset.delete() # type:ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue] - return super().delete(using, keep_parents) - class Site(models.Model): name = models.TextField() diff --git a/canopeum_frontend/src/assets/icons/site-type-canopeum.svg b/canopeum_frontend/src/assets/icons/site-type-canopeum.svg index 0040974fa..4d7dd09d9 100644 --- a/canopeum_frontend/src/assets/icons/site-type-canopeum.svg +++ b/canopeum_frontend/src/assets/icons/site-type-canopeum.svg @@ -1,3 +1,3 @@ - + diff --git a/canopeum_frontend/src/assets/icons/site-type-farm-land.svg b/canopeum_frontend/src/assets/icons/site-type-farm-land.svg index 299220400..e5823609e 100644 --- a/canopeum_frontend/src/assets/icons/site-type-farm-land.svg +++ b/canopeum_frontend/src/assets/icons/site-type-farm-land.svg @@ -1,3 +1,3 @@ - + diff --git a/canopeum_frontend/src/assets/icons/x-contact-logo.svg b/canopeum_frontend/src/assets/icons/x-contact-logo.svg index 813a43336..9f0597392 100644 --- a/canopeum_frontend/src/assets/icons/x-contact-logo.svg +++ b/canopeum_frontend/src/assets/icons/x-contact-logo.svg @@ -12,7 +12,7 @@ stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" -àstroke-dashoffset="0" +stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" diff --git a/canopeum_frontend/src/components/CustomIconBadge.tsx b/canopeum_frontend/src/components/CustomIconBadge.tsx deleted file mode 100644 index 9946e8412..000000000 --- a/canopeum_frontend/src/components/CustomIconBadge.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import CustomIcon, { type IconSize } from '@components/icons/CustomIcon' -import type { CustomIconType } from '@components/icons/customIconList' - -type Props = { - readonly icon: CustomIconType, - readonly size?: IconSize, -} - -const CustomIconBadge = ({ icon, size }: Props) => ( -
- -
-) - -export default CustomIconBadge diff --git a/canopeum_frontend/src/components/analytics/AnalyticsSiteHeader.tsx b/canopeum_frontend/src/components/analytics/AnalyticsSiteHeader.tsx index c9c63c895..9a9894094 100644 --- a/canopeum_frontend/src/components/analytics/AnalyticsSiteHeader.tsx +++ b/canopeum_frontend/src/components/analytics/AnalyticsSiteHeader.tsx @@ -6,10 +6,10 @@ import { useTranslation } from 'react-i18next' import SiteCountBadge from '@components/analytics/SiteCountBadge' import SiteSponsorProgress from '@components/analytics/SiteSponsorProgress' import { LanguageContext } from '@components/context/LanguageContext' -import IconBadge from '@components/IconBadge' +import IconBadge from '@components/icons/IconBadge' +import SiteTypeIcon from '@components/icons/SiteTypeIcon' import SiteHeaderSponsors from '@components/SiteHeaderSponsors' import { getImageNameByWMOCategories } from '@constants/weatherImageMap' -import { getSiteTypeIconKey } from '@models/SiteType' import type { SiteSummaryDetail } from '@services/api' type Props = { @@ -55,8 +55,9 @@ const AnalyticsSiteHeader = ({ siteSummary }: Props) => {

{siteSummary.name}

- - {/* */} + + +

{translateValue(siteSummary.siteType)}

diff --git a/canopeum_frontend/src/components/analytics/ImageUpload.tsx b/canopeum_frontend/src/components/analytics/ImageUpload.tsx index 7262ce627..e6625b8f8 100644 --- a/canopeum_frontend/src/components/analytics/ImageUpload.tsx +++ b/canopeum_frontend/src/components/analytics/ImageUpload.tsx @@ -4,7 +4,7 @@ import './ImageUpload.scss' import type { ChangeEvent, DragEvent } from 'react' import { useTranslation } from 'react-i18next' -import UploadIcon from '@assets/icons/upload.svg' +import IconBadge from '@components/icons/IconBadge' type Props = { readonly id: string, @@ -52,7 +52,11 @@ const ImageUpload = ({ id, onChange, imageUrl }: Props) => { backgroundPosition: 'center', }} > - + + + arrow_upward + +
{t('generic.upload')}
{t('analytics.image-upload')}
diff --git a/canopeum_frontend/src/components/analytics/SiteCountBadge.tsx b/canopeum_frontend/src/components/analytics/SiteCountBadge.tsx index 0c215df2d..749bae9cb 100644 --- a/canopeum_frontend/src/components/analytics/SiteCountBadge.tsx +++ b/canopeum_frontend/src/components/analytics/SiteCountBadge.tsx @@ -1,5 +1,4 @@ -import CustomIcon, { type IconSize } from '@components/icons/CustomIcon' -import type { CustomIconType } from '@components/icons/customIconList' +import CustomIcon, { type CustomIconType, type IconSize } from '@components/icons/CustomIcon' type Props = { readonly icon: CustomIconType, diff --git a/canopeum_frontend/src/components/analytics/SiteSummaryCard.tsx b/canopeum_frontend/src/components/analytics/SiteSummaryCard.tsx index ff7e4edb6..4b820120d 100644 --- a/canopeum_frontend/src/components/analytics/SiteSummaryCard.tsx +++ b/canopeum_frontend/src/components/analytics/SiteSummaryCard.tsx @@ -5,10 +5,10 @@ import { Link } from 'react-router-dom' import SiteSponsorProgress from '@components/analytics/SiteSponsorProgress' import SiteSummaryActions from '@components/analytics/SiteSummaryActions' import { AuthenticationContext } from '@components/context/AuthenticationContext' -import IconBadge from '@components/IconBadge' import CustomIcon from '@components/icons/CustomIcon' +import IconBadge from '@components/icons/IconBadge' +import SiteTypeIcon from '@components/icons/SiteTypeIcon' import { appRoutes } from '@constants/routes.constant' -import { getSiteTypeIconKey } from '@models/SiteType' import type { SiteSummary, User } from '@services/api' type Props = { @@ -40,7 +40,9 @@ const SiteSummaryCard = ({ site, admins, onSiteChange, onSiteEdit }: Props) => { style={{ width: 'calc(100% - 2em)' }} to={appRoutes.site(site.id)} > - + + +
{site.name}
diff --git a/canopeum_frontend/src/components/icons/CustomIcon.tsx b/canopeum_frontend/src/components/icons/CustomIcon.tsx index 1a283eff4..745aa81f4 100644 --- a/canopeum_frontend/src/components/icons/CustomIcon.tsx +++ b/canopeum_frontend/src/components/icons/CustomIcon.tsx @@ -1,4 +1,20 @@ -import { customIcons, type CustomIconType } from './customIconList' +import sitePlantedIcon from '@assets/icons/site-planted.svg' +import sitePropagationIcon from '@assets/icons/site-propagation.svg' +import siteSurvivedIcon from '@assets/icons/site-survived.svg' +import siteTypeCanopeumIcon from '@assets/icons/site-type-canopeum.svg' +import siteTypeFarmLand from '@assets/icons/site-type-farm-land.svg' +import siteVisitorsIcon from '@assets/icons/site-visitors.svg' + +const customIcons = { + sitePlantedIcon, + sitePropagationIcon, + siteSurvivedIcon, + siteTypeCanopeumIcon, + siteTypeFarmLand, + siteVisitorsIcon, +} + +export type CustomIconType = keyof typeof customIcons // These sizes match the custom icon scss sizes determined in App.scss export type IconSize = diff --git a/canopeum_frontend/src/components/IconBadge.tsx b/canopeum_frontend/src/components/icons/IconBadge.tsx similarity index 52% rename from canopeum_frontend/src/components/IconBadge.tsx rename to canopeum_frontend/src/components/icons/IconBadge.tsx index 105e2a04c..aa20e3877 100644 --- a/canopeum_frontend/src/components/IconBadge.tsx +++ b/canopeum_frontend/src/components/icons/IconBadge.tsx @@ -1,9 +1,7 @@ -import type { MaterialIcon } from 'material-icons' - -import type { SiteTypeIconKey } from '@models/SiteType' +import type { ReactNode } from 'react' type Props = { - readonly iconKey: MaterialIcon | SiteTypeIconKey, + readonly children: ReactNode, readonly bgColor?: string, } @@ -15,14 +13,10 @@ const IconBadge = (props: Props) => { return (
- - {props.iconKey} - + {props.children}
) } diff --git a/canopeum_frontend/src/components/icons/SiteTypeIcon.tsx b/canopeum_frontend/src/components/icons/SiteTypeIcon.tsx new file mode 100644 index 000000000..3d9b2f344 --- /dev/null +++ b/canopeum_frontend/src/components/icons/SiteTypeIcon.tsx @@ -0,0 +1,36 @@ +import type { JSX } from 'react' + +import siteTypeCanopeum from '@assets/icons/site-type-canopeum.svg?raw' +import siteTypeFarmLand from '@assets/icons/site-type-farm-land.svg?raw' + +const iconMapping: Record = { + // eslint-disable-next-line react/no-danger -- loading our own svg + 1: , + 2: ( + + forest + + ), + 3: ( + + workspaces + + ), + 4: ( + + school + + ), + // eslint-disable-next-line react/no-danger -- loading our own svg + 5: , + 6: ( + + source_environment + + ), +} + +type Props = { siteTypeId: number } + +const SiteTypeIcon = ({ siteTypeId }: Props) => iconMapping[siteTypeId] +export default SiteTypeIcon diff --git a/canopeum_frontend/src/components/assets/SiteTypePin.tsx b/canopeum_frontend/src/components/icons/SiteTypePin.tsx similarity index 90% rename from canopeum_frontend/src/components/assets/SiteTypePin.tsx rename to canopeum_frontend/src/components/icons/SiteTypePin.tsx index 138e3b91a..72d550600 100644 --- a/canopeum_frontend/src/components/assets/SiteTypePin.tsx +++ b/canopeum_frontend/src/components/icons/SiteTypePin.tsx @@ -6,9 +6,8 @@ import EducationalFacilityPin from '@assets/icons/pins/educational-facility-pin. import FarmsLandPin from '@assets/icons/pins/farms-land-pin.svg' import IndegeniousCommunityPin from '@assets/icons/pins/indegenious-community-pin.svg' import ParkPin from '@assets/icons/pins/park-pin.svg' -import type { SiteTypeID } from '@models/SiteType' -const pinMap: Record = { +const pinMap: Record = { 1: CanopeumPin, 2: ParkPin, 3: IndegeniousCommunityPin, diff --git a/canopeum_frontend/src/components/icons/customIconList.ts b/canopeum_frontend/src/components/icons/customIconList.ts deleted file mode 100644 index 8fd36fb68..000000000 --- a/canopeum_frontend/src/components/icons/customIconList.ts +++ /dev/null @@ -1,15 +0,0 @@ -import sitePlantedIcon from '@assets/icons/site-planted.svg' -import sitePropagationIcon from '@assets/icons/site-propagation.svg' -import siteSurvivedIcon from '@assets/icons/site-survived.svg' -import siteTypeCanopeumIcon from '@assets/icons/site-type-canopeum.svg' -import siteVisitorsIcon from '@assets/icons/site-visitors.svg' - -export const customIcons = { - sitePlantedIcon, - siteSurvivedIcon, - sitePropagationIcon, - siteVisitorsIcon, - siteTypeCanopeumIcon, -} - -export type CustomIconType = keyof typeof customIcons diff --git a/canopeum_frontend/src/components/settings/AdminCard.tsx b/canopeum_frontend/src/components/settings/AdminCard.tsx index ff62f2930..2d306ed13 100644 --- a/canopeum_frontend/src/components/settings/AdminCard.tsx +++ b/canopeum_frontend/src/components/settings/AdminCard.tsx @@ -1,4 +1,4 @@ -import { getSiteTypeIconKey } from '@models/SiteType' +import SiteTypeIcon from '@components/icons/SiteTypeIcon' import type { SiteAdmins } from '@services/api' type Props = { @@ -20,9 +20,7 @@ const AdminCard = ({ admin }: Props) => (
{admin.sites.map(site => (
- - {getSiteTypeIconKey(site.siteType ?? 0)} - + {site.name}
))} diff --git a/canopeum_frontend/src/components/social/SiteSocialHeader.tsx b/canopeum_frontend/src/components/social/SiteSocialHeader.tsx index aa078d585..1159092c6 100644 --- a/canopeum_frontend/src/components/social/SiteSocialHeader.tsx +++ b/canopeum_frontend/src/components/social/SiteSocialHeader.tsx @@ -6,13 +6,13 @@ import { Link } from 'react-router-dom' import { AuthenticationContext } from '@components/context/AuthenticationContext' import { LanguageContext } from '@components/context/LanguageContext' -import IconBadge from '@components/IconBadge' +import IconBadge from '@components/icons/IconBadge' +import SiteTypeIcon from '@components/icons/SiteTypeIcon' import ToggleSwitch from '@components/inputs/ToggleSwitch' import SiteHeaderSponsors from '@components/SiteHeaderSponsors' import { appRoutes } from '@constants/routes.constant' import useApiClient from '@hooks/ApiClientHook' import type { PageViewMode } from '@models/PageViewMode.type' -import { getSiteTypeIconKey } from '@models/SiteType' import { PatchedUpdateSitePublicStatus, type SiteSocial, User } from '@services/api' import { getApiBaseUrl } from '@services/apiSettings' import type { ExcludeFunctions } from '@utils/types' @@ -127,7 +127,9 @@ const SiteSocialHeader = ({ site, viewMode }: Props) => {
- + + +

{translateValue(site.siteType)}

diff --git a/canopeum_frontend/src/models/SiteType.ts b/canopeum_frontend/src/models/SiteType.ts index 734010435..3006487a8 100644 --- a/canopeum_frontend/src/models/SiteType.ts +++ b/canopeum_frontend/src/models/SiteType.ts @@ -1,24 +1,6 @@ -// This mapping MUST MATCH site_type_names in -// canopeum_backend/canopeum_backend/management/commands/initialize_database.py -const SITE_TYPE_ID_TO_ICON_KEY = { - 1: 'eco', // Canopeum // TODO: Update to proper icon - 2: 'forest', // Parks - 3: 'workspaces', // Indigenous community - 4: 'school', // Educational Facility - 5: 'psychiatry', // Farms Land // TODO: Update to proper icon - 6: 'source_environment', // Corporate Lot -} as const -export const getSiteTypeIconKey = (siteTypeId: number): SiteTypeIconKey => { - const iconKey = SITE_TYPE_ID_TO_ICON_KEY[siteTypeId as SiteTypeID] - /* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - -- Additional runtime safety */ - if (!iconKey) { - throw new RangeError(`${siteTypeId} is not a known site type ID`) - } - - return iconKey -} -export type SiteTypeID = keyof typeof SITE_TYPE_ID_TO_ICON_KEY -export type SiteTypeIconKey = typeof SITE_TYPE_ID_TO_ICON_KEY[SiteTypeID] -export const SITE_TYPE_ICON_KEYS = Object.values(SITE_TYPE_ID_TO_ICON_KEY) -export const SITE_TYPE_IDS = Object.keys(SITE_TYPE_ID_TO_ICON_KEY).map(Number) as SiteTypeID[] +// TODO: Get this from a backend call +/* eslint-disable-next-line @typescript-eslint/no-magic-numbers -- +This array MUST MATCH site_type_names in +canopeum_backend/canopeum_backend/management/commands/initialize_database.py +*/ +export const SITE_TYPE_IDS = [1, 2, 3, 4, 5, 6] as const diff --git a/canopeum_frontend/src/pages/MapPage.tsx b/canopeum_frontend/src/pages/MapPage.tsx index 50c3d8d82..8977304f7 100644 --- a/canopeum_frontend/src/pages/MapPage.tsx +++ b/canopeum_frontend/src/pages/MapPage.tsx @@ -7,10 +7,10 @@ import type { MarkerEvent } from 'react-map-gl/dist/esm/types' import ReactMap, { GeolocateControl, Marker, NavigationControl, ScaleControl, type ViewState } from 'react-map-gl/maplibre' import { Link, useSearchParams } from 'react-router-dom' -import SiteTypePin from '@components/assets/SiteTypePin' +import SiteTypeIcon from '@components/icons/SiteTypeIcon' +import SiteTypePin from '@components/icons/SiteTypePin' import { appRoutes } from '@constants/routes.constant' import useApiClient from '@hooks/ApiClientHook' -import { getSiteTypeIconKey, type SiteTypeID } from '@models/SiteType' import type { SiteMap } from '@services/api' import { getApiBaseUrl } from '@services/apiSettings' @@ -172,7 +172,7 @@ const MapPage = () => { onClick={event => onSelectSite(site, event)} style={{ cursor: 'pointer' }} > - + ) }).filter(Boolean)} @@ -211,9 +211,7 @@ const MapPage = () => {
{site.name}
- - {getSiteTypeIconKey(site.siteType.id)} - + {site.siteType.en}
diff --git a/canopeum_frontend/src/pages/Utilities.tsx b/canopeum_frontend/src/pages/Utilities.tsx index 144da0096..a5676b94c 100644 --- a/canopeum_frontend/src/pages/Utilities.tsx +++ b/canopeum_frontend/src/pages/Utilities.tsx @@ -1,72 +1,77 @@ /* eslint-disable max-lines -- We don't want to split this file as it is a dev page */ // Listing all available components for the application -import facebookLogo from '@assets/icons/facebook-regular.svg' import canopeumLogo from '@assets/images/Canopeum_Logo.jpg' -import IconBadge from '@components/IconBadge' -import { getSiteTypeIconKey, SITE_TYPE_IDS } from '@models/SiteType' +import IconBadge from '@components/icons/IconBadge' +import SiteTypeIcon from '@components/icons/SiteTypeIcon' +import { SITE_TYPE_IDS } from '@models/SiteType' const Utilities = () => (
-

Utilities

+

Utilities

Icons

- home - home - donut_small - donut_small - pin_drop - pin_drop - account_circle - account_circle - sms - sms - mood - mood - add_a_photo - add_a_photo - smart_display - smart_display - home_work - home_work - mail - mail - perm_phone_msg - perm_phone_msg - edit_square - edit_square - add - add - cancel - cancel - location_on - location_on - person - person - iconHome +
+ home + home + donut_small + donut_small + pin_drop + pin_drop + account_circle + account_circle + sms + sms + mood + mood + add_a_photo + add_a_photo + smart_display + smart_display + home_work + home_work + mail + mail + perm_phone_msg + perm_phone_msg + edit_square + edit_square + add + add + cancel + cancel + location_on + location_on + person + person +

Site Type Icons

- {SITE_TYPE_IDS.map(siteTypeId => { - const key = getSiteTypeIconKey(siteTypeId) - - return ( +
+ {SITE_TYPE_IDS.map(siteTypeId => ( <> - {key} - {key} - {key} + + + + - ) - })} + ))} +

Badges

- {SITE_TYPE_IDS.map(siteTypeId => { - const key = getSiteTypeIconKey(siteTypeId) - - return - })} + {SITE_TYPE_IDS.map(siteTypeId => ( + + + + ))} + + + arrow_upward + +
From 37863b29c4a2e2318bb2e43fc3f1468986dbabec Mon Sep 17 00:00:00 2001 From: Samuel Therrien Date: Tue, 10 Dec 2024 17:32:51 -0500 Subject: [PATCH 2/7] Removed unused icons --- .../src/assets/icons/add-tree-regular.svg | 3 --- .../src/assets/icons/canopeum-regular.svg | 9 --------- .../src/assets/icons/facebook-regular.svg | 10 ---------- .../icons/indegenious-community-regular.svg | 8 -------- .../src/assets/icons/instagram-regular.svg | 3 --- .../src/assets/icons/leaf-regular.svg | 8 -------- .../src/assets/icons/linkedin.svg | 3 --- .../src/assets/icons/plant-regular.svg | 3 --- .../src/assets/icons/tree-regular.svg | 3 --- .../src/assets/icons/trees-regular.svg | 8 -------- .../src/assets/icons/twitter-regular.svg | 3 --- canopeum_frontend/src/assets/icons/upload.svg | 18 ------------------ 12 files changed, 79 deletions(-) delete mode 100644 canopeum_frontend/src/assets/icons/add-tree-regular.svg delete mode 100644 canopeum_frontend/src/assets/icons/canopeum-regular.svg delete mode 100644 canopeum_frontend/src/assets/icons/facebook-regular.svg delete mode 100644 canopeum_frontend/src/assets/icons/indegenious-community-regular.svg delete mode 100644 canopeum_frontend/src/assets/icons/instagram-regular.svg delete mode 100644 canopeum_frontend/src/assets/icons/leaf-regular.svg delete mode 100644 canopeum_frontend/src/assets/icons/linkedin.svg delete mode 100644 canopeum_frontend/src/assets/icons/plant-regular.svg delete mode 100644 canopeum_frontend/src/assets/icons/tree-regular.svg delete mode 100644 canopeum_frontend/src/assets/icons/trees-regular.svg delete mode 100644 canopeum_frontend/src/assets/icons/twitter-regular.svg delete mode 100644 canopeum_frontend/src/assets/icons/upload.svg diff --git a/canopeum_frontend/src/assets/icons/add-tree-regular.svg b/canopeum_frontend/src/assets/icons/add-tree-regular.svg deleted file mode 100644 index 6cce73496..000000000 --- a/canopeum_frontend/src/assets/icons/add-tree-regular.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/canopeum_frontend/src/assets/icons/canopeum-regular.svg b/canopeum_frontend/src/assets/icons/canopeum-regular.svg deleted file mode 100644 index ebf9cf9f8..000000000 --- a/canopeum_frontend/src/assets/icons/canopeum-regular.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/canopeum_frontend/src/assets/icons/facebook-regular.svg b/canopeum_frontend/src/assets/icons/facebook-regular.svg deleted file mode 100644 index df9b2a9d8..000000000 --- a/canopeum_frontend/src/assets/icons/facebook-regular.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/canopeum_frontend/src/assets/icons/indegenious-community-regular.svg b/canopeum_frontend/src/assets/icons/indegenious-community-regular.svg deleted file mode 100644 index 885075215..000000000 --- a/canopeum_frontend/src/assets/icons/indegenious-community-regular.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/canopeum_frontend/src/assets/icons/instagram-regular.svg b/canopeum_frontend/src/assets/icons/instagram-regular.svg deleted file mode 100644 index b98a6b861..000000000 --- a/canopeum_frontend/src/assets/icons/instagram-regular.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/canopeum_frontend/src/assets/icons/leaf-regular.svg b/canopeum_frontend/src/assets/icons/leaf-regular.svg deleted file mode 100644 index e9df13534..000000000 --- a/canopeum_frontend/src/assets/icons/leaf-regular.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/canopeum_frontend/src/assets/icons/linkedin.svg b/canopeum_frontend/src/assets/icons/linkedin.svg deleted file mode 100644 index 925257cbf..000000000 --- a/canopeum_frontend/src/assets/icons/linkedin.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/canopeum_frontend/src/assets/icons/plant-regular.svg b/canopeum_frontend/src/assets/icons/plant-regular.svg deleted file mode 100644 index 32bc79b8a..000000000 --- a/canopeum_frontend/src/assets/icons/plant-regular.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/canopeum_frontend/src/assets/icons/tree-regular.svg b/canopeum_frontend/src/assets/icons/tree-regular.svg deleted file mode 100644 index 0418420bf..000000000 --- a/canopeum_frontend/src/assets/icons/tree-regular.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/canopeum_frontend/src/assets/icons/trees-regular.svg b/canopeum_frontend/src/assets/icons/trees-regular.svg deleted file mode 100644 index 0b84f785c..000000000 --- a/canopeum_frontend/src/assets/icons/trees-regular.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/canopeum_frontend/src/assets/icons/twitter-regular.svg b/canopeum_frontend/src/assets/icons/twitter-regular.svg deleted file mode 100644 index 6a3807ae9..000000000 --- a/canopeum_frontend/src/assets/icons/twitter-regular.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/canopeum_frontend/src/assets/icons/upload.svg b/canopeum_frontend/src/assets/icons/upload.svg deleted file mode 100644 index 82bdaf9ee..000000000 --- a/canopeum_frontend/src/assets/icons/upload.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - From 965b1c827b3c961e0d11b57be1efc3ce221bf895 Mon Sep 17 00:00:00 2001 From: Samuel Therrien Date: Tue, 10 Dec 2024 17:40:52 -0500 Subject: [PATCH 3/7] Minify and format all non-map svg --- .../assets/icons/facebook-contact-logo.svg | 26 +++-------------- .../assets/icons/instagram-contact-logo.svg | 27 +++--------------- .../assets/icons/linkedin-contact-logo.svg | 28 +++---------------- .../src/assets/icons/site-planted.svg | 6 ++-- .../src/assets/icons/site-propagation.svg | 6 ++-- .../src/assets/icons/site-survived.svg | 6 ++-- .../src/assets/icons/site-type-canopeum.svg | 6 ++-- .../src/assets/icons/site-type-farm-land.svg | 6 ++-- .../src/assets/icons/site-visitors.svg | 16 ++++++----- .../src/assets/icons/x-contact-logo.svg | 25 +++-------------- 10 files changed, 45 insertions(+), 107 deletions(-) diff --git a/canopeum_frontend/src/assets/icons/facebook-contact-logo.svg b/canopeum_frontend/src/assets/icons/facebook-contact-logo.svg index 8faee2109..474762b70 100644 --- a/canopeum_frontend/src/assets/icons/facebook-contact-logo.svg +++ b/canopeum_frontend/src/assets/icons/facebook-contact-logo.svg @@ -1,23 +1,5 @@ - - - + + diff --git a/canopeum_frontend/src/assets/icons/instagram-contact-logo.svg b/canopeum_frontend/src/assets/icons/instagram-contact-logo.svg index b18426da6..1408f97e2 100644 --- a/canopeum_frontend/src/assets/icons/instagram-contact-logo.svg +++ b/canopeum_frontend/src/assets/icons/instagram-contact-logo.svg @@ -1,24 +1,5 @@ - - - - + + diff --git a/canopeum_frontend/src/assets/icons/linkedin-contact-logo.svg b/canopeum_frontend/src/assets/icons/linkedin-contact-logo.svg index 82cf25602..ea58f6dc0 100644 --- a/canopeum_frontend/src/assets/icons/linkedin-contact-logo.svg +++ b/canopeum_frontend/src/assets/icons/linkedin-contact-logo.svg @@ -1,25 +1,5 @@ - - - - + + diff --git a/canopeum_frontend/src/assets/icons/site-planted.svg b/canopeum_frontend/src/assets/icons/site-planted.svg index 44c390b52..6355332ae 100644 --- a/canopeum_frontend/src/assets/icons/site-planted.svg +++ b/canopeum_frontend/src/assets/icons/site-planted.svg @@ -1,3 +1,5 @@ - - + + diff --git a/canopeum_frontend/src/assets/icons/site-propagation.svg b/canopeum_frontend/src/assets/icons/site-propagation.svg index 8d890e42f..8af15043d 100644 --- a/canopeum_frontend/src/assets/icons/site-propagation.svg +++ b/canopeum_frontend/src/assets/icons/site-propagation.svg @@ -1,3 +1,5 @@ - - + + diff --git a/canopeum_frontend/src/assets/icons/site-survived.svg b/canopeum_frontend/src/assets/icons/site-survived.svg index 2f80babe2..5e9f166f3 100644 --- a/canopeum_frontend/src/assets/icons/site-survived.svg +++ b/canopeum_frontend/src/assets/icons/site-survived.svg @@ -1,3 +1,5 @@ - - + + diff --git a/canopeum_frontend/src/assets/icons/site-type-canopeum.svg b/canopeum_frontend/src/assets/icons/site-type-canopeum.svg index 4d7dd09d9..0cf781909 100644 --- a/canopeum_frontend/src/assets/icons/site-type-canopeum.svg +++ b/canopeum_frontend/src/assets/icons/site-type-canopeum.svg @@ -1,3 +1,5 @@ - - + + diff --git a/canopeum_frontend/src/assets/icons/site-type-farm-land.svg b/canopeum_frontend/src/assets/icons/site-type-farm-land.svg index e5823609e..b3541af0d 100644 --- a/canopeum_frontend/src/assets/icons/site-type-farm-land.svg +++ b/canopeum_frontend/src/assets/icons/site-type-farm-land.svg @@ -1,3 +1,5 @@ - - + + diff --git a/canopeum_frontend/src/assets/icons/site-visitors.svg b/canopeum_frontend/src/assets/icons/site-visitors.svg index cc2240eb7..66726e1c8 100644 --- a/canopeum_frontend/src/assets/icons/site-visitors.svg +++ b/canopeum_frontend/src/assets/icons/site-visitors.svg @@ -1,8 +1,10 @@ - - - - - - - + + + + + + + diff --git a/canopeum_frontend/src/assets/icons/x-contact-logo.svg b/canopeum_frontend/src/assets/icons/x-contact-logo.svg index 9f0597392..896319e88 100644 --- a/canopeum_frontend/src/assets/icons/x-contact-logo.svg +++ b/canopeum_frontend/src/assets/icons/x-contact-logo.svg @@ -1,22 +1,5 @@ - - - + + From 1a45b96e7fd1952c4a9eccb9061b0a95284e16c4 Mon Sep 17 00:00:00 2001 From: Samuel Therrien Date: Tue, 10 Dec 2024 18:29:24 -0500 Subject: [PATCH 4/7] Generic map icons --- .../src/assets/icons/map-pin.svg | 20 +++++++++++ .../src/assets/icons/pins/canopeum-pin.svg | 27 --------------- .../assets/icons/pins/corporate-lot-pin.svg | 28 ---------------- .../icons/pins/educational-facility-pin.svg | 28 ---------------- .../src/assets/icons/pins/farms-land-pin.svg | 33 ------------------- .../icons/pins/indegenious-community-pin.svg | 28 ---------------- .../src/assets/icons/pins/park-pin.svg | 28 ---------------- .../src/assets/styles/GlobalStyles.scss | 4 +++ .../src/components/icons/MapPinIcon.scss | 18 ++++++++++ .../src/components/icons/MapPinIcon.tsx | 16 +++++++++ .../src/components/icons/SiteTypePin.tsx | 22 ------------- canopeum_frontend/src/pages/MapPage.tsx | 11 +++++-- 12 files changed, 66 insertions(+), 197 deletions(-) create mode 100644 canopeum_frontend/src/assets/icons/map-pin.svg delete mode 100644 canopeum_frontend/src/assets/icons/pins/canopeum-pin.svg delete mode 100644 canopeum_frontend/src/assets/icons/pins/corporate-lot-pin.svg delete mode 100644 canopeum_frontend/src/assets/icons/pins/educational-facility-pin.svg delete mode 100644 canopeum_frontend/src/assets/icons/pins/farms-land-pin.svg delete mode 100644 canopeum_frontend/src/assets/icons/pins/indegenious-community-pin.svg delete mode 100644 canopeum_frontend/src/assets/icons/pins/park-pin.svg create mode 100644 canopeum_frontend/src/components/icons/MapPinIcon.scss create mode 100644 canopeum_frontend/src/components/icons/MapPinIcon.tsx delete mode 100644 canopeum_frontend/src/components/icons/SiteTypePin.tsx diff --git a/canopeum_frontend/src/assets/icons/map-pin.svg b/canopeum_frontend/src/assets/icons/map-pin.svg new file mode 100644 index 000000000..fae3c9dcf --- /dev/null +++ b/canopeum_frontend/src/assets/icons/map-pin.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + diff --git a/canopeum_frontend/src/assets/icons/pins/canopeum-pin.svg b/canopeum_frontend/src/assets/icons/pins/canopeum-pin.svg deleted file mode 100644 index 533ba486a..000000000 --- a/canopeum_frontend/src/assets/icons/pins/canopeum-pin.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/canopeum_frontend/src/assets/icons/pins/corporate-lot-pin.svg b/canopeum_frontend/src/assets/icons/pins/corporate-lot-pin.svg deleted file mode 100644 index 5a1bfab82..000000000 --- a/canopeum_frontend/src/assets/icons/pins/corporate-lot-pin.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/canopeum_frontend/src/assets/icons/pins/educational-facility-pin.svg b/canopeum_frontend/src/assets/icons/pins/educational-facility-pin.svg deleted file mode 100644 index b625b22e7..000000000 --- a/canopeum_frontend/src/assets/icons/pins/educational-facility-pin.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/canopeum_frontend/src/assets/icons/pins/farms-land-pin.svg b/canopeum_frontend/src/assets/icons/pins/farms-land-pin.svg deleted file mode 100644 index ce2982acd..000000000 --- a/canopeum_frontend/src/assets/icons/pins/farms-land-pin.svg +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/canopeum_frontend/src/assets/icons/pins/indegenious-community-pin.svg b/canopeum_frontend/src/assets/icons/pins/indegenious-community-pin.svg deleted file mode 100644 index 3cfd7b1f2..000000000 --- a/canopeum_frontend/src/assets/icons/pins/indegenious-community-pin.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/canopeum_frontend/src/assets/icons/pins/park-pin.svg b/canopeum_frontend/src/assets/icons/pins/park-pin.svg deleted file mode 100644 index c9fff8c2f..000000000 --- a/canopeum_frontend/src/assets/icons/pins/park-pin.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/canopeum_frontend/src/assets/styles/GlobalStyles.scss b/canopeum_frontend/src/assets/styles/GlobalStyles.scss index 4090b8701..635221a3d 100644 --- a/canopeum_frontend/src/assets/styles/GlobalStyles.scss +++ b/canopeum_frontend/src/assets/styles/GlobalStyles.scss @@ -80,3 +80,7 @@ body { padding: 1rem 6rem; } } + +.maplibregl-marker { + cursor: pointer; +} diff --git a/canopeum_frontend/src/components/icons/MapPinIcon.scss b/canopeum_frontend/src/components/icons/MapPinIcon.scss new file mode 100644 index 000000000..85abc0fb1 --- /dev/null +++ b/canopeum_frontend/src/components/icons/MapPinIcon.scss @@ -0,0 +1,18 @@ +.map-pin-icon > :not(.map-pin-icon-background) { + position: absolute; + bottom: 0; + left: 0; + transform: translate(-50%, -80%); + .material-symbols-outlined { + // Material icons look too big compared to custom icons, + // it may be this is better handled by changing default icon weigh globally, + // or thickening the custom site icons + font-weight: 300; + } +} +.map-pin-icon-background { + position: absolute; + bottom: 0; + left: 0; + transform: translate(-50%, 0); +} diff --git a/canopeum_frontend/src/components/icons/MapPinIcon.tsx b/canopeum_frontend/src/components/icons/MapPinIcon.tsx new file mode 100644 index 000000000..dfdb9f541 --- /dev/null +++ b/canopeum_frontend/src/components/icons/MapPinIcon.tsx @@ -0,0 +1,16 @@ +import './MapPinIcon.scss' + +import type { PropsWithChildren } from 'react' + +import mapPinIconRaw from '@assets/icons/map-pin.svg?raw' + +const MapPinIcon = (props: PropsWithChildren & { readonly themeColor: string }) => ( +
+ + {props.children} +
+) +export default MapPinIcon diff --git a/canopeum_frontend/src/components/icons/SiteTypePin.tsx b/canopeum_frontend/src/components/icons/SiteTypePin.tsx deleted file mode 100644 index 72d550600..000000000 --- a/canopeum_frontend/src/components/icons/SiteTypePin.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import type { JSX } from 'react' - -import CanopeumPin from '@assets/icons/pins/canopeum-pin.svg' -import CorporateLotPin from '@assets/icons/pins/corporate-lot-pin.svg' -import EducationalFacilityPin from '@assets/icons/pins/educational-facility-pin.svg' -import FarmsLandPin from '@assets/icons/pins/farms-land-pin.svg' -import IndegeniousCommunityPin from '@assets/icons/pins/indegenious-community-pin.svg' -import ParkPin from '@assets/icons/pins/park-pin.svg' - -const pinMap: Record = { - 1: CanopeumPin, - 2: ParkPin, - 3: IndegeniousCommunityPin, - 4: EducationalFacilityPin, - 5: FarmsLandPin, - 6: CorporateLotPin, -} - -type Props = { siteTypeId: keyof typeof pinMap } - -const SiteTypePin = ({ siteTypeId }: Props) => pinMap[siteTypeId] -export default SiteTypePin diff --git a/canopeum_frontend/src/pages/MapPage.tsx b/canopeum_frontend/src/pages/MapPage.tsx index 8977304f7..96005f904 100644 --- a/canopeum_frontend/src/pages/MapPage.tsx +++ b/canopeum_frontend/src/pages/MapPage.tsx @@ -7,8 +7,8 @@ import type { MarkerEvent } from 'react-map-gl/dist/esm/types' import ReactMap, { GeolocateControl, Marker, NavigationControl, ScaleControl, type ViewState } from 'react-map-gl/maplibre' import { Link, useSearchParams } from 'react-router-dom' +import MapPin from '@components/icons/MapPinIcon' import SiteTypeIcon from '@components/icons/SiteTypeIcon' -import SiteTypePin from '@components/icons/SiteTypePin' import { appRoutes } from '@constants/routes.constant' import useApiClient from '@hooks/ApiClientHook' import type { SiteMap } from '@services/api' @@ -170,9 +170,14 @@ const MapPage = () => { latitude={latitude} longitude={longitude} onClick={event => onSelectSite(site, event)} - style={{ cursor: 'pointer' }} > - + + + ) }).filter(Boolean)} From d5f5f295d6cd3bfa66f797a221bb90d57101f8f9 Mon Sep 17 00:00:00 2001 From: Samuel Therrien Date: Tue, 10 Dec 2024 18:34:31 -0500 Subject: [PATCH 5/7] add missing id example in utilities --- canopeum_frontend/src/pages/Utilities.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/canopeum_frontend/src/pages/Utilities.tsx b/canopeum_frontend/src/pages/Utilities.tsx index a5676b94c..4a7d6db41 100644 --- a/canopeum_frontend/src/pages/Utilities.tsx +++ b/canopeum_frontend/src/pages/Utilities.tsx @@ -67,6 +67,9 @@ const Utilities = () => ( ))} + + + arrow_upward From 1926249441362408dcb8e6828dfe978949e513ae Mon Sep 17 00:00:00 2001 From: Samuel Therrien Date: Tue, 10 Dec 2024 18:55:49 -0500 Subject: [PATCH 6/7] PropsWithChildren simplifications --- canopeum_frontend/src/components/auth/AuthPageLayout.tsx | 8 ++------ .../src/components/context/AuthenticationContext.tsx | 6 +++--- .../src/components/context/LanguageContext.tsx | 6 +++--- .../src/components/context/SnackbarContext.tsx | 6 +++--- canopeum_frontend/src/components/icons/MapPinIcon.tsx | 2 +- canopeum_frontend/src/components/settings/SettingsTab.tsx | 4 +++- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/canopeum_frontend/src/components/auth/AuthPageLayout.tsx b/canopeum_frontend/src/components/auth/AuthPageLayout.tsx index a795cade3..ed178afd0 100644 --- a/canopeum_frontend/src/components/auth/AuthPageLayout.tsx +++ b/canopeum_frontend/src/components/auth/AuthPageLayout.tsx @@ -1,16 +1,12 @@ import './AuthPageLayout.scss' -import type { ReactNode } from 'react' +import type { PropsWithChildren } from 'react' import { useTranslation } from 'react-i18next' import { Link } from 'react-router-dom' import { appRoutes } from '@constants/routes.constant' -type Props = { - readonly children: ReactNode, -} - -const AuthPageLayout = ({ children }: Props) => { +const AuthPageLayout = ({ children }: PropsWithChildren) => { const { t: translate } = useTranslation() return ( diff --git a/canopeum_frontend/src/components/context/AuthenticationContext.tsx b/canopeum_frontend/src/components/context/AuthenticationContext.tsx index 7e8c0a231..dd9e826b3 100644 --- a/canopeum_frontend/src/components/context/AuthenticationContext.tsx +++ b/canopeum_frontend/src/components/context/AuthenticationContext.tsx @@ -1,4 +1,4 @@ -import type { FunctionComponent, ReactNode } from 'react' +import type { PropsWithChildren } from 'react' import { createContext, memo, useCallback, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -32,8 +32,8 @@ export const AuthenticationContext = createContext({ }) AuthenticationContext.displayName = 'AuthenticationContext' -const AuthenticationContextProvider: FunctionComponent<{ readonly children?: ReactNode }> = memo( - props => { +const AuthenticationContextProvider = memo( + (props: PropsWithChildren) => { const [user, setUser] = useState() const [isSessionLoaded, setIsSessionLoaded] = useState(false) const [isInitiated, setIsInitiated] = useState(false) diff --git a/canopeum_frontend/src/components/context/LanguageContext.tsx b/canopeum_frontend/src/components/context/LanguageContext.tsx index 9b20fa7a3..faf61a4d7 100644 --- a/canopeum_frontend/src/components/context/LanguageContext.tsx +++ b/canopeum_frontend/src/components/context/LanguageContext.tsx @@ -1,4 +1,4 @@ -import type { FunctionComponent, ReactNode } from 'react' +import type { PropsWithChildren } from 'react' import { createContext, memo, useCallback, useMemo } from 'react' import { useTranslation } from 'react-i18next' @@ -20,8 +20,8 @@ LanguageContext.displayName = 'LanguageContext' const { timeZone } = new Intl.DateTimeFormat().resolvedOptions() -const LanguageContextProvider: FunctionComponent<{ readonly children?: ReactNode }> = memo( - props => { +const LanguageContextProvider = memo( + (props: PropsWithChildren) => { const { i18n } = useTranslation() const formatDate = useCallback((date: Date | string, options?: Intl.DateTimeFormatOptions) => { diff --git a/canopeum_frontend/src/components/context/SnackbarContext.tsx b/canopeum_frontend/src/components/context/SnackbarContext.tsx index 826bfab7f..75e47ba1c 100644 --- a/canopeum_frontend/src/components/context/SnackbarContext.tsx +++ b/canopeum_frontend/src/components/context/SnackbarContext.tsx @@ -1,6 +1,6 @@ import { Alert, type AlertColor, type AlertPropsColorOverrides, Snackbar } from '@mui/material' import type { OverridableStringUnion } from '@mui/types' -import type { FunctionComponent, ReactNode, SyntheticEvent } from 'react' +import type { PropsWithChildren, SyntheticEvent } from 'react' import { createContext, memo, useCallback, useEffect, useMemo, useState } from 'react' type ISnackbarContext = { @@ -27,8 +27,8 @@ export const SnackbarContext = createContext({ }) SnackbarContext.displayName = 'SnackbarContext' -const SnackbarContextProvider: FunctionComponent<{ readonly children?: ReactNode }> = memo( - props => { +const SnackbarContextProvider = memo( + (props: PropsWithChildren) => { const [snackbarAlertOptions, setSnackbarAlertOptions] = useState( DEFAULT_SNACKBAR_ALERT_OPTIONS, ) diff --git a/canopeum_frontend/src/components/icons/MapPinIcon.tsx b/canopeum_frontend/src/components/icons/MapPinIcon.tsx index dfdb9f541..ee9cb3deb 100644 --- a/canopeum_frontend/src/components/icons/MapPinIcon.tsx +++ b/canopeum_frontend/src/components/icons/MapPinIcon.tsx @@ -4,7 +4,7 @@ import type { PropsWithChildren } from 'react' import mapPinIconRaw from '@assets/icons/map-pin.svg?raw' -const MapPinIcon = (props: PropsWithChildren & { readonly themeColor: string }) => ( +const MapPinIcon = (props: PropsWithChildren<{ readonly themeColor: string }>) => (
void, } From 4e5e8cc19a11d62f997839c78b304ba050a65a1f Mon Sep 17 00:00:00 2001 From: Samuel Therrien Date: Tue, 10 Dec 2024 18:55:58 -0500 Subject: [PATCH 7/7] Remove material-icons package --- canopeum_frontend/package-lock.json | 7 ------- canopeum_frontend/package.json | 1 - canopeum_frontend/src/components/Navbar.tsx | 3 +-- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/canopeum_frontend/package-lock.json b/canopeum_frontend/package-lock.json index ac47eb84c..c1b88b6df 100644 --- a/canopeum_frontend/package-lock.json +++ b/canopeum_frontend/package-lock.json @@ -20,7 +20,6 @@ "i18next-http-backend": "^2.5.0", "jwt-decode": "4.0.0", "maplibre-gl": "^4.1.1", - "material-icons": "^1.13.12", "nswag": "^14.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -11557,12 +11556,6 @@ "url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1" } }, - "node_modules/material-icons": { - "version": "1.13.12", - "resolved": "https://registry.npmjs.org/material-icons/-/material-icons-1.13.12.tgz", - "integrity": "sha512-/2YoaB79IjUK2B2JB+vIXXYGtBfHb/XG66LvoKVM5ykHW7yfrV5SP6d7KLX6iijY6/G9GqwgtPQ/sbhFnOURVA==", - "license": "Apache-2.0" - }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", diff --git a/canopeum_frontend/package.json b/canopeum_frontend/package.json index d1ee1453c..731e693f2 100644 --- a/canopeum_frontend/package.json +++ b/canopeum_frontend/package.json @@ -27,7 +27,6 @@ "i18next-http-backend": "^2.5.0", "jwt-decode": "4.0.0", "maplibre-gl": "^4.1.1", - "material-icons": "^1.13.12", "nswag": "^14.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/canopeum_frontend/src/components/Navbar.tsx b/canopeum_frontend/src/components/Navbar.tsx index c7a1867dd..f7892c433 100644 --- a/canopeum_frontend/src/components/Navbar.tsx +++ b/canopeum_frontend/src/components/Navbar.tsx @@ -1,4 +1,3 @@ -import type { MaterialIcon } from 'material-icons' import { useContext, useState } from 'react' import { useTranslation } from 'react-i18next' import { Link, useLocation } from 'react-router-dom' @@ -8,7 +7,7 @@ import { appRoutes } from '@constants/routes.constant' import type { RoleEnum } from '@services/api' type NavbarItem = { - icon: MaterialIcon, + icon: string, linkTo: string, label: string, roles: RoleEnum[],