mirror of
https://github.com/hex248/ob248.com.git
synced 2026-02-09 03:03:02 +00:00
removed unnecessary TravelListItem component
This commit is contained in:
14
src/App.tsx
14
src/App.tsx
@@ -15,7 +15,6 @@ import { TimeSince } from "@/components/time-since";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { type ProjectEntry, projectList, projects } from "@/projects";
|
||||
import { locationPhotos, locations } from "@/travel";
|
||||
import { TravelListItem } from "./components/TravelListItem";
|
||||
import { ThemeToggle } from "./components/theme-toggle";
|
||||
import { Button } from "./components/ui/button";
|
||||
import { cn } from "./lib/utils";
|
||||
@@ -246,16 +245,21 @@ function Home() {
|
||||
<div className="-mt-[1px] grid grid-cols-1">
|
||||
{locations.map((location, index) => (
|
||||
<>
|
||||
<TravelListItem
|
||||
key={`${location.city} ${location.date}`}
|
||||
metadata={location}
|
||||
<Button
|
||||
className={cn(
|
||||
"text-sm border cursor-pointer hover:border-accent justify-start",
|
||||
)}
|
||||
onClick={(_e) => {
|
||||
setActivePhoto(null);
|
||||
setActiveLocation((prev) =>
|
||||
prev === index ? null : index,
|
||||
);
|
||||
}}
|
||||
/>
|
||||
variant="dummy"
|
||||
size="sm"
|
||||
>
|
||||
{location.city}, {location.country} - {location.date}
|
||||
</Button>
|
||||
{activeLocation === index &&
|
||||
(locationPhotos[location.id].length === 0 ? (
|
||||
<div className="flex">
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import type { MouseEventHandler } from "react";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { TravelMetadata } from "@/travel";
|
||||
import { Button } from "./ui/button";
|
||||
|
||||
export function TravelListItem({
|
||||
metadata,
|
||||
onClick,
|
||||
}: {
|
||||
metadata: TravelMetadata;
|
||||
onClick: MouseEventHandler<HTMLButtonElement>;
|
||||
}) {
|
||||
return (
|
||||
<Button
|
||||
className={cn(
|
||||
"text-sm border cursor-pointer hover:border-accent justify-start",
|
||||
)}
|
||||
onClick={onClick}
|
||||
variant="dummy"
|
||||
size="sm"
|
||||
>
|
||||
{metadata.city}, {metadata.country} - {metadata.date}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user