Skip to content

Commit

Permalink
Add placeholder for deleting one hour of history
Browse files Browse the repository at this point in the history
  • Loading branch information
AJGeel committed Oct 20, 2024
1 parent 9389a0d commit 1909532
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
18 changes: 14 additions & 4 deletions src/pages/history/History.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useQuery } from "@tanstack/react-query";
import { format, parseISO } from "date-fns";
import { addHours, format, parseISO } from "date-fns";
import { useMemo, useState } from "react";
import { InView } from "react-intersection-observer";

Expand Down Expand Up @@ -75,9 +75,19 @@ const History = () => {
}
}}
>
<h3 className="my-4 font-medium text-black/80">
{hour}:00
</h3>
<div className="flex items-center justify-between gap-4">
<h3 className="my-4 font-medium text-black/80">
{hour}:00
</h3>
<button
onClick={() => {
alert("TODO: Delete the history range");
}}
className="rounded-md bg-gray-50 px-1.5 py-0.5 text-xs border border-gray-200 duration-150 hover:border-black hover:bg-black hover:text-white focus-visible:ring-2 ring-offset-2 ring-gray-300 outline-none"
>
Delete
</button>
</div>
{items.map((item) => (
<HistoryItem key={item.id} {...item} />
))}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/history/components/SearchHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type SearchHeaderProps = {
const SearchHeader = ({ searchQuery, setSearchQuery }: SearchHeaderProps) => (
<div className="flex items-center gap-6">
<h1 className="text-xl font-bold">History</h1>
<div className="relative w-full max-w-sm overflow-hidden rounded-md border bg-gray-50 ring-sky-500 ring-offset-2 duration-150 focus-within:ring-2">
<div className="relative w-full max-w-sm overflow-hidden rounded-md border bg-gray-50 ring-gray-300 ring-offset-2 duration-150 focus-within:ring-2">
<input
className="group w-full bg-transparent px-2 py-1.5 pl-9 font-sans focus-within:outline-none"
placeholder="Search title or url"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const DayButton = ({ date, isActive, onClick }: DayButtonProps) => {
<button
onClick={onClick}
className={cn(
"flex w-20 flex-col items-center rounded-md bg-gray-50 px-2 py-1 outline outline-1 outline-black/10 duration-150 hover:bg-black hover:text-white",
isActive && "bg-black text-white"
"flex w-20 flex-col items-center rounded-md bg-gray-50 px-2 py-1 border border-gray-200 duration-150 hover:border-black hover:bg-black hover:text-white focus-visible:ring-2 ring-offset-2 ring-gray-300 outline-none",
isActive && "bg-black text-white border-black"
)}
>
<p className="text-[12px] font-semibold capitalize">{title}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const PaginationButton = ({
}: PaginationButtonProps) => (
<button
className={cn(
"rounded-md border bg-gray-50 px-1.5 py-2 text-gray-600 duration-150",
"rounded-md border bg-gray-50 px-1.5 py-2 text-gray-600 duration-150 focus-visible:ring-2 ring-offset-2 ring-gray-300 outline-none",
isDisabled && "opacity-50",
!isDisabled && "hover:bg-black hover:text-white"
)}
Expand Down

0 comments on commit 1909532

Please sign in to comment.