Added more todos

This commit is contained in:
Tim Howitz 2025-05-30 13:34:09 +01:00
parent 88f89ad12d
commit 183a53b178
2 changed files with 21 additions and 17 deletions

View File

@ -34,6 +34,8 @@ const store = createStore<StoreModel>({
}),
});
// todo fix user persisting on reload
function UserFetcher() {
const setUser = useStoreActions((actions) => actions.setUser);
const { data, error } = useSWR("/api/user", fetcher);

View File

@ -16,7 +16,7 @@ interface SidebarProps {
setHoveredEventId: Dispatch<SetStateAction<string>>;
button1Name: string;
button2Name: string;
onButton2Click?: () => void;
onButton2Click?: () => void;
}
function MagnitudeNumber({ magnitude }: { magnitude: number }) {
@ -37,6 +37,8 @@ function MagnitudeNumber({ magnitude }: { magnitude: number }) {
);
}
// todo change sidebar event highlighting on selection
export default function Sidebar({
logTitle,
logSubtitle,
@ -48,7 +50,7 @@ export default function Sidebar({
setHoveredEventId,
button1Name,
button2Name,
onButton2Click,
onButton2Click,
}: SidebarProps) {
const eventsContainerRef = useRef<HTMLDivElement>(null);
@ -71,20 +73,20 @@ export default function Sidebar({
<h2 className="text-2xl font-bold text-neutral-800 mb-2">{logTitle}</h2>
<p className="text-sm text-neutral-600 leading-relaxed">{logSubtitle}</p>
<Link href="/">
<button className="mt-4 w-full bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded-lg transition-colors duration-200 font-medium">
{button1Name}
</button>
</Link>
{/* "Search Earthquakes" should NOT be wrapped in a Link! */}
<button
className="mt-4 w-full bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded-lg transition-colors duration-200 font-medium"
onClick={onButton2Click}
type="button"
>
{button2Name}
</button>
</div>
<Link href="/">
<button className="mt-4 w-full bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded-lg transition-colors duration-200 font-medium">
{button1Name}
</button>
</Link>
{/* "Search Earthquakes" should NOT be wrapped in a Link! */}
<button
className="mt-4 w-full bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded-lg transition-colors duration-200 font-medium"
onClick={onButton2Click}
type="button"
>
{button2Name}
</button>
</div>
<div className="px-6 pt-6">
<h2 className="text-xl font-bold text-neutral-800 mb-4">{recentsTitle}</h2>
</div>