fix: change button type to submit in ChangeAPI component and update temperature unit logic in WeatherData component
This commit is contained in:
@@ -64,7 +64,7 @@ const ChangeAPI: React.FC<Props> = ({ currentAPIKey, onClose }) => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="submit"
|
||||||
className="bg-gradient-to-r from-blue-600 to-blue-400 text-white font-bold px-6 py-3 rounded-xl shadow-lg hover:from-blue-700 hover:to-blue-500 transition-all"
|
className="bg-gradient-to-r from-blue-600 to-blue-400 text-white font-bold px-6 py-3 rounded-xl shadow-lg hover:from-blue-700 hover:to-blue-500 transition-all"
|
||||||
onClick={handleUpdate}
|
onClick={handleUpdate}
|
||||||
>
|
>
|
||||||
|
@@ -24,7 +24,9 @@ const WeatherData: React.FC = () => {
|
|||||||
? "°C"
|
? "°C"
|
||||||
: localStorage.getItem("unit") === "imperial"
|
: localStorage.getItem("unit") === "imperial"
|
||||||
? "°F"
|
? "°F"
|
||||||
: "K"}
|
: localStorage.getItem("unit") === "standard"
|
||||||
|
? "K"
|
||||||
|
: "°C"}
|
||||||
</p>
|
</p>
|
||||||
<p className="flex items-center justify-center gap-2">
|
<p className="flex items-center justify-center gap-2">
|
||||||
{weatherData?.sys?.country && (
|
{weatherData?.sys?.country && (
|
||||||
|
Reference in New Issue
Block a user