fix: add cursor pointer to buttons for better UX and update WeatherForm instructions
This commit is contained in:
@@ -53,7 +53,7 @@ const ChangeAPI: React.FC<Props> = ({ currentAPIKey, onClose }) => {
|
||||
</div>
|
||||
<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="cursor-pointer 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}
|
||||
>
|
||||
Update API Key
|
||||
|
@@ -47,7 +47,7 @@ const ChangePreferences: React.FC<Props> = ({ onClose }) => {
|
||||
Temperature Unit
|
||||
</label>
|
||||
<select
|
||||
className="w-full border-2 border-blue-200 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 transition"
|
||||
className="cursor-pointer w-full border-2 border-blue-200 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 transition"
|
||||
value={unit}
|
||||
onChange={(e) => setUnit(e.target.value)}
|
||||
>
|
||||
@@ -63,7 +63,7 @@ const ChangePreferences: React.FC<Props> = ({ onClose }) => {
|
||||
Theme
|
||||
</label>
|
||||
<select
|
||||
className="w-full border-2 border-blue-200 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 transition"
|
||||
className="cursor-pointer w-full border-2 border-blue-200 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 transition"
|
||||
value={theme}
|
||||
onChange={(e) => setTheme(e.target.value)}
|
||||
>
|
||||
@@ -77,7 +77,7 @@ const ChangePreferences: React.FC<Props> = ({ onClose }) => {
|
||||
{/* Submit */}
|
||||
<button
|
||||
type="submit"
|
||||
className="w-full bg-gradient-to-r from-blue-600 to-blue-400 text-white py-3 rounded-xl font-bold text-lg shadow-lg hover:from-blue-700 hover:to-blue-500 transition-all focus:outline-none focus:ring-2 focus:ring-blue-400"
|
||||
className="cursor-pointer w-full bg-gradient-to-r from-blue-600 to-blue-400 text-white py-3 rounded-xl font-bold text-lg shadow-lg hover:from-blue-700 hover:to-blue-500 transition-all focus:outline-none focus:ring-2 focus:ring-blue-400"
|
||||
>
|
||||
Save Preferences
|
||||
</button>
|
||||
|
@@ -21,14 +21,14 @@ const Header: React.FC = () => {
|
||||
className="w-10 h-10 drop-shadow-lg"
|
||||
/>
|
||||
<h1 className="text-4xl font-extrabold tracking-wide drop-shadow-lg">
|
||||
Weather App
|
||||
Weather App - <strong>Local hosted</strong>
|
||||
</h1>
|
||||
</div>
|
||||
<div className="flex items-center gap-4">
|
||||
{" "}
|
||||
{/* Added container for buttons */}
|
||||
<button
|
||||
className="bg-white text-blue-700 font-bold px-6 py-3 rounded-xl shadow-lg hover:bg-blue-100 transition-all border border-blue-200 flex items-center gap-2"
|
||||
className="cursor-pointer bg-white text-blue-700 font-bold px-6 py-3 rounded-xl shadow-lg hover:bg-blue-100 transition-all border border-blue-200 flex items-center gap-2"
|
||||
onClick={() => setApiCard(true)}
|
||||
>
|
||||
<span className="flex items-center gap-2">
|
||||
@@ -37,7 +37,7 @@ const Header: React.FC = () => {
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
className="bg-white text-blue-700 font-bold px-6 py-3 rounded-xl shadow-lg hover:bg-blue-100 transition-all border border-blue-200 flex items-center gap-2"
|
||||
className="cursor-pointer bg-white text-blue-700 font-bold px-6 py-3 rounded-xl shadow-lg hover:bg-blue-100 transition-all border border-blue-200 flex items-center gap-2"
|
||||
onClick={() => setPreferencesCard(true)}
|
||||
>
|
||||
<span className="flex items-center gap-2">
|
||||
@@ -50,7 +50,7 @@ const Header: React.FC = () => {
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<button className="bg-white text-blue-700 font-bold px-6 py-3 rounded-xl shadow-lg hover:bg-blue-100 transition-all border border-blue-200 flex items-center gap-2">
|
||||
<button className="cursor-help bg-white text-blue-700 font-bold px-6 py-3 rounded-xl shadow-lg hover:bg-blue-100 transition-all border border-blue-200 flex items-center gap-2">
|
||||
<span className="flex items-center gap-2">
|
||||
<Github /> Docs
|
||||
</span>
|
||||
|
@@ -52,6 +52,9 @@ const WeatherCard: React.FC = () => {
|
||||
<p className="mb-2 text-gray-600">
|
||||
Current weather will be displayed here.
|
||||
</p>
|
||||
<p className="mb-2 text-gray-600">
|
||||
<strong>Make sure to set your API key in the header section.</strong>
|
||||
</p>
|
||||
<form onSubmit={handleSubmit} className="flex flex-col gap-4 mt-4">
|
||||
<label htmlFor="city" className="font-medium text-gray-700">
|
||||
Enter City:
|
||||
@@ -69,7 +72,7 @@ const WeatherCard: React.FC = () => {
|
||||
<div className="flex items-center gap-2">
|
||||
<button
|
||||
type="submit"
|
||||
className="flex-1 bg-gradient-to-r from-blue-600 to-blue-400 text-white font-bold px-4 py-3 rounded-xl shadow-lg hover:from-blue-700 hover:to-blue-500 transition-all"
|
||||
className="cursor-pointer flex-1 bg-gradient-to-r from-blue-600 to-blue-400 text-white font-bold px-4 py-3 rounded-xl shadow-lg hover:from-blue-700 hover:to-blue-500 transition-all"
|
||||
>
|
||||
Get Weather
|
||||
</button>
|
||||
@@ -80,7 +83,7 @@ const WeatherCard: React.FC = () => {
|
||||
setWeatherData(false);
|
||||
localStorage.removeItem("weather");
|
||||
}}
|
||||
className="flex-shrink-0 bg-red-500 hover:bg-red-600 text-white rounded-xl p-3 shadow-lg transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-red-400"
|
||||
className="cursor-pointer flex-shrink-0 bg-red-500 hover:bg-red-600 text-white rounded-xl p-3 shadow-lg transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-red-400"
|
||||
aria-label="Close weather data"
|
||||
>
|
||||
<X />
|
||||
|
Reference in New Issue
Block a user