Skip to content

Commit f0d7ae8

Browse files
committed
refactoring
1 parent 59d9b39 commit f0d7ae8

File tree

11 files changed

+23
-23
lines changed

11 files changed

+23
-23
lines changed

src/components/LocationSearchbar.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const getLocations = () => {
2121
}, 500);
2222
};
2323
24-
const getWeather = () => {
24+
const getWeatherBySearch = () => {
2525
if (!location.value) return;
2626
2727
clearTimeout(timer);
@@ -35,9 +35,9 @@ const getWeather = () => {
3535
});
3636
};
3737
38-
const getWeatherByCoords = (location: any) => {
38+
const getWeatherByLocation = (location: any) => {
3939
locationsSearched.value = false;
40-
weatherStore.getWeatherFromGeocoding(location);
40+
weatherStore.getWeatherByGeocoding(location);
4141
router.push({
4242
name: "weather",
4343
params: {
@@ -55,7 +55,7 @@ const getWeatherByCoords = (location: any) => {
5555
class="location-searchbar__input"
5656
placeholder="Enter a city or zip code"
5757
@keyup.stop="getLocations"
58-
@keyup.enter="getWeather"
58+
@keyup.enter="getWeatherBySearch"
5959
>
6060
<button
6161
class="location-searchbar__button"
@@ -64,7 +64,7 @@ const getWeatherByCoords = (location: any) => {
6464
? 'location-searchbar__button--day'
6565
: 'location-searchbar__button--night'
6666
]"
67-
@click="getWeather"
67+
@click="getWeatherBySearch"
6868
>
6969
<font-awesome-icon
7070
:icon="['fas', 'magnifying-glass']"
@@ -80,7 +80,7 @@ const getWeatherByCoords = (location: any) => {
8080
v-for="locationName in locations"
8181
:key="locationName"
8282
class="location-searchbar__list-item"
83-
@click="getWeatherByCoords(locationName)"
83+
@click="getWeatherByLocation(locationName)"
8484
>
8585
<p>{{ locationName.name }}, {{ locationName.admin1 }}</p>
8686
</div>
File renamed without changes.
File renamed without changes.

src/components/weather/DailyWeather.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { storeToRefs } from "pinia";
44
import { useWeatherStore } from "@/stores/weather";
55
import { parseWeatherCode } from "@/utils/weatherCodes";
66
7-
import CardItem from "@/components/CardItem.vue";
7+
import CardItem from "@/components/core/CardItem.vue";
88
99
const daysOfTheWeek = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
1010

src/components/weather/HourlyWeather.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { storeToRefs } from "pinia";
44
import { useWeatherStore } from "@/stores/weather";
55
import { parseWeatherCode } from "@/utils/weatherCodes";
66
7-
import CardItem from "@/components/CardItem.vue";
7+
import CardItem from "@/components/core/CardItem.vue";
88
99
const weatherStore = useWeatherStore();
1010
const { weather } = storeToRefs(weatherStore);

src/components/weather/WeatherGrid.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { storeToRefs } from "pinia";
33
import { useWeatherStore } from "@/stores/weather";
44
55
import GridContainer from "@/components/grid/GridContainer.vue";
6-
import HumidityCard from "@/components/weather/HumidityCard.vue";
7-
import PressureCard from "@/components/weather/PressureCard.vue";
8-
import WindCard from "@/components/weather/WindCard.vue";
9-
import AQICard from "@/components/weather/AQICard.vue";
10-
import CardItem from "@/components/CardItem.vue";
6+
import HumidityCard from "@/components/weather/cards/HumidityCard.vue";
7+
import PressureCard from "@/components/weather/cards/PressureCard.vue";
8+
import WindCard from "@/components/weather/cards/WindCard.vue";
9+
import AQICard from "@/components/weather/cards/AQICard.vue";
10+
import CardItem from "@/components/core/CardItem.vue";
1111
1212
const weatherStore = useWeatherStore();
1313

src/components/weather/AQICard.vue renamed to src/components/weather/cards/AQICard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import CardItem from "@/components/CardItem.vue";
2+
import CardItem from "@/components/core/CardItem.vue";
33
44
interface Props {
55
aqi: number;

src/components/weather/HumidityCard.vue renamed to src/components/weather/cards/HumidityCard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import CardItem from "@/components/CardItem.vue";
3-
import HumidityGauge from "@/components/HumidityGauge.vue";
2+
import CardItem from "@/components/core/CardItem.vue";
3+
import HumidityGauge from "@/components/core/HumidityGauge.vue";
44
55
defineProps<{
66
humidity: number;

src/components/weather/PressureCard.vue renamed to src/components/weather/cards/PressureCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import CardItem from "@/components/CardItem.vue";
2+
import CardItem from "@/components/core/CardItem.vue";
33
44
interface Props {
55
pressure: number;

src/components/weather/WindCard.vue renamed to src/components/weather/cards/WindCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import CardItem from "@/components/CardItem.vue";
2+
import CardItem from "@/components/core/CardItem.vue";
33
44
interface Props {
55
direction: number;

0 commit comments

Comments
 (0)