Skip to content

Commit

Permalink
Merge pull request #10 from falsepopsky/dev
Browse files Browse the repository at this point in the history
db: add banlist 23/01/2024
  • Loading branch information
falsepopsky authored Jan 12, 2024
2 parents ca8c083 + 6035bc1 commit 01297d8
Show file tree
Hide file tree
Showing 10 changed files with 564 additions and 418 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"features": {
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "20.10.0",
"version": "20.11.0",
"nvmVersion": "latest"
}
},
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- main

env:
PNPM_VERSION: 8.12.1
PNPM_VERSION: 8.14.1

jobs:
lint:
Expand All @@ -24,7 +24,7 @@ jobs:
version: ${{ env.PNPM_VERSION }}

- name: Setup Node
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v4.0.1
with:
node-version-file: ".nvmrc"
cache: pnpm
Expand All @@ -47,7 +47,7 @@ jobs:
version: ${{ env.PNPM_VERSION }}

- name: Setup Node
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v4.0.1
with:
node-version-file: ".nvmrc"
cache: pnpm
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.10.0
v20.11.0
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
"source.fixAll": "always",
"source.organizeImports": "always"
},
"editor.wordWrap": "on",
"editor.guides.bracketPairs": "active",
Expand Down
51 changes: 28 additions & 23 deletions app/rush/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { getBanlistByFormat } from '@/lib/queries';
import Link from 'next/link';

export default async function Banlist() {
const years = ['2024', '2023'];
const data = await getBanlistByFormat(2);
const dates = data?.map(({ id, slug }) => {
return {
Expand All @@ -10,19 +11,32 @@ export default async function Banlist() {
};
});

function BanlistCard() {
const filterDatesByYear = dates?.filter(({ slug }) => slug.includes('2023'));
return filterDatesByYear?.map(({ id, slug }) => (
<li key={id}>
<Link
href={`/rush/${slug}`}
className='focus-visible:outline focus-visible:outline-1 focus-visible:outline-teal-500 active:outline active:outline-1 active:outline-teal-600'
>
{slug}
</Link>
</li>
));
}
const banlist = years.map((year, i) => {
const filterDatesByYear = dates?.filter((item) => item.slug.includes(year));

return (
<div
key={i}
className='flex flex-col rounded-md border border-gray-300 bg-slate-200/40 px-2 py-1 dark:border-transparent dark:bg-zinc-800/40'
>
<span className='mx-auto mt-1 max-w-fit rounded-xl bg-teal-500 px-2 py-1 text-xs font-normal text-teal-950 dark:bg-teal-950 dark:text-teal-500'>
{year}
</span>
<ol className='mt-3 list-disc space-y-1 pl-4 text-sm marker:text-teal-900 dark:marker:text-teal-400'>
{filterDatesByYear?.map(({ id, slug }) => (
<li key={id}>
<Link
href={`/rush/${slug}`}
className='focus-visible:outline focus-visible:outline-1 focus-visible:outline-teal-500 active:outline active:outline-1 active:outline-teal-600'
>
{slug}
</Link>
</li>
))}
</ol>
</div>
);
});

return (
<main className='mx-auto flex w-full max-w-screen-xl flex-col flex-nowrap items-center justify-center gap-4'>
Expand All @@ -33,16 +47,7 @@ export default async function Banlist() {
Each year features the dates of the applied banlists, which contain the changes. Explore these dates to discover
how card restrictions have influenced competitive play.
</p>
<div className='my-4 flex flex-row flex-wrap items-start justify-center gap-2'>
<div className='flex flex-col rounded-md border border-gray-300 bg-slate-200/40 px-2 py-1 dark:border-transparent dark:bg-zinc-800/40'>
<span className='mx-auto mt-1 max-w-fit rounded-xl bg-teal-500 px-2 py-1 text-xs font-normal text-teal-950 dark:bg-teal-950 dark:text-teal-500'>
2023
</span>
<ol className='mt-3 list-disc space-y-1 pl-4 text-sm marker:text-teal-900 dark:marker:text-teal-400'>
<BanlistCard />
</ol>
</div>
</div>
<div className='my-4 flex flex-row flex-wrap items-start justify-center gap-2'>{banlist}</div>
</main>
);
}
2 changes: 1 addition & 1 deletion app/speed/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getBanlistByFormat } from '@/lib/queries';
import Link from 'next/link';

export default async function Banlist() {
const years = ['2023', '2022', '2021', '2020', '2019', '2018', '2017'];
const years = ['2024', '2023', '2022', '2021', '2020', '2019', '2018', '2017'];
const data = await getBanlistByFormat(1);
const dates = data?.map(({ id, slug }) => {
return {
Expand Down
2 changes: 1 addition & 1 deletion lib/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function getBanlistByFormat(format: number) {
where: {
date: {
gte: '2017-01-01T00:00:00Z',
lt: '2024-01-01T00:00:00Z',
lt: '2025-01-01T00:00:00Z',
},
formatId: format,
},
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"postinstall": "prisma generate"
},
"dependencies": {
"@prisma/client": "^5.7.0",
"@prisma/client": "^5.8.0",
"next": "^14.0.4",
"next-themes": "^0.2.1",
"react": "^18.2.0",
Expand All @@ -23,24 +23,24 @@
"devDependencies": {
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-tabs": "^1.0.4",
"@types/node": "^20.10.4",
"@types/react": "^18.2.45",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@types/node": "^20.11.0",
"@types/react": "^18.2.47",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"autoprefixer": "^10.4.16",
"eslint": "^8.55.0",
"eslint": "^8.56.0",
"eslint-config-next": "^14.0.4",
"eslint-config-prettier": "^9.1.0",
"postcss": "^8.4.32",
"postcss": "^8.4.33",
"prettier": "^3.1.1",
"prettier-plugin-tailwindcss": "^0.5.9",
"prisma": "^5.7.0",
"tailwindcss": "^3.3.6",
"prettier-plugin-tailwindcss": "^0.5.11",
"prisma": "^5.8.0",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
},
"engines": {
"node": "^18.18.2 || ^20.0.0",
"pnpm": ">=8"
},
"packageManager": "pnpm@8.12.1"
"packageManager": "pnpm@8.14.1+sha256.2df78e65d433d7693b9d3fbdaf431b2d96bb4f96a2ffecd51a50efe16e50a6a8"
}
Loading

0 comments on commit 01297d8

Please sign in to comment.