add image svg

This commit is contained in:
Romulus21
2023-10-01 23:19:08 +02:00
parent 1eb26151dd
commit 0ce75d59e3
18 changed files with 548 additions and 10 deletions

View File

@@ -1,8 +1,9 @@
import React, {FC, useEffect, useState} from "react"
import PageLayout from "../components/PageLayout"
import useAxiosTools from "../hooks/AxiosTools";
import {WeatherValue} from "../types";
import useAxiosTools from "../hooks/AxiosTools"
import {WeatherValue} from "../types"
import Card from "../components/Card"
import Img from "../components/Img"
const Weather = () => {
@@ -75,8 +76,10 @@ const Weather = () => {
</div>
<div className="flex items-stretch">
<div>
{currentWeather && <img src={`http://openweathermap.org/img/wn/${currentWeather?.weather[0].icon}@2x.png`}
alt={currentWeather?.weather[0].main} width="120px" />}
{/*{currentWeather && <img src={`http://openweathermap.org/img/wn/${currentWeather?.weather[0].icon}@2x.png`}*/}
{/* alt={currentWeather?.weather[0].main} width="120px" />}*/}
{currentWeather && <Img src={`images/icons/${currentWeather?.weather[0].icon}.svg`}
alt={currentWeather?.weather[0].main} width="120px" />}
</div>
<div className="flex gap-1 flex-col">
<span className="text-4xl pt-5">{currentWeather?.main.temp_max.toFixed()} <span className="text-2xl">°C</span></span>
@@ -146,9 +149,9 @@ const WeatherCard: FC<{date: string, values: WeatherValue[]}> = ({date, values=
<span className="text-secondary dark:text-secondary-ligth">{weatherState?.description}</span>
</div>
<div className="flex items-center -mt-1.5">
<img src={`http://openweathermap.org/img/wn/${weatherState?.icon}@2x.png`}
className=""
alt={weatherState?.main + ' ' + weatherState?.icon} width="80px" />
<Img src={`images/icons/${weatherState?.icon}.svg`}
alt={weatherState?.main + ' ' + weatherState?.icon}
width="80px" />
</div>
<div className="flex gap-1 flex-col">