diff --git a/public/locales/en/modules/weather.json b/public/locales/en/modules/weather.json
index 791f80897..16b034320 100644
--- a/public/locales/en/modules/weather.json
+++ b/public/locales/en/modules/weather.json
@@ -7,6 +7,9 @@
"displayInFahrenheit": {
"label": "Display in Fahrenheit"
},
+ "displayCityName":{
+ "label":"Display City Name"
+ },
"location": {
"label": "Weather location"
}
diff --git a/src/widgets/weather/WeatherTile.tsx b/src/widgets/weather/WeatherTile.tsx
index 5f0440284..a16e3d49c 100644
--- a/src/widgets/weather/WeatherTile.tsx
+++ b/src/widgets/weather/WeatherTile.tsx
@@ -1,7 +1,13 @@
-import { Center, Group, Skeleton, Stack, Text, Title } from '@mantine/core';
+import { Center, Flex, Group, Skeleton, Stack, Text, Title } from '@mantine/core';
import { useElementSize } from '@mantine/hooks';
-import { IconArrowDownRight, IconArrowUpRight, IconCloudRain } from '@tabler/icons-react';
+import {
+ IconArrowDownRight,
+ IconArrowUpRight,
+ IconCloudRain,
+ IconCurrentLocation,
+} from '@tabler/icons-react';
import { api } from '~/utils/api';
+
import { defineWidget } from '../helper';
import { IWidget } from '../widgets';
import { WeatherIcon } from './WeatherIcon';
@@ -14,6 +20,10 @@ const definition = defineWidget({
type: 'switch',
defaultValue: false,
},
+ displayCityName: {
+ type: 'switch',
+ defaultValue: false,
+ },
location: {
type: 'location',
defaultValue: {
@@ -80,15 +90,16 @@ function WeatherTile({ widget }: WeatherTileProps) {
align="center"
style={{ height: '100%', width: '100%' }}
>
-
+
-
+
{getPerferedUnit(
weather.current_weather.temperature,
widget.properties.displayInFahrenheit
)}
-
+
+
{width > 200 && (
@@ -103,6 +114,13 @@ function WeatherTile({ widget }: WeatherTileProps) {
)}
)}
+
+ {widget.properties.displayCityName && (
+
+
+ {widget.properties.location.name}
+
+ )}
);
}