Skip to content

Commit 210c5f4

Browse files
committed
Revert Arrow and remove roast
1 parent d7eb1e4 commit 210c5f4

4 files changed

Lines changed: 9 additions & 177 deletions

File tree

‎frontend/src/components/Arrow.tsx‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,16 @@ const Arrow: React.FC<ArrowProps> = ({ className, deg }) => {
3131
opacity: 0.5,
3232
}}
3333
/>
34-
<svg
35-
viewBox="0 0 24 24"
34+
<div
3635
css={{
3736
position: "absolute",
38-
top: 0,
39-
left: 0,
40-
width: "100%",
41-
height: "100%",
37+
left: 7,
38+
top: 6,
39+
borderLeft: "5px solid transparent",
40+
borderRight: "5px solid transparent",
41+
borderBottom: `10px solid ${theme.colors.text.main}`,
4242
}}
43-
>
44-
<path d="M12 5 L17 14 L12 11 L7 14 Z" fill={theme.colors.text.main} />
45-
</svg>
43+
/>
4644
</div>
4745
);
4846
};

‎frontend/src/components/FmiWeatherBox.tsx‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { useTheme } from "@emotion/react";
22
import { format } from "date-fns";
33
import { fi } from "date-fns/locale/fi";
4-
import { memo, useMemo } from "react";
4+
import { memo } from "react";
55
import useSWR from "swr";
66

77
import { api, fetcher } from "../api";
88
import useLocationSettings from "../hooks/useLocationSettings";
9-
import { getTemperatureRoast } from "../temperatureRoast";
109
import { WeatherData } from "../types/weather/fmi";
1110
import {
1211
getFmiWeatherDescription,
@@ -42,16 +41,6 @@ const WeatherBox: React.FC<WeatherBoxProps> = ({ className }) => {
4241
const today = daily[0];
4342
const hourly = data?.hourly;
4443

45-
const currentTemp = current?.temperature;
46-
const roundedTemp =
47-
currentTemp !== undefined ? Math.round(currentTemp) : undefined;
48-
/* eslint-disable react-hooks/exhaustive-deps -- intentionally keyed on roundedTemp to avoid re-randomizing on fractional changes */
49-
const roast = useMemo(
50-
() => (currentTemp !== undefined ? getTemperatureRoast(currentTemp) : null),
51-
[roundedTemp],
52-
);
53-
/* eslint-enable react-hooks/exhaustive-deps */
54-
5544
if (!location && !locationLoading) {
5645
return (
5746
<Box className={className}>
@@ -132,7 +121,7 @@ const WeatherBox: React.FC<WeatherBoxProps> = ({ className }) => {
132121
textTransform: "none",
133122
}}
134123
>
135-
{[location?.displayName, roast].filter(Boolean).join(" – ")}
124+
{location?.displayName ?? ""}
136125
</span>
137126
</div>
138127
<div

‎frontend/src/components/TomorrowWeatherBox.tsx‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { useTheme } from "@emotion/react";
22
import { format } from "date-fns";
33
import { fi } from "date-fns/locale/fi";
4-
import { useMemo } from "react";
54
import useSWR from "swr";
65

76
import { api, fetcher } from "../api";
8-
import { getTemperatureRoast } from "../temperatureRoast";
97
import { TomorrowWeatherData } from "../types/weather/tomorrow";
108
import { getWeatherIcon } from "../weather/tomorrow/icons";
119
import { getTemperatureSegments } from "../weather/tomorrow/utils";
@@ -78,16 +76,6 @@ const TomorrowWeatherBox: React.FC<TomorrowWeatherBoxProps> = ({
7876

7977
const segments = getTemperatureSegments(hourly?.intervals);
8078

81-
const currentTemp = weather?.values.temperature;
82-
const roundedTemp =
83-
currentTemp !== undefined ? Math.round(currentTemp) : undefined;
84-
/* eslint-disable react-hooks/exhaustive-deps -- intentionally keyed on roundedTemp to avoid re-randomizing on fractional changes */
85-
const roast = useMemo(
86-
() => (currentTemp !== undefined ? getTemperatureRoast(currentTemp) : null),
87-
[roundedTemp],
88-
);
89-
/* eslint-enable react-hooks/exhaustive-deps */
90-
9179
if (!(data && weather && today)) {
9280
return null;
9381
}
@@ -128,15 +116,6 @@ const TomorrowWeatherBox: React.FC<TomorrowWeatherBoxProps> = ({
128116
}}
129117
>
130118
{title}
131-
<span
132-
css={{
133-
...theme.typography.caption,
134-
color: theme.colors.text.muted,
135-
textTransform: "none",
136-
}}
137-
>
138-
{roast}
139-
</span>
140119
{alerts && alerts.length > 0 && (
141120
<Tooltip
142121
content={

‎frontend/src/temperatureRoast.ts‎

Lines changed: 0 additions & 134 deletions
This file was deleted.

0 commit comments

Comments
 (0)