-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d6b5518
commit 8fdef63
Showing
9 changed files
with
514 additions
and
95 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,27 +1,62 @@ | ||
// const PluginsData = require("../../../mockupData/Plugins.json"); | ||
// import { Rating } from "react-simple-star-rating"; | ||
|
||
import { Star } from "lucide-react"; | ||
import { Card, CardContent, CardFooter, CardTitle } from "../ui/card"; | ||
import { Ratings } from "../ui/rating"; | ||
import { useLocation } from "react-router-dom"; | ||
import { | ||
Tooltip, | ||
TooltipContent, | ||
TooltipProvider, | ||
TooltipTrigger, | ||
} from "../ui/tooltip"; | ||
|
||
export default function Plugin({ plugin }) { | ||
console.log(plugin); | ||
return ( | ||
<a href={"https://www.spigotmc.org/resources/" + plugin.id}> | ||
<div className="plugin"> | ||
<img src={"https://www.spigotmc.org/" + plugin.icon.url} /> | ||
<div className="Content"> | ||
<div className="Name">{plugin.name}</div> | ||
<div className="Stars"> | ||
{plugin.rating.average} | ||
{/* <Rating | ||
initialValue={plugin.rating.average} | ||
readonly={true} | ||
allowFraction={true} | ||
size={20} | ||
SVGstyle={{ display: "inline-block" }} | ||
/> */} | ||
// <a href={"https://www.spigotmc.org/resources/" + plugin.id}> | ||
<Card className="text-center"> | ||
<CardTitle className="truncate mx-2 my-2"> | ||
{plugin.name} | ||
<p className="text-sm font-normal text-primary"> | ||
{new Date(plugin.updateDate * 1000).toLocaleString()} | ||
</p> | ||
</CardTitle> | ||
<CardContent> | ||
<img | ||
className="mx-auto my-2 h-20" | ||
src={"https://www.spigotmc.org/" + plugin.icon.url} | ||
/> | ||
<div className="flex"> | ||
<div className="grow"></div> | ||
<div className="grow-0"> | ||
<Ratings rating={plugin.rating.average} /> | ||
</div> | ||
<div className="Reviews">({plugin.rating.count})</div> | ||
<div className="Mini-Description">{plugin.tag}</div> | ||
</div> | ||
</div> | ||
</a> | ||
<div className="grow"></div> | ||
</div>{" "} | ||
<p className="text-sm text-primary/80">{plugin.rating.count} ratings</p> | ||
<p className="text-primary">{plugin.downloads} downloads</p> | ||
</CardContent> | ||
<CardFooter className="pr-2 pb-2 flex justify-between"> | ||
{plugin.premium && ( | ||
<TooltipProvider> | ||
<Tooltip> | ||
<TooltipTrigger> | ||
<Star className="fill-current text-yellow-500"></Star> | ||
</TooltipTrigger> | ||
<TooltipContent>Premium</TooltipContent> | ||
</Tooltip> | ||
</TooltipProvider> | ||
)} | ||
<a | ||
href={"https://www.spigotmc.org/resources/" + plugin.id} | ||
target="_blank" | ||
className="text-right ml-auto text-muted text-sm hover:underline" | ||
> | ||
View on Spigot... | ||
</a> | ||
</CardFooter> | ||
</Card> | ||
); | ||
} |
Oops, something went wrong.