mirror of
https://github.com/hex248/ob248.com.git
synced 2026-02-09 11:13:03 +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 { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||||
import { type ProjectEntry, projectList, projects } from "@/projects";
|
import { type ProjectEntry, projectList, projects } from "@/projects";
|
||||||
import { locationPhotos, locations } from "@/travel";
|
import { locationPhotos, locations } from "@/travel";
|
||||||
import { TravelListItem } from "./components/TravelListItem";
|
|
||||||
import { ThemeToggle } from "./components/theme-toggle";
|
import { ThemeToggle } from "./components/theme-toggle";
|
||||||
import { Button } from "./components/ui/button";
|
import { Button } from "./components/ui/button";
|
||||||
import { cn } from "./lib/utils";
|
import { cn } from "./lib/utils";
|
||||||
@@ -246,16 +245,21 @@ function Home() {
|
|||||||
<div className="-mt-[1px] grid grid-cols-1">
|
<div className="-mt-[1px] grid grid-cols-1">
|
||||||
{locations.map((location, index) => (
|
{locations.map((location, index) => (
|
||||||
<>
|
<>
|
||||||
<TravelListItem
|
<Button
|
||||||
key={`${location.city} ${location.date}`}
|
className={cn(
|
||||||
metadata={location}
|
"text-sm border cursor-pointer hover:border-accent justify-start",
|
||||||
|
)}
|
||||||
onClick={(_e) => {
|
onClick={(_e) => {
|
||||||
setActivePhoto(null);
|
setActivePhoto(null);
|
||||||
setActiveLocation((prev) =>
|
setActiveLocation((prev) =>
|
||||||
prev === index ? null : index,
|
prev === index ? null : index,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
variant="dummy"
|
||||||
|
size="sm"
|
||||||
|
>
|
||||||
|
{location.city}, {location.country} - {location.date}
|
||||||
|
</Button>
|
||||||
{activeLocation === index &&
|
{activeLocation === index &&
|
||||||
(locationPhotos[location.id].length === 0 ? (
|
(locationPhotos[location.id].length === 0 ? (
|
||||||
<div className="flex">
|
<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