Skip to content

Commit

Permalink
2024.10.10
Browse files Browse the repository at this point in the history
    - updated package.json
    - UI/UX fixes
    - reactivated cache validation
  • Loading branch information
Mixhi1845 committed Oct 10, 2024
1 parent 2c3bbb0 commit c171be4
Show file tree
Hide file tree
Showing 8 changed files with 407 additions and 240 deletions.
553 changes: 367 additions & 186 deletions package-lock.json

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,41 @@
},
"dependencies": {
"@giscus/react": "^3.0.0",
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-avatar": "^1.1.0",
"@radix-ui/react-checkbox": "^1.1.1",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-accordion": "^1.2.1",
"@radix-ui/react-avatar": "^1.1.1",
"@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-navigation-menu": "^1.2.0",
"@radix-ui/react-popover": "^1.1.1",
"@radix-ui/react-navigation-menu": "^1.2.1",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-progress": "^1.1.0",
"@radix-ui/react-scroll-area": "^1.1.0",
"@radix-ui/react-select": "^2.1.1",
"@radix-ui/react-scroll-area": "^1.2.0",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.0",
"@tanstack/react-table": "^8.20.1",
"@radix-ui/react-tabs": "^1.1.1",
"@tanstack/react-table": "^8.20.5",
"@vercel/analytics": "^1.3.1",
"@vercel/speed-insights": "^1.0.12",
"axios": "^1.7.4",
"axios": "^1.7.7",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"cmdk": "^1.0.0",
"cookies-next": "^4.2.1",
"cookies-next": "^4.3.0",
"leaflet": "^1.9.4",
"lucide-react": "^0.428.0",
"next": "14.2.5",
"lucide-react": "^0.451.0",
"next": "14.2.15",
"next-themes": "^0.3.0",
"react": "^18",
"react-dom": "^18",
"react-icons": "^5.3.0",
"react-leaflet": "^4.2.1",
"react-markdown": "^9.0.1",
"remark-gfm": "^4.0.0",
"tailwind-merge": "^2.5.2",
"tailwind-merge": "^2.5.3",
"tailwindcss-animate": "^1.0.7",
"vaul": "^0.9.1",
"vaul": "^1.0.0",
"zod": "^3.23.8"
},
"devDependencies": {
Expand All @@ -57,8 +57,8 @@
"eslint-config-next": "14.1.3",
"postcss": "^8",
"prettier": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.6.6",
"tailwindcss": "^3.4.10",
"prettier-plugin-tailwindcss": "^0.6.8",
"tailwindcss": "^3.4.13",
"typescript": "^5"
}
}
8 changes: 4 additions & 4 deletions src/app/news/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const metadata: Metadata = {
},
};

export default function FAQPage() {
export default function NewsPage() {
const Comments = useMemo(
() =>
dynamic(() => import("@/components/giscusComponent"), {
Expand Down Expand Up @@ -71,23 +71,23 @@ export default function FAQPage() {
<>
<Container title="News">
<div className="grid gap-4 lg:grid-cols-2">
<Card className="col-start-1">
<Card>
<CardHeader>
<CardTitle>Dispatches</CardTitle>
</CardHeader>
<CardContent>
<News />
</CardContent>
</Card>
<Card className="col-start-1">
<Card>
<CardHeader>
<CardTitle>Patch Notes</CardTitle>
</CardHeader>
<CardContent>
<PatchNotes />
</CardContent>
</Card>
<Card className="lg:col-start-2 lg:row-span-2 lg:row-start-1">
<Card>
<CardHeader>
<CardTitle>Info about the Game</CardTitle>
</CardHeader>
Expand Down
2 changes: 0 additions & 2 deletions src/app/shop/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import dynamic from "next/dynamic";
import { Skeleton } from "@/components/ui/skeleton";

import Container from "@/components/containerCard";
import { CardDescription } from "@/components/ui/card";
import ItemShop from "@/components/widgets/itemShop";

export const metadata: Metadata = {
Expand Down Expand Up @@ -39,7 +38,6 @@ export default function ShopPage() {
return (
<>
<Container title="Shop">
<CardDescription>Updates in:</CardDescription>
<ItemShop />
</Container>
<Comments keyword="Shop" reactions="1" />
Expand Down
2 changes: 1 addition & 1 deletion src/app/stats/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const metadata: Metadata = {
},
};

export default function FAQPage() {
export default function StatsPage() {
const StatsWidget = useMemo(
() =>
dynamic(() => import("@/components/widgets/globalStats"), {
Expand Down
9 changes: 2 additions & 7 deletions src/components/widgets/itemShop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@ export default async function ItemShop() {
const shop = await API();

return (
<div className="grid grid-cols-1 gap-4 md:grid-cols-3 md:grid-rows-2">
<div className="grid grid-cols-1 gap-4 md:grid-cols-2 md:grid-rows-2">
{shop.store_rotation.items.map((item: any, index: number) => (
<Card
key={index}
className={`${index === 0 ? "row-span-2" : "row-auto"} ${
index === 3 ? "md:col-start-3 md:row-span-2 md:row-start-1" : ""
}`}
>
<Card key={index}>
<CardHeader>
<CardTitle>
{item.name}
Expand Down
33 changes: 12 additions & 21 deletions src/components/widgets/newsFeed.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { API } from "@/components/widgets/util/getApiData";
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion";
import Markdown from "react-markdown";
import remarkGfm from "remark-gfm";
import { Badge } from "@/components/ui/badge";
import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";

interface News {
id: number;
Expand Down Expand Up @@ -44,7 +38,7 @@ export default async function newsFeeds() {
);
}

const lastFourNews = news.news_feed.slice(-4);
const lastFourNews = news.news_feed.slice(-3);

if (lastFourNews.length === 0) {
return (
Expand All @@ -56,9 +50,8 @@ export default async function newsFeeds() {
}

return (
<div>
<div className="grid gap-4">
{lastFourNews.map((newses: News, index: number) => {
const publishedDate = new Date(newses.published * 1000);
const regex = /<i=3>(.*?)<\/i>/;
const match = newses.message.match(regex);
const triggerText = match ? `${match[1]}` : "NEW DISPATCH";
Expand All @@ -67,18 +60,16 @@ export default async function newsFeeds() {
.replace(/<i=1>(.*?)<\/i>/g, "$1");

return (
<Accordion key={index} type="single" collapsible>
<AccordionItem value={`item-${newses.id}`}>
<AccordionTrigger>
<div className="flex">
<div className="px-4">{triggerText}</div>
</div>
</AccordionTrigger>
<AccordionContent>
<div key={index}>
<Card key={newses.id}>
<CardHeader className="pb-0 md:pb-0">
<CardTitle className="leading-none">{triggerText}</CardTitle>
</CardHeader>
<CardContent>
<Markdown remarkPlugins={[remarkGfm]}>{markdown}</Markdown>
</AccordionContent>
</AccordionItem>
</Accordion>
</CardContent>
</Card>
</div>
);
})}
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/components/widgets/util/getApiData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export async function API() {
"X-Super-Client": "Helldivers 2 Companion - helldiverscompanion.app",
"X-Super-Contact": "@.mixhi",
},
next: { revalidate: 3600 },
});
return res.json();
}
Expand All @@ -23,6 +24,7 @@ export async function statusAPI() {
"X-Super-Client": "Helldivers 2 Companion - helldiverscompanion.app",
"X-Super-Contact": "@.mixhi",
},
next: { revalidate: 3600 },
});
return res.json();
}
Expand Down

0 comments on commit c171be4

Please sign in to comment.