-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Vxrcel-clean' of https://github.com/hngprojects/hng_boi…
…lerplate_nextjs into clean
- Loading branch information
Showing
7 changed files
with
206 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/app/dashboard/(admin)/admin/email/generate-with-html/preview-template/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import Image from "next/image"; | ||
|
||
type New = { | ||
id: number; | ||
thumbnailUrl: string; | ||
}; | ||
|
||
type newTypes = { | ||
id: number; | ||
name: string; | ||
color: string; | ||
title: string; | ||
date: string; | ||
timeRead: string; | ||
}; | ||
|
||
const BlogCard = ({ | ||
article, | ||
newsType, | ||
}: { | ||
article: New; | ||
newsType: newTypes; | ||
}) => { | ||
const { thumbnailUrl } = article; | ||
return ( | ||
<div className="flex cursor-pointer flex-col rounded-t-lg"> | ||
<div className="relative flex"> | ||
<Image | ||
src={thumbnailUrl} | ||
alt="img" | ||
width={364} | ||
height={247} | ||
className="h-[247px] w-[374px] rounded-t-lg" | ||
/> | ||
<div | ||
data-testid="news-displayed" | ||
key={newsType.id} | ||
style={{ backgroundColor: newsType.color }} | ||
className="absolute left-[15px] top-[15px] rounded-[16px] px-[17px] py-[5px]" | ||
> | ||
<p className="text-[12px] font-bold text-blog-relatedBg"> | ||
{newsType.name} | ||
</p> | ||
</div> | ||
</div> | ||
<div className="flex h-[147px] w-[372px] flex-col gap-[24px] p-[16px] md:h-[137px] md:w-[354px]"> | ||
<p className="w-[320px] text-[20px] font-bold text-blog-relatedHeading"> | ||
{newsType.title} | ||
</p> | ||
<div className="flex items-center justify-between"> | ||
<p className="text-[14px] font-normal text-blog-relatedHeading"> | ||
{newsType.date} | ||
</p> | ||
<div className="rounded-[16px] bg-blog-relatedBg p-[8px]"> | ||
<p className="text-[14px] font-normal text-blog-relatedHeading"> | ||
{newsType.timeRead} | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BlogCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"; | ||
import * as React from "react"; | ||
|
||
import { ButtonProperties, buttonVariants } from "~/components/ui/button"; | ||
import { cn } from "~/lib/utils"; | ||
|
||
const Pagination = ({ | ||
className, | ||
...properties | ||
}: React.ComponentProps<"nav">) => ( | ||
<nav | ||
role="navigation" | ||
aria-label="pagination" | ||
className={cn("mx-auto flex w-full justify-center", className)} | ||
{...properties} | ||
/> | ||
); | ||
Pagination.displayName = "Pagination"; | ||
|
||
const PaginationContent = React.forwardRef< | ||
HTMLUListElement, | ||
React.ComponentProps<"ul"> | ||
>(({ className, ...properties }, reference) => ( | ||
<ul | ||
ref={reference} | ||
className={cn("flex flex-row items-center gap-1", className)} | ||
{...properties} | ||
/> | ||
)); | ||
PaginationContent.displayName = "PaginationContent"; | ||
|
||
const PaginationItem = React.forwardRef< | ||
HTMLLIElement, | ||
React.ComponentProps<"li"> | ||
>(({ className, ...properties }, reference) => ( | ||
<li ref={reference} className={cn("", className)} {...properties} /> | ||
)); | ||
PaginationItem.displayName = "PaginationItem"; | ||
|
||
type PaginationLinkProperties = { | ||
isActive?: boolean; | ||
activeVariant?: "default" | "outline"; | ||
} & Pick<ButtonProperties, "size"> & | ||
React.ComponentProps<"a">; | ||
|
||
const PaginationLink = ({ | ||
className, | ||
isActive, | ||
activeVariant = "outline", | ||
size = "icon", | ||
...properties | ||
}: PaginationLinkProperties) => ( | ||
<a | ||
aria-current={isActive ? "page" : undefined} | ||
className={cn( | ||
buttonVariants({ | ||
variant: isActive ? activeVariant : "ghost", | ||
size, | ||
}), | ||
isActive | ||
? "border-solid border-primary bg-primary/20" | ||
: "bg-white text-[#98A2B3]", | ||
className, | ||
)} | ||
{...properties} | ||
/> | ||
); | ||
PaginationLink.displayName = "PaginationLink"; | ||
|
||
const PaginationPrevious = ({ | ||
className, | ||
...properties | ||
}: React.ComponentProps<typeof PaginationLink>) => ( | ||
<PaginationLink | ||
aria-label="Go to previous page" | ||
size="icon" | ||
className={cn("border text-foreground", className)} | ||
{...properties} | ||
> | ||
<ChevronLeft className="h-4 w-4" /> | ||
<span></span> | ||
</PaginationLink> | ||
); | ||
PaginationPrevious.displayName = "PaginationPrevious"; | ||
|
||
const PaginationNext = ({ | ||
className, | ||
...properties | ||
}: React.ComponentProps<typeof PaginationLink>) => ( | ||
<PaginationLink | ||
aria-label="Go to next page" | ||
size="icon" | ||
className={cn("border text-foreground", className)} | ||
{...properties} | ||
> | ||
<span></span> | ||
<ChevronRight className="h-4 w-4" /> | ||
</PaginationLink> | ||
); | ||
PaginationNext.displayName = "PaginationNext"; | ||
|
||
const PaginationEllipsis = ({ | ||
className, | ||
...properties | ||
}: React.ComponentProps<"span">) => ( | ||
<span | ||
aria-hidden | ||
className={cn("flex h-9 w-9 items-center justify-center", className)} | ||
{...properties} | ||
> | ||
<MoreHorizontal className="h-4 w-4" /> | ||
<span className="sr-only">More pages</span> | ||
</span> | ||
); | ||
PaginationEllipsis.displayName = "PaginationEllipsis"; | ||
|
||
export { | ||
Pagination, | ||
PaginationContent, | ||
PaginationEllipsis, | ||
PaginationItem, | ||
PaginationLink, | ||
PaginationNext, | ||
PaginationPrevious, | ||
}; |