feat: enhance ChangeAPI and ChangePreferences components; add "API key update" functionality and save preferences feature

This commit is contained in:
2025-08-01 01:06:58 +02:00
parent 6f3d945213
commit 8341e50dc8
7 changed files with 250 additions and 41 deletions

View File

@@ -75,6 +75,31 @@ const Header: React.FC = () => {
Preferences
</span>
</button>
<a
href="https://git.the1s.de/theis.gaedigk/weather-app/wiki"
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">
<span className="flex items-center gap-2">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
strokeWidth={1.5}
stroke="currentColor"
className="size-6"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"
/>
</svg>
Docs
</span>
</button>
</a>
</div>
</header>
{apiCard && (
@@ -87,7 +112,10 @@ const Header: React.FC = () => {
>
&times;
</button>
<ChangeAPI currentAPIKey={apiKey} />
<ChangeAPI
currentAPIKey={apiKey}
onClose={() => setApiCard(false)}
/>
</div>
</div>
)}
@@ -102,7 +130,7 @@ const Header: React.FC = () => {
>
&times;
</button>
<ChangePreferences />
<ChangePreferences onClose={() => setPreferencesCard(false)} />
</div>
</div>
)}