Skip to content

Commit

Permalink
Merge pull request #2356 from Plant-for-the-Planet-org/feature/intega…
Browse files Browse the repository at this point in the history
…tion-firealert-fires

Integrated fires API
  • Loading branch information
mariahosfeld authored Jan 29, 2025
2 parents f6032e7 + 306e708 commit 04574b0
Show file tree
Hide file tree
Showing 15 changed files with 449 additions and 201 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ certificates/localhost.pem
build-storybook.log
src/stories

# vscode and local code
# vscode, idea and local code
.vscode/settings.json
.vscode/launch.json
.env copy.local
.idea

# TypeScript incremental compilation file
tsconfig.tsbuildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IconProps } from '../../features/common/types/common';
import type { IconProps } from '../../../../src/features/common/types/common';

import React from 'react';

Expand All @@ -7,7 +7,7 @@ const FireIcon = ({ width }: IconProps) => {
<svg
xmlns="http://www.w3.org/2000/svg"
width={width}
viewBox="0 0 36 42"
viewBox="7 1 22 28"
fill="none"
>
<g filter="url(#filter0_d_1076_3)">
Expand All @@ -32,24 +32,24 @@ const FireIcon = ({ width }: IconProps) => {
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feColorMatrix
{/* <feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
result="hardAlpha"
/>
/> */}
<feOffset dy="6" />
<feGaussianBlur stdDeviation="4" />
{/* <feGaussianBlur stdDeviation="4" /> */}
<feComposite in2="hardAlpha" operator="out" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
/>
<feBlend
{/* <feBlend
mode="normal"
in2="BackgroundImageFix"
result="effect1_dropShadow_1076_3"
/>
/> */}
<feBlend
mode="normal"
in="SourceGraphic"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IconProps } from '../../features/common/types/common';
import type { IconProps } from '../../../../src/features/common/types/common';

import React from 'react';

Expand Down
5 changes: 4 additions & 1 deletion public/static/locales/de/projectDetails.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
"seeLess": "weniger sehen",
"seeMore": "mehr sehen",
"forestFire": "Waldbrand",
"hoursAgo": "vor {hours}h",
"hoursAgo": "vor {age}h",
"daysAgo": "vor {age} T",
"highAlertConfidenceText": "<important>Hohe</important> Alarmkonfidenz",
"mediumAlertConfidenceText": "<important>Hohe</important> Alarmkonfidenz",
"lowAlertConfidenceText": "<important>Hohe</important> Alarmkonfidenz",
"setUpAlertsText": "Einrichten von Alarmen mit <important>FireAlert</important>",
"firstTreePlanted": "Erster gepflanzter Baum",
"plantingSeasons": "Pflanzsaisons",
Expand Down
5 changes: 4 additions & 1 deletion public/static/locales/en/projectDetails.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
"seeLess": "see less",
"seeMore": "see more",
"forestFire": "Forest Fire",
"hoursAgo": "{hours}h ago",
"hoursAgo": "{age}h ago",
"daysAgo": "{age}d ago",
"highAlertConfidenceText": "<important>High</important> alert confidence",
"mediumAlertConfidenceText": "<important>Medium</important> alert confidence",
"lowAlertConfidenceText": "<important>Low</important> alert confidence",
"setUpAlertsText": "Set up alerts with <important>FireAlert</important>",
"firstTreePlanted": "First tree planted",
"plantingSeasons": "planting seasons",
Expand Down
17 changes: 17 additions & 0 deletions src/features/common/types/fireLocation.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { Feature, FeatureCollection, Point } from 'geojson';

export interface FireFeature extends Feature {
geometry: Point;
properties: {
id: string;
eventDate: string;
type: 'fire';
detectedBy: string;
confidence: 'low' | 'medium' | 'high';
distance: number;
};
}

export interface FireFeatureCollection extends FeatureCollection {
features: FireFeature[];
}
113 changes: 113 additions & 0 deletions src/features/projectsV2/ProjectsMap/FirePopup/FirePopup.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
@import '../../../../theme/theme';

$backgroundColor: #fff;
$light: #fff;
$dangerColorNew: #e86f56;
$dangerBackgroundColor: rgba(249, 220, 214);
// $fontXSmall: '12px';

.arrowTop {
border: 10px solid transparent;
border-top-color: $light;
position: absolute;
bottom: -20px;
}
.arrowBottom {
border: 10px solid transparent;
border-bottom-color: $dangerBackgroundColor;
position: absolute;
top: -20px;
}

//fireIcon style : to be removed
.fireIcon {
width: 100%;
display: flex;
justify-content: center;
// margin-top: 20%;
padding-top: 12px;
padding-bottom: 12px;
cursor: pointer;
}

.popupContainer {
background-color: $backgroundColor;
min-width: 200px;
border-radius: 8px;
cursor: default;
svg {
overflow: visible;
}
}

.popupTitle {
display: flex;
justify-content: space-between;
background: rgba(232, 111, 86, 0.2); //to be replaced
align-items: center;
padding: 10px 14px;
border-radius: 8px 8px 0 0;

.titleText {
display: flex;
align-items: center;
gap: 7px;
font-weight: 700;
color: #333; //to be replaced
font-size: $fontXSmall;
}
}

.popupText {
padding: 14px;
font-size: $fontXSmall;
font-weight: 400;
color: #4f4f4f; //to be replaced
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
.coordinates {
color: #828282; //to be replaced
}
span {
font-weight: 700;
}
}

.setUpAlertsContainer {
display: flex;
justify-content: space-between;
gap: 8px;
text-wrap: nowrap;
text-decoration: none;
color: inherit;
cursor: pointer;
.setUpAlerts {
span {
color: $dangerColorNew;
}
}
}

.infoIconPopupContainer {
padding: 10px;
max-width: 123px;
font-size: $fontXXSmall;
border-radius: 8px;
}

.timeDuration {
font-size: $fontXXSmall;
font-weight: 600;
color: $dangerColorNew;
display: flex;
gap: 3px;
}

//to be removed
@include xsPhoneView {
.fireIcon {
margin-top: 60%;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import Popup from '../../FirePopup';
import Popup from '.';

const meta: Meta<typeof Popup> = {
title: 'Projects/Details/Popup',
Expand Down
Loading

0 comments on commit 04574b0

Please sign in to comment.