mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-02 13:33:40 +01:00
add attribution to the condition map class
This commit is contained in:
parent
ac718c852a
commit
f0f470ba8b
@ -1,3 +1,6 @@
|
|||||||
|
// Code primarely based on Flame's ConditionMap class
|
||||||
|
// https://github.com/pawelmalak/flame/blob/master/client/src/components/UI/Icons/WeatherIcon/IconMapping.ts
|
||||||
|
|
||||||
import * as Icons from "react-icons/wi";
|
import * as Icons from "react-icons/wi";
|
||||||
|
|
||||||
const conditions = [
|
const conditions = [
|
||||||
@ -340,9 +343,7 @@ const conditions = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export default function mapIcon(weatherStatusCode, timeOfDay) {
|
export default function mapIcon(weatherStatusCode, timeOfDay) {
|
||||||
const mapping = conditions.find(
|
const mapping = conditions.find((condition) => condition.code === weatherStatusCode);
|
||||||
(condition) => condition.code === weatherStatusCode
|
|
||||||
);
|
|
||||||
|
|
||||||
if (mapping) {
|
if (mapping) {
|
||||||
if (timeOfDay === "day") {
|
if (timeOfDay === "day") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user