From 413eb803bf946a3a426050681d5d75dd34417947 Mon Sep 17 00:00:00 2001 From: "m.farbod" Date: Fri, 29 Jul 2022 15:50:15 +0430 Subject: [PATCH 1/4] fixing fork --- .gitignore | 36 + Components/Footer/Footer.tsx | 43 + Components/Footer/index.d.ts | 0 Components/Footer/index.ts | 1 + Components/Header/Header.tsx | 7 + Components/Header/index.d.ts | 0 Components/Header/index.ts | 1 + Components/Layout/Layout.tsx | 16 + Components/Layout/index.d.ts | 3 + Components/Layout/index.ts | 1 + Components/MatchesScore/MatchesScore.tsx | 28 + .../DateSelect/DateSelect.tsx | 7 + .../DateSelect/index.d.ts | 0 .../DateSelect/index.ts | 1 + .../ResultSearch/ResultSearch.tsx | 7 + .../ResultSearch/index.d.ts | 0 .../ResultSearch/index.ts | 1 + .../SingleLeagueContainer.tsx | 50 ++ .../SingleLeagueContainer/index.d.ts | 5 + .../SingleLeagueContainer/index.ts | 1 + .../SingleMatchResult/SingleMatchResult.tsx | 34 + .../SingleMatchResult/index.d.ts | 4 + .../SingleMatchResult/index.ts | 1 + .../TabScroll/TabScroll.tsx | 7 + .../TabScroll/index.d.ts | 0 .../MatchesScoreComponents/TabScroll/index.ts | 1 + Components/MatchesScore/index.d.ts | 4 + Components/MatchesScore/index.ts | 1 + next.config.js | 4 + package.json | 23 + pages/_app.tsx | 15 + pages/api/hello.ts | 13 + pages/explore.tsx | 7 + pages/footban.tsx | 7 + pages/index.tsx | 16 + pages/leagues.tsx | 7 + pages/matches.tsx | 38 + pages/profile.tsx | 7 + postcss.config.js | 6 + public/favicon.ico | Bin 0 -> 15086 bytes public/vercel.svg | 4 + styles/globals.css | 9 + tailwind.config.js | 17 + tsconfig.json | 20 + yarn.lock | 743 ++++++++++++++++++ 45 files changed, 1196 insertions(+) create mode 100644 .gitignore create mode 100644 Components/Footer/Footer.tsx create mode 100644 Components/Footer/index.d.ts create mode 100644 Components/Footer/index.ts create mode 100644 Components/Header/Header.tsx create mode 100644 Components/Header/index.d.ts create mode 100644 Components/Header/index.ts create mode 100644 Components/Layout/Layout.tsx create mode 100644 Components/Layout/index.d.ts create mode 100644 Components/Layout/index.ts create mode 100644 Components/MatchesScore/MatchesScore.tsx create mode 100644 Components/MatchesScore/MatchesScoreComponents/DateSelect/DateSelect.tsx create mode 100644 Components/MatchesScore/MatchesScoreComponents/DateSelect/index.d.ts create mode 100644 Components/MatchesScore/MatchesScoreComponents/DateSelect/index.ts create mode 100644 Components/MatchesScore/MatchesScoreComponents/ResultSearch/ResultSearch.tsx create mode 100644 Components/MatchesScore/MatchesScoreComponents/ResultSearch/index.d.ts create mode 100644 Components/MatchesScore/MatchesScoreComponents/ResultSearch/index.ts create mode 100644 Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/SingleLeagueContainer.tsx create mode 100644 Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/index.d.ts create mode 100644 Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/index.ts create mode 100644 Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/SingleMatchResult.tsx create mode 100644 Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/index.d.ts create mode 100644 Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/index.ts create mode 100644 Components/MatchesScore/MatchesScoreComponents/TabScroll/TabScroll.tsx create mode 100644 Components/MatchesScore/MatchesScoreComponents/TabScroll/index.d.ts create mode 100644 Components/MatchesScore/MatchesScoreComponents/TabScroll/index.ts create mode 100644 Components/MatchesScore/index.d.ts create mode 100644 Components/MatchesScore/index.ts create mode 100644 next.config.js create mode 100644 package.json create mode 100644 pages/_app.tsx create mode 100644 pages/api/hello.ts create mode 100644 pages/explore.tsx create mode 100644 pages/footban.tsx create mode 100644 pages/index.tsx create mode 100644 pages/leagues.tsx create mode 100644 pages/matches.tsx create mode 100644 pages/profile.tsx create mode 100644 postcss.config.js create mode 100644 public/favicon.ico create mode 100644 public/vercel.svg create mode 100644 styles/globals.css create mode 100644 tailwind.config.js create mode 100644 tsconfig.json create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..c87c9b39 --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/Components/Footer/Footer.tsx b/Components/Footer/Footer.tsx new file mode 100644 index 00000000..28565e97 --- /dev/null +++ b/Components/Footer/Footer.tsx @@ -0,0 +1,43 @@ +import React from "react"; +import { BiUser, BiFootball, BiTrophy } from "react-icons/bi"; +import { MdOutlineExplore } from "react-icons/md"; +import { GiTennisCourt } from "react-icons/gi"; +import Link from "next/link"; +import { useRouter } from "next/router"; + +const Footer = () => { + const { route: activeRoute } = useRouter(); + const footerArray = [ + { route: "/matches", persianName: "مسابقات", icon: }, + { route: "/explore", persianName: "اکتشاف", icon: }, + { route: "/footban", persianName: "فوتبان", icon: }, + { route: "/leagues", persianName: "لیگ‌ها", icon: }, + { route: "/profile", persianName: "پروفایل", icon: }, + ]; + + return ( +
+
+ {footerArray.map((item) => { + const { route, persianName, icon } = item; + return ( + +
+
{icon}
+
{persianName}
+
+ + ); + })} +
+
+ ); +}; + +export default Footer; diff --git a/Components/Footer/index.d.ts b/Components/Footer/index.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/Components/Footer/index.ts b/Components/Footer/index.ts new file mode 100644 index 00000000..3738288b --- /dev/null +++ b/Components/Footer/index.ts @@ -0,0 +1 @@ +export { default } from "./Footer"; diff --git a/Components/Header/Header.tsx b/Components/Header/Header.tsx new file mode 100644 index 00000000..188bca9c --- /dev/null +++ b/Components/Header/Header.tsx @@ -0,0 +1,7 @@ +import React from "react"; + +const Header = () => { + return
Header
; +}; + +export default Header; diff --git a/Components/Header/index.d.ts b/Components/Header/index.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/Components/Header/index.ts b/Components/Header/index.ts new file mode 100644 index 00000000..2764567d --- /dev/null +++ b/Components/Header/index.ts @@ -0,0 +1 @@ +export { default } from "./Header"; diff --git a/Components/Layout/Layout.tsx b/Components/Layout/Layout.tsx new file mode 100644 index 00000000..6c78334a --- /dev/null +++ b/Components/Layout/Layout.tsx @@ -0,0 +1,16 @@ +import { FC } from "react"; +import { LayoutProps } from "./index.d"; +import Header from "../Header"; +import Footer from "../Footer"; + +const Layout: FC = ({ children }) => { + return ( +
+
+
{children}
+
+
+ ); +}; + +export default Layout; diff --git a/Components/Layout/index.d.ts b/Components/Layout/index.d.ts new file mode 100644 index 00000000..d5583141 --- /dev/null +++ b/Components/Layout/index.d.ts @@ -0,0 +1,3 @@ +export type LayoutProps = { + children: any; +}; diff --git a/Components/Layout/index.ts b/Components/Layout/index.ts new file mode 100644 index 00000000..d4dca0dc --- /dev/null +++ b/Components/Layout/index.ts @@ -0,0 +1 @@ +export { default } from "./Layout"; diff --git a/Components/MatchesScore/MatchesScore.tsx b/Components/MatchesScore/MatchesScore.tsx new file mode 100644 index 00000000..89601cec --- /dev/null +++ b/Components/MatchesScore/MatchesScore.tsx @@ -0,0 +1,28 @@ +import React, { FC } from "react"; +import { MatchesScoreProps } from "./index.d"; +import ResultSearch from "./MatchesScoreComponents/ResultSearch"; +import SingleLeagueContainer from "./MatchesScoreComponents/SingleLeagueContainer"; + +const MatchesScore: FC = ({ fixtures, leagues }) => { + return ( +
+
+
Live Results
+
+ +
+
tabs
+
+ +
+ {leagues.map((item: string) => { + return ( + + ); + })} +
+
+ ); +}; + +export default MatchesScore; diff --git a/Components/MatchesScore/MatchesScoreComponents/DateSelect/DateSelect.tsx b/Components/MatchesScore/MatchesScoreComponents/DateSelect/DateSelect.tsx new file mode 100644 index 00000000..ee7f8107 --- /dev/null +++ b/Components/MatchesScore/MatchesScoreComponents/DateSelect/DateSelect.tsx @@ -0,0 +1,7 @@ +import React from "react"; + +const DateSelect = () => { + return
DateSelect
; +}; + +export default DateSelect; diff --git a/Components/MatchesScore/MatchesScoreComponents/DateSelect/index.d.ts b/Components/MatchesScore/MatchesScoreComponents/DateSelect/index.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/Components/MatchesScore/MatchesScoreComponents/DateSelect/index.ts b/Components/MatchesScore/MatchesScoreComponents/DateSelect/index.ts new file mode 100644 index 00000000..72e7a88a --- /dev/null +++ b/Components/MatchesScore/MatchesScoreComponents/DateSelect/index.ts @@ -0,0 +1 @@ +export { default } from "./DateSelect"; diff --git a/Components/MatchesScore/MatchesScoreComponents/ResultSearch/ResultSearch.tsx b/Components/MatchesScore/MatchesScoreComponents/ResultSearch/ResultSearch.tsx new file mode 100644 index 00000000..2863a08c --- /dev/null +++ b/Components/MatchesScore/MatchesScoreComponents/ResultSearch/ResultSearch.tsx @@ -0,0 +1,7 @@ +import React from "react"; + +const ResultSearch = () => { + return
ResultSearch
; +}; + +export default ResultSearch; diff --git a/Components/MatchesScore/MatchesScoreComponents/ResultSearch/index.d.ts b/Components/MatchesScore/MatchesScoreComponents/ResultSearch/index.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/Components/MatchesScore/MatchesScoreComponents/ResultSearch/index.ts b/Components/MatchesScore/MatchesScoreComponents/ResultSearch/index.ts new file mode 100644 index 00000000..2eba6e0d --- /dev/null +++ b/Components/MatchesScore/MatchesScoreComponents/ResultSearch/index.ts @@ -0,0 +1 @@ +export { default } from "./ResultSearch"; diff --git a/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/SingleLeagueContainer.tsx b/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/SingleLeagueContainer.tsx new file mode 100644 index 00000000..ed2ada4a --- /dev/null +++ b/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/SingleLeagueContainer.tsx @@ -0,0 +1,50 @@ +import React, { FC, useEffect, useState } from "react"; +import { SingleLeagueProps } from "./index.d"; +import { AiOutlineDown, AiOutlineUp } from "react-icons/ai"; +import SingleMatchResult from "../SingleMatchResult"; + +const SingleLeagueContainer: FC = ({ + fixtures, + leagueName, +}) => { + const [leagueMatches, setLeagueMatches] = useState([]); + const [showResults, setShowResults] = useState(false); + useEffect(() => { + const filteredLeague = fixtures.filter( + (item: any) => item.league.name === leagueName + ); + setLeagueMatches(filteredLeague); + }, []); + + return ( +
+
+
+
+ {/* @ts-ignore */} + {leagueName} +
+
{leagueName}
+
+
setShowResults((prevState) => !prevState)} + > + {showResults ? : } +
+
+ {showResults && ( +
+ {leagueMatches.map((item: any) => { + const { teams, score, fixture } = item; + return ( + + ); + })} +
+ )} +
+ ); +}; + +export default SingleLeagueContainer; diff --git a/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/index.d.ts b/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/index.d.ts new file mode 100644 index 00000000..64e362c0 --- /dev/null +++ b/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/index.d.ts @@ -0,0 +1,5 @@ +export type SingleLeagueProps = { + fixtures: any; + leagueName: string; + src?: string | undefined; +}; diff --git a/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/index.ts b/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/index.ts new file mode 100644 index 00000000..cd8ca6d7 --- /dev/null +++ b/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/index.ts @@ -0,0 +1 @@ +export { default } from "./SingleLeagueContainer"; diff --git a/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/SingleMatchResult.tsx b/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/SingleMatchResult.tsx new file mode 100644 index 00000000..1d7689c7 --- /dev/null +++ b/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/SingleMatchResult.tsx @@ -0,0 +1,34 @@ +import React, { FC } from "react"; +import { SingleMatchResultProps } from "./index.d"; + +const SingleMatchResult: FC = ({ teams, score }) => { + return ( +
+
+
{teams.home.name.substr(0, 8)}
+
+ {teams.home.name} +
+
+
+ {score.fulltime.home}:{score.fulltime.away} +
+
+
+ {teams.away.name} +
+
{teams.away.name.substr(0, 8)}
+
+
+ ); +}; + +export default SingleMatchResult; diff --git a/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/index.d.ts b/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/index.d.ts new file mode 100644 index 00000000..5357a444 --- /dev/null +++ b/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/index.d.ts @@ -0,0 +1,4 @@ +export type SingleMatchResultProps = { + teams: any; + score: any; +}; diff --git a/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/index.ts b/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/index.ts new file mode 100644 index 00000000..15b7526e --- /dev/null +++ b/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/index.ts @@ -0,0 +1 @@ +export { default } from "./SingleMatchResult"; diff --git a/Components/MatchesScore/MatchesScoreComponents/TabScroll/TabScroll.tsx b/Components/MatchesScore/MatchesScoreComponents/TabScroll/TabScroll.tsx new file mode 100644 index 00000000..63d32ec3 --- /dev/null +++ b/Components/MatchesScore/MatchesScoreComponents/TabScroll/TabScroll.tsx @@ -0,0 +1,7 @@ +import React from "react"; + +const TabScroll = () => { + return
TabScroll
; +}; + +export default TabScroll; diff --git a/Components/MatchesScore/MatchesScoreComponents/TabScroll/index.d.ts b/Components/MatchesScore/MatchesScoreComponents/TabScroll/index.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/Components/MatchesScore/MatchesScoreComponents/TabScroll/index.ts b/Components/MatchesScore/MatchesScoreComponents/TabScroll/index.ts new file mode 100644 index 00000000..546f5540 --- /dev/null +++ b/Components/MatchesScore/MatchesScoreComponents/TabScroll/index.ts @@ -0,0 +1 @@ +export { default } from "./TabScroll"; diff --git a/Components/MatchesScore/index.d.ts b/Components/MatchesScore/index.d.ts new file mode 100644 index 00000000..ad7d3082 --- /dev/null +++ b/Components/MatchesScore/index.d.ts @@ -0,0 +1,4 @@ +export type MatchesScoreProps = { + fixtures: any; + leagues: string[]; +}; diff --git a/Components/MatchesScore/index.ts b/Components/MatchesScore/index.ts new file mode 100644 index 00000000..f7d181dd --- /dev/null +++ b/Components/MatchesScore/index.ts @@ -0,0 +1 @@ +export { default } from "./MatchesScore"; diff --git a/next.config.js b/next.config.js new file mode 100644 index 00000000..8b61df4e --- /dev/null +++ b/next.config.js @@ -0,0 +1,4 @@ +/** @type {import('next').NextConfig} */ +module.exports = { + reactStrictMode: true, +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..2e020604 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start" + }, + "dependencies": { + "next": "latest", + "react": "18.1.0", + "react-dom": "18.1.0", + "react-icons": "^4.4.0" + }, + "devDependencies": { + "@types/node": "17.0.35", + "@types/react": "18.0.9", + "@types/react-dom": "18.0.5", + "autoprefixer": "^10.4.7", + "postcss": "^8.4.14", + "tailwindcss": "^3.1.2", + "typescript": "4.7.2" + } +} diff --git a/pages/_app.tsx b/pages/_app.tsx new file mode 100644 index 00000000..97e213f5 --- /dev/null +++ b/pages/_app.tsx @@ -0,0 +1,15 @@ +import "../styles/globals.css"; +import type { AppProps } from "next/app"; +import Layout from "../Components/Layout"; + +function MyApp({ Component, pageProps }: AppProps) { + return ( +
+ + + +
+ ); +} + +export default MyApp; diff --git a/pages/api/hello.ts b/pages/api/hello.ts new file mode 100644 index 00000000..f8bcc7e5 --- /dev/null +++ b/pages/api/hello.ts @@ -0,0 +1,13 @@ +// Next.js API route support: https://nextjs.org/docs/api-routes/introduction +import type { NextApiRequest, NextApiResponse } from 'next' + +type Data = { + name: string +} + +export default function handler( + req: NextApiRequest, + res: NextApiResponse +) { + res.status(200).json({ name: 'John Doe' }) +} diff --git a/pages/explore.tsx b/pages/explore.tsx new file mode 100644 index 00000000..d84ff5b9 --- /dev/null +++ b/pages/explore.tsx @@ -0,0 +1,7 @@ +import React from "react"; + +const Explore = () => { + return
Explore
; +}; + +export default Explore; diff --git a/pages/footban.tsx b/pages/footban.tsx new file mode 100644 index 00000000..223e018f --- /dev/null +++ b/pages/footban.tsx @@ -0,0 +1,7 @@ +import React from "react"; + +const Footban = () => { + return
Footban
; +}; + +export default Footban; diff --git a/pages/index.tsx b/pages/index.tsx new file mode 100644 index 00000000..98ebdba3 --- /dev/null +++ b/pages/index.tsx @@ -0,0 +1,16 @@ +import type { NextPage } from "next"; +import Head from "next/head"; + +const Home: NextPage = () => { + return ( +
+ + React Footballi + + +
Welcome! please click on a tab in footer
+
+ ); +}; + +export default Home; diff --git a/pages/leagues.tsx b/pages/leagues.tsx new file mode 100644 index 00000000..ebed9073 --- /dev/null +++ b/pages/leagues.tsx @@ -0,0 +1,7 @@ +import React from "react"; + +const Leagues = () => { + return
Leagues
; +}; + +export default Leagues; diff --git a/pages/matches.tsx b/pages/matches.tsx new file mode 100644 index 00000000..44e4fe91 --- /dev/null +++ b/pages/matches.tsx @@ -0,0 +1,38 @@ +import React, { useEffect, useState } from "react"; +import MatchesScore from "../Components/MatchesScore"; + +const Matches = () => { + const [fixtures, setFixtures] = useState([]); + const [leagues, setLeagues] = useState([]); + + useEffect(() => { + fetch("https://v3.football.api-sports.io/fixtures?date=2022-07-29", { + method: "GET", + headers: { + "x-rapidapi-host": "v3.football.api-sports.io", + "x-rapidapi-key": "bab104d7215beb3aa15b4edce909daa3", + }, + }) + .then((response) => response.json()) + .then((data) => { + const allFixtures = data.response; + setFixtures(allFixtures); + + //extract unique league names + const league: any = []; + allFixtures.forEach((item: any) => { + if (!league.includes(item.league.name)) { + league.push(item.league.name); + } + }); + setLeagues(league); + }) + .catch((err) => { + console.log(err); + }); + }, []); + + return ; +}; + +export default Matches; diff --git a/pages/profile.tsx b/pages/profile.tsx new file mode 100644 index 00000000..5371372b --- /dev/null +++ b/pages/profile.tsx @@ -0,0 +1,7 @@ +import React from "react"; + +const Profile = () => { + return
Profile
; +}; + +export default Profile; diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 00000000..33ad091d --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..4965832f2c9b0605eaa189b7c7fb11124d24e48a GIT binary patch literal 15086 zcmeHOOH5Q(7(R0cc?bh2AT>N@1PWL!LLfZKyG5c!MTHoP7_p!sBz0k$?pjS;^lmgJ zU6^i~bWuZYHL)9$wuvEKm~qo~(5=Lvx5&Hv;?X#m}i|`yaGY4gX+&b>tew;gcnRQA1kp zBbm04SRuuE{Hn+&1wk%&g;?wja_Is#1gKoFlI7f`Gt}X*-nsMO30b_J@)EFNhzd1QM zdH&qFb9PVqQOx@clvc#KAu}^GrN`q5oP(8>m4UOcp`k&xwzkTio*p?kI4BPtIwX%B zJN69cGsm=x90<;Wmh-bs>43F}ro$}Of@8)4KHndLiR$nW?*{Rl72JPUqRr3ta6e#A z%DTEbi9N}+xPtd1juj8;(CJt3r9NOgb>KTuK|z7!JB_KsFW3(pBN4oh&M&}Nb$Ee2 z$-arA6a)CdsPj`M#1DS>fqj#KF%0q?w50GN4YbmMZIoF{e1yTR=4ablqXHBB2!`wM z1M1ke9+<);|AI;f=2^F1;G6Wfpql?1d5D4rMr?#f(=hkoH)U`6Gb)#xDLjoKjp)1;Js@2Iy5yk zMXUqj+gyk1i0yLjWS|3sM2-1ECc;MAz<4t0P53%7se$$+5Ex`L5TQO_MMXXi04UDIU+3*7Ez&X|mj9cFYBXqM{M;mw_ zpw>azP*qjMyNSD4hh)XZt$gqf8f?eRSFX8VQ4Y+H3jAtvyTrXr`qHAD6`m;aYmH2zOhJC~_*AuT} zvUxC38|JYN94i(05R)dVKgUQF$}#cxV7xZ4FULqFCNX*Forhgp*yr6;DsIk=ub0Hv zpk2L{9Q&|uI^b<6@i(Y+iSxeO_n**4nRLc`P!3ld5jL=nZRw6;DEJ*1z6Pvg+eW|$lnnjO zjd|8>6l{i~UxI244CGn2kK@cJ|#ecwgSyt&HKA2)z zrOO{op^o*- + + \ No newline at end of file diff --git a/styles/globals.css b/styles/globals.css new file mode 100644 index 00000000..b5c829e2 --- /dev/null +++ b/styles/globals.css @@ -0,0 +1,9 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 00000000..0aea35ff --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,17 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: [ + "./pages/**/*.{js,ts,jsx,tsx}", + "./components/**/*.{js,ts,jsx,tsx}", + ], + theme: { + minHeight: { + 400: "400px", + }, + maxHeight: { + 500: "500px", + }, + extend: {}, + }, + plugins: [], +}; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..99710e85 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000..33c59f03 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,743 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@next/env@12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@next/env/-/env-12.2.3.tgz#64f210e74c137d3d9feea738795b055a7f8aebe2" + integrity sha512-2lWKP5Xcvnor70NaaROZXBvU8z9mFReePCG8NhZw6NyNGnPvC+8s+Cre/63LAB1LKzWw/e9bZJnQUg0gYFRb2Q== + +"@next/swc-android-arm-eabi@12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.2.3.tgz#91388c8ec117d59ee80d2c1d4dc65fdfd267d2d4" + integrity sha512-JxmCW9XB5PYnkGE67BdnBTdqW0SW6oMCiPMHLdjeRi4T3U4JJKJGnjQld99+6TPOfPWigtw3W7Cijp5gc+vJ/w== + +"@next/swc-android-arm64@12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-12.2.3.tgz#9be33553861f6494616b910a23abd5a1b0d7fb4b" + integrity sha512-3l4zXpWnzy0fqoedsFRxzMy/eGlMMqn6IwPEuBmtEQ4h7srmQFHyT+Bk+eVHb0o1RQ7/TloAa+mu8JX5tz/5tA== + +"@next/swc-darwin-arm64@12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.2.3.tgz#ce1a5a7320936b2644b765ace3283e5d1676b6a0" + integrity sha512-eutDO/RH6pf7+8zHo3i2GKLhF0qaMtxWpY8k3Oa1k+CyrcJ0IxwkfH/x3f75jTMeCrThn6Uu8j3WeZOxvhto1Q== + +"@next/swc-darwin-x64@12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-12.2.3.tgz#f70ce07016501c6f823035bc67296b8f80201145" + integrity sha512-lve+lnTiddXbcT3Lh2ujOFywQSEycTYQhuf6j6JrPu9oLQGS01kjIqqSj3/KMmSoppEnXo3BxkgYu+g2+ecHkA== + +"@next/swc-freebsd-x64@12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.2.3.tgz#ccc6fa4588dadec85458091aa19c17bc3e99a10d" + integrity sha512-V4bZU1qBFkULTPW53phY8ypioh3EERzHu9YKAasm9RxU4dj+8c/4s60y+kbFkFEEpIUgEU6yNuYZRR4lHHbUGA== + +"@next/swc-linux-arm-gnueabihf@12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.2.3.tgz#d7a481d3ede14dee85707d0807b4a05cd2300950" + integrity sha512-MWxS/i+XSEKdQE0ZmdYkPPrWKBi4JwMVaXdOW9J/T/sZJsHsLlSC9ErBcNolKAJEVka+tnw9oPRyRCKOj+q0sw== + +"@next/swc-linux-arm64-gnu@12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.2.3.tgz#6d105c971cc0957c25563aa98af475291b4cd8aa" + integrity sha512-ikXkqAmvEcWTzIQFDdmrUHLWzdDAF5s2pVsSpQn9rk/gK1i9webH1GRQd2bSM7JLuPBZSaYrNGvDTyHZdSEYlg== + +"@next/swc-linux-arm64-musl@12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.2.3.tgz#bebfe490130e3cb8746a03d35a5a9e23ac0e6f9b" + integrity sha512-wE45gGFkeLLLnCoveKaBrdpYkkypl3qwNF2YhnfvfVK7etuu1O679LwClhCWinDVBr+KOkmyHok00Z+0uI1ycg== + +"@next/swc-linux-x64-gnu@12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.2.3.tgz#84a3d99f9d656fbc139f3a19f9b1baf73877d18f" + integrity sha512-MbFI6413VSXiREzHwYD8YAJLTknBaC+bmjXgdHEEdloeOuBFQGE3NWn3izOCTy8kV+s98VDQO8au7EKKs+bW0g== + +"@next/swc-linux-x64-musl@12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.2.3.tgz#a283431f8c6c830b4bd61147094f150ea7deeb6e" + integrity sha512-jMBD0Va6fInbPih/dNySlNY2RpjkK6MXS+UGVEvuTswl1MZr+iahvurmshwGKpjaRwVU4DSFMD8+gfWxsTFs1Q== + +"@next/swc-win32-arm64-msvc@12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.2.3.tgz#bab9ba8736d81db128badb70024268469eaa9b34" + integrity sha512-Cq8ToPdc0jQP2C7pjChYctAsEe7+lO/B826ZCK5xFzobuHPiCyJ2Mzx/nEQwCY4SpYkeJQtCbwlCz5iyGW5zGg== + +"@next/swc-win32-ia32-msvc@12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.2.3.tgz#feea6ada1ba3e897f39ded9f2de5006f4e1c928b" + integrity sha512-BtFq4c8IpeB0sDhJMHJFgm86rPkOvmYI8k3De8Y2kgNVWSeLQ0Q929PWf7e+GqcX1015ei/gEB41ZH8Iw49NzA== + +"@next/swc-win32-x64-msvc@12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.2.3.tgz#403e1575a84c31cbd7f3c0ecd51b61bc25b7f808" + integrity sha512-huSNb98KSG77Kl96CoPgCwom28aamuUsPpRmn/4s9L0RNbbHVSkp9E6HA4yOAykZCEuWcdNsRLbVVuAbt8rtIw== + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@swc/helpers@0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.3.tgz#16593dfc248c53b699d4b5026040f88ddb497012" + integrity sha512-6JrF+fdUK2zbGpJIlN7G3v966PQjyx/dPt1T9km2wj+EUBqgrxCk3uX4Kct16MIm9gGxfKRcfax2hVf5jvlTzA== + dependencies: + tslib "^2.4.0" + +"@types/node@17.0.35": + version "17.0.35" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.35.tgz#635b7586086d51fb40de0a2ec9d1014a5283ba4a" + integrity sha512-vu1SrqBjbbZ3J6vwY17jBs8Sr/BKA+/a/WtjRG+whKg1iuLFOosq872EXS0eXWILdO36DHQQeku/ZcL6hz2fpg== + +"@types/prop-types@*": + version "15.7.5" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" + integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w== + +"@types/react-dom@18.0.5": + version "18.0.5" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.5.tgz#330b2d472c22f796e5531446939eacef8378444a" + integrity sha512-OWPWTUrY/NIrjsAPkAk1wW9LZeIjSvkXRhclsFO8CZcZGCOg2G0YZy4ft+rOyYxy8B7ui5iZzi9OkDebZ7/QSA== + dependencies: + "@types/react" "*" + +"@types/react@*": + version "18.0.15" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe" + integrity sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + +"@types/react@18.0.9": + version "18.0.9" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.9.tgz#d6712a38bd6cd83469603e7359511126f122e878" + integrity sha512-9bjbg1hJHUm4De19L1cHiW0Jvx3geel6Qczhjd0qY5VKVE2X5+x77YxAepuCwVh4vrgZJdgEJw48zrhRIeF4Nw== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + +"@types/scheduler@*": + version "0.16.2" + resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" + integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== + +acorn-node@^1.8.2: + version "1.8.2" + resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.8.2.tgz#114c95d64539e53dede23de8b9d96df7c7ae2af8" + integrity sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A== + dependencies: + acorn "^7.0.0" + acorn-walk "^7.0.0" + xtend "^4.0.2" + +acorn-walk@^7.0.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" + integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== + +acorn@^7.0.0: + version "7.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" + integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== + +anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +arg@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.2.tgz#c81433cc427c92c4dcf4865142dbca6f15acd59c" + integrity sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +autoprefixer@^10.4.7: + version "10.4.7" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.7.tgz#1db8d195f41a52ca5069b7593be167618edbbedf" + integrity sha512-ypHju4Y2Oav95SipEcCcI5J7CGPuvz8oat7sUtYj3ClK44bldfvtvcxK6IEK++7rqB7YchDGzweZIBG+SD0ZAA== + dependencies: + browserslist "^4.20.3" + caniuse-lite "^1.0.30001335" + fraction.js "^4.2.0" + normalize-range "^0.1.2" + picocolors "^1.0.0" + postcss-value-parser "^4.2.0" + +axios@^0.27.2: + version "0.27.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" + integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== + dependencies: + follow-redirects "^1.14.9" + form-data "^4.0.0" + +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +braces@^3.0.2, braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +browserslist@^4.20.3: + version "4.21.3" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.3.tgz#5df277694eb3c48bc5c4b05af3e8b7e09c5a6d1a" + integrity sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ== + dependencies: + caniuse-lite "^1.0.30001370" + electron-to-chromium "^1.4.202" + node-releases "^2.0.6" + update-browserslist-db "^1.0.5" + +camelcase-css@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5" + integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== + +caniuse-lite@^1.0.30001332, caniuse-lite@^1.0.30001335, caniuse-lite@^1.0.30001370: + version "1.0.30001373" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001373.tgz#2dc3bc3bfcb5d5a929bec11300883040d7b4b4be" + integrity sha512-pJYArGHrPp3TUqQzFYRmP/lwJlj8RCbVe3Gd3eJQkAV8SAC6b19XS9BjMvRdvaS8RMkaTN8ZhoHP6S1y8zzwEQ== + +chokidar@^3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +color-name@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +cssesc@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" + integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== + +csstype@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.0.tgz#4ddcac3718d787cf9df0d1b7d15033925c8f29f2" + integrity sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA== + +defined@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + integrity sha512-Y2caI5+ZwS5c3RiNDJ6u53VhQHv+hHKwhkI1iHvceKUHw9Df6EK2zRLfjejRgMuCuxK7PfSWIMwWecceVvThjQ== + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +detective@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/detective/-/detective-5.2.1.tgz#6af01eeda11015acb0e73f933242b70f24f91034" + integrity sha512-v9XE1zRnz1wRtgurGu0Bs8uHKFSTdteYZNbIPFVhUZ39L/S79ppMpdmVOZAnoz1jfEFodc48n6MX483Xo3t1yw== + dependencies: + acorn-node "^1.8.2" + defined "^1.0.0" + minimist "^1.2.6" + +didyoumean@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.2.tgz#989346ffe9e839b4555ecf5666edea0d3e8ad037" + integrity sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw== + +dlv@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79" + integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA== + +electron-to-chromium@^1.4.202: + version "1.4.204" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.204.tgz#aae069adea642c066ea95faf5121262b0842e262" + integrity sha512-5Ojjtw9/c9HCXtMVE6SXVSHSNjmbFOXpKprl6mY/5moLSxLeWatuYA7KTD+RzJMxLRH6yNNQrqGz9p6IoNBMgw== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +fast-glob@^3.2.11: + version "3.2.11" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" + integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + +fastq@^1.6.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + dependencies: + reusify "^1.0.4" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +follow-redirects@^1.14.9: + version "1.15.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5" + integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +fraction.js@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.2.0.tgz#448e5109a313a3527f5a3ab2119ec4cf0e0e2950" + integrity sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA== + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +glob-parent@^5.1.2, glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-core-module@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69" + integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A== + dependencies: + has "^1.0.3" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +lilconfig@^2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.6.tgz#32a384558bd58af3d4c6e077dd1ad1d397bc69d4" + integrity sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg== + +loose-envify@^1.1.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +minimist@^1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== + +nanoid@^3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" + integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== + +next@latest: + version "12.2.3" + resolved "https://registry.yarnpkg.com/next/-/next-12.2.3.tgz#c29d235ce480e589894dfab3120dade25d015a22" + integrity sha512-TA0tmSA6Dk6S6kfvCNbF7CWYW8468gZUxr/3/30z4KvAQbXnl2ASYZElVe7q/hBW/1F1ee0tSBlHa4/sn+ZIBw== + dependencies: + "@next/env" "12.2.3" + "@swc/helpers" "0.4.3" + caniuse-lite "^1.0.30001332" + postcss "8.4.14" + styled-jsx "5.0.2" + use-sync-external-store "1.2.0" + optionalDependencies: + "@next/swc-android-arm-eabi" "12.2.3" + "@next/swc-android-arm64" "12.2.3" + "@next/swc-darwin-arm64" "12.2.3" + "@next/swc-darwin-x64" "12.2.3" + "@next/swc-freebsd-x64" "12.2.3" + "@next/swc-linux-arm-gnueabihf" "12.2.3" + "@next/swc-linux-arm64-gnu" "12.2.3" + "@next/swc-linux-arm64-musl" "12.2.3" + "@next/swc-linux-x64-gnu" "12.2.3" + "@next/swc-linux-x64-musl" "12.2.3" + "@next/swc-win32-arm64-msvc" "12.2.3" + "@next/swc-win32-ia32-msvc" "12.2.3" + "@next/swc-win32-x64-msvc" "12.2.3" + +node-releases@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" + integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +normalize-range@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" + integrity sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA== + +object-hash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9" + integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw== + +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +pify@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== + +postcss-import@^14.1.0: + version "14.1.0" + resolved "https://registry.yarnpkg.com/postcss-import/-/postcss-import-14.1.0.tgz#a7333ffe32f0b8795303ee9e40215dac922781f0" + integrity sha512-flwI+Vgm4SElObFVPpTIT7SU7R3qk2L7PyduMcokiaVKuWv9d/U+Gm/QAd8NDLuykTWTkcrjOeD2Pp1rMeBTGw== + dependencies: + postcss-value-parser "^4.0.0" + read-cache "^1.0.0" + resolve "^1.1.7" + +postcss-js@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-js/-/postcss-js-4.0.0.tgz#31db79889531b80dc7bc9b0ad283e418dce0ac00" + integrity sha512-77QESFBwgX4irogGVPgQ5s07vLvFqWr228qZY+w6lW599cRlK/HmnlivnnVUxkjHnCu4J16PDMHcH+e+2HbvTQ== + dependencies: + camelcase-css "^2.0.1" + +postcss-load-config@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-3.1.4.tgz#1ab2571faf84bb078877e1d07905eabe9ebda855" + integrity sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg== + dependencies: + lilconfig "^2.0.5" + yaml "^1.10.2" + +postcss-nested@5.0.6: + version "5.0.6" + resolved "https://registry.yarnpkg.com/postcss-nested/-/postcss-nested-5.0.6.tgz#466343f7fc8d3d46af3e7dba3fcd47d052a945bc" + integrity sha512-rKqm2Fk0KbA8Vt3AdGN0FB9OBOMDVajMG6ZCf/GoHgdxUJ4sBFp0A/uMIRm+MJUdo33YXEtjqIz8u7DAp8B7DA== + dependencies: + postcss-selector-parser "^6.0.6" + +postcss-selector-parser@^6.0.10, postcss-selector-parser@^6.0.6: + version "6.0.10" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz#79b61e2c0d1bfc2602d549e11d0876256f8df88d" + integrity sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w== + dependencies: + cssesc "^3.0.0" + util-deprecate "^1.0.2" + +postcss-value-parser@^4.0.0, postcss-value-parser@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" + integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== + +postcss@8.4.14, postcss@^8.4.14: + version "8.4.14" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" + integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== + dependencies: + nanoid "^3.3.4" + picocolors "^1.0.0" + source-map-js "^1.0.2" + +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +quick-lru@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" + integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== + +react-dom@18.1.0: + version "18.1.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.1.0.tgz#7f6dd84b706408adde05e1df575b3a024d7e8a2f" + integrity sha512-fU1Txz7Budmvamp7bshe4Zi32d0ll7ect+ccxNu9FlObT605GOEB8BfO4tmRJ39R5Zj831VCpvQ05QPBW5yb+w== + dependencies: + loose-envify "^1.1.0" + scheduler "^0.22.0" + +react-icons@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.4.0.tgz#a13a8a20c254854e1ec9aecef28a95cdf24ef703" + integrity sha512-fSbvHeVYo/B5/L4VhB7sBA1i2tS8MkT0Hb9t2H1AVPkwGfVHLJCqyr2Py9dKMxsyM63Eng1GkdZfbWj+Fmv8Rg== + +react@18.1.0: + version "18.1.0" + resolved "https://registry.yarnpkg.com/react/-/react-18.1.0.tgz#6f8620382decb17fdc5cc223a115e2adbf104890" + integrity sha512-4oL8ivCz5ZEPyclFQXaNksK3adutVS8l2xzZU0cqEFrE9Sb7fC0EFK5uEk74wIreL1DERyjvsU915j1pcT2uEQ== + dependencies: + loose-envify "^1.1.0" + +read-cache@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/read-cache/-/read-cache-1.0.0.tgz#e664ef31161166c9751cdbe8dbcf86b5fb58f774" + integrity sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA== + dependencies: + pify "^2.3.0" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +resolve@^1.1.7, resolve@^1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +scheduler@^0.22.0: + version "0.22.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.22.0.tgz#83a5d63594edf074add9a7198b1bae76c3db01b8" + integrity sha512-6QAm1BgQI88NPYymgGQLCZgvep4FyePDWFpXVK+zNSUgHwlqpJy8VEh8Et0KxTACS4VWwMousBElAZOH9nkkoQ== + dependencies: + loose-envify "^1.1.0" + +source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== + +styled-jsx@5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.2.tgz#ff230fd593b737e9e68b630a694d460425478729" + integrity sha512-LqPQrbBh3egD57NBcHET4qcgshPks+yblyhPlH2GY8oaDgKs8SK4C3dBh3oSJjgzJ3G5t1SYEZGHkP+QEpX9EQ== + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +tailwindcss@^3.1.2: + version "3.1.6" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.1.6.tgz#bcb719357776c39e6376a8d84e9834b2b19a49f1" + integrity sha512-7skAOY56erZAFQssT1xkpk+kWt2NrO45kORlxFPXUt3CiGsVPhH1smuH5XoDH6sGPXLyBv+zgCKA2HWBsgCytg== + dependencies: + arg "^5.0.2" + chokidar "^3.5.3" + color-name "^1.1.4" + detective "^5.2.1" + didyoumean "^1.2.2" + dlv "^1.1.3" + fast-glob "^3.2.11" + glob-parent "^6.0.2" + is-glob "^4.0.3" + lilconfig "^2.0.5" + normalize-path "^3.0.0" + object-hash "^3.0.0" + picocolors "^1.0.0" + postcss "^8.4.14" + postcss-import "^14.1.0" + postcss-js "^4.0.0" + postcss-load-config "^3.1.4" + postcss-nested "5.0.6" + postcss-selector-parser "^6.0.10" + postcss-value-parser "^4.2.0" + quick-lru "^5.1.1" + resolve "^1.22.1" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +tslib@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== + +typescript@4.7.2: + version "4.7.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.2.tgz#1f9aa2ceb9af87cca227813b4310fff0b51593c4" + integrity sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A== + +update-browserslist-db@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.5.tgz#be06a5eedd62f107b7c19eb5bcefb194411abf38" + integrity sha512-dteFFpCyvuDdr9S/ff1ISkKt/9YZxKjI9WlRR99c180GaztJtRa/fn18FdxGVKVsnPY7/a/FDN68mcvUmP4U7Q== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" + +use-sync-external-store@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" + integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== + +util-deprecate@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + +xtend@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + +yaml@^1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== From a54553088114f2816e67929065d1073483d31ae3 Mon Sep 17 00:00:00 2001 From: "m.farbod" Date: Fri, 29 Jul 2022 17:43:19 +0430 Subject: [PATCH 2/4] Search for teams or leagues added --- Components/MatchesScore/MatchesScore.tsx | 16 ++++-- .../ResultSearch/ResultSearch.tsx | 25 ++++++++- .../ResultSearch/index.d.ts | 4 ++ .../SingleLeagueContainer.tsx | 2 +- Components/MatchesScore/index.d.ts | 2 + pages/matches.tsx | 56 +++++++++++++++++-- 6 files changed, 92 insertions(+), 13 deletions(-) diff --git a/Components/MatchesScore/MatchesScore.tsx b/Components/MatchesScore/MatchesScore.tsx index 89601cec..409ba4ed 100644 --- a/Components/MatchesScore/MatchesScore.tsx +++ b/Components/MatchesScore/MatchesScore.tsx @@ -3,13 +3,21 @@ import { MatchesScoreProps } from "./index.d"; import ResultSearch from "./MatchesScoreComponents/ResultSearch"; import SingleLeagueContainer from "./MatchesScoreComponents/SingleLeagueContainer"; -const MatchesScore: FC = ({ fixtures, leagues }) => { +const MatchesScore: FC = ({ + fixtures, + leagues, + onSearchHandler, + searchField, +}) => { return (
-
Live Results
-
- +
نتایج زنده
+
+
tabs
diff --git a/Components/MatchesScore/MatchesScoreComponents/ResultSearch/ResultSearch.tsx b/Components/MatchesScore/MatchesScoreComponents/ResultSearch/ResultSearch.tsx index 2863a08c..0f8c05cc 100644 --- a/Components/MatchesScore/MatchesScoreComponents/ResultSearch/ResultSearch.tsx +++ b/Components/MatchesScore/MatchesScoreComponents/ResultSearch/ResultSearch.tsx @@ -1,7 +1,26 @@ -import React from "react"; +import React, { FC, useState } from "react"; +import { ResultSearchProps } from "./index.d"; +import { VscSearch } from "react-icons/vsc"; -const ResultSearch = () => { - return
ResultSearch
; +const ResultSearch: FC = ({ searchValue, searchField }) => { + return ( +
+
+
+ +
+ searchValue(e.target.value)} + /> +
+
+ ); }; export default ResultSearch; diff --git a/Components/MatchesScore/MatchesScoreComponents/ResultSearch/index.d.ts b/Components/MatchesScore/MatchesScoreComponents/ResultSearch/index.d.ts index e69de29b..623efeab 100644 --- a/Components/MatchesScore/MatchesScoreComponents/ResultSearch/index.d.ts +++ b/Components/MatchesScore/MatchesScoreComponents/ResultSearch/index.d.ts @@ -0,0 +1,4 @@ +export type ResultSearchProps = { + searchValue: any; + searchField: any; +}; diff --git a/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/SingleLeagueContainer.tsx b/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/SingleLeagueContainer.tsx index ed2ada4a..d3560a52 100644 --- a/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/SingleLeagueContainer.tsx +++ b/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/SingleLeagueContainer.tsx @@ -14,7 +14,7 @@ const SingleLeagueContainer: FC = ({ (item: any) => item.league.name === leagueName ); setLeagueMatches(filteredLeague); - }, []); + }, [fixtures]); return (
diff --git a/Components/MatchesScore/index.d.ts b/Components/MatchesScore/index.d.ts index ad7d3082..45c2d107 100644 --- a/Components/MatchesScore/index.d.ts +++ b/Components/MatchesScore/index.d.ts @@ -1,4 +1,6 @@ export type MatchesScoreProps = { fixtures: any; leagues: string[]; + onSearchHandler: any; + searchField: any; }; diff --git a/pages/matches.tsx b/pages/matches.tsx index 44e4fe91..29b6d7e8 100644 --- a/pages/matches.tsx +++ b/pages/matches.tsx @@ -2,9 +2,17 @@ import React, { useEffect, useState } from "react"; import MatchesScore from "../Components/MatchesScore"; const Matches = () => { - const [fixtures, setFixtures] = useState([]); - const [leagues, setLeagues] = useState([]); + //getting all available fixtures for a specific date + const [allFixturesData, setAllfixturesData] = useState([]); + const [allUniqueLeagues, setAllUniqueLeagues] = useState([]); + //filtering data after search + const [filteredLeagues, setFilteredLeagues] = useState([]); + const [filteredFixtures, setFilteredFixtures] = useState([]); + + const [searchField, setSearchField] = useState(""); + + //setting initial state after first page load useEffect(() => { fetch("https://v3.football.api-sports.io/fixtures?date=2022-07-29", { method: "GET", @@ -16,7 +24,8 @@ const Matches = () => { .then((response) => response.json()) .then((data) => { const allFixtures = data.response; - setFixtures(allFixtures); + setFilteredFixtures(allFixtures); + setAllfixturesData(allFixtures); //extract unique league names const league: any = []; @@ -25,14 +34,51 @@ const Matches = () => { league.push(item.league.name); } }); - setLeagues(league); + setAllUniqueLeagues(league); + setFilteredLeagues(league); }) .catch((err) => { console.log(err); }); }, []); - return ; + //filtering fixtures and leagues based on search + useEffect(() => { + if (searchField.length === 0) { + setFilteredLeagues(allUniqueLeagues); + setFilteredFixtures(allFixturesData); + } else { + const filteredFixtures = allFixturesData.filter( + (item: any) => + item?.league?.name + .toLowerCase() + .includes(searchField.toLowerCase()) || + item?.teams?.home.name + .toLowerCase() + .includes(searchField.toLowerCase()) || + item?.teams?.away.name + .toLowerCase() + .includes(searchField.toLowerCase()) + ); + setFilteredFixtures(filteredFixtures); + const league: any = []; + filteredFixtures.forEach((item: any) => { + if (!league.includes(item.league.name)) { + league.push(item.league.name); + } + }); + setFilteredLeagues(league); + } + }, [searchField]); + + return ( + setSearchField(e)} + /> + ); }; export default Matches; From b007c49af6277dd8ad91eb24e76d1127d387e4df Mon Sep 17 00:00:00 2001 From: "m.farbod" Date: Fri, 29 Jul 2022 20:11:42 +0430 Subject: [PATCH 3/4] date pick scroll tab added --- Components/Header/Header.tsx | 21 +++++- Components/MatchesScore/MatchesScore.tsx | 16 +++- .../DateSelect/DateSelect.tsx | 74 ++++++++++++++++++- .../DateSelect/index.d.ts | 3 + .../SingleLeagueContainer.tsx | 9 ++- .../SingleMatchResult/SingleMatchResult.tsx | 7 +- .../SingleMatchResult/index.d.ts | 1 + Components/MatchesScore/index.d.ts | 1 + pages/_app.tsx | 2 +- pages/matches.tsx | 9 ++- utils/dateUtils.ts | 11 +++ 11 files changed, 140 insertions(+), 14 deletions(-) create mode 100644 utils/dateUtils.ts diff --git a/Components/Header/Header.tsx b/Components/Header/Header.tsx index 188bca9c..46fdda82 100644 --- a/Components/Header/Header.tsx +++ b/Components/Header/Header.tsx @@ -1,7 +1,24 @@ -import React from "react"; +import React, { useEffect, useState } from "react"; +import { TbAntennaBars5 } from "react-icons/tb"; const Header = () => { - return
Header
; + const [date, setDate] = useState(new Date()); + + //update time every 30 seconds + useEffect(() => { + setInterval(() => setDate(new Date()), 30000); + }, []); + + return ( +
+
+ {date.getHours()}:{date.getMinutes()} +
+
+ +
+
+ ); }; export default Header; diff --git a/Components/MatchesScore/MatchesScore.tsx b/Components/MatchesScore/MatchesScore.tsx index 409ba4ed..b3274de6 100644 --- a/Components/MatchesScore/MatchesScore.tsx +++ b/Components/MatchesScore/MatchesScore.tsx @@ -1,5 +1,6 @@ import React, { FC } from "react"; import { MatchesScoreProps } from "./index.d"; +import DateSelect from "./MatchesScoreComponents/DateSelect"; import ResultSearch from "./MatchesScoreComponents/ResultSearch"; import SingleLeagueContainer from "./MatchesScoreComponents/SingleLeagueContainer"; @@ -8,24 +9,31 @@ const MatchesScore: FC = ({ leagues, onSearchHandler, searchField, + activeDateTabHandler, }) => { return (
نتایج زنده
-
+
-
tabs
+
+ +
- {leagues.map((item: string) => { + {leagues.map((league: string) => { return ( - + ); })}
diff --git a/Components/MatchesScore/MatchesScoreComponents/DateSelect/DateSelect.tsx b/Components/MatchesScore/MatchesScoreComponents/DateSelect/DateSelect.tsx index ee7f8107..6509a2e7 100644 --- a/Components/MatchesScore/MatchesScoreComponents/DateSelect/DateSelect.tsx +++ b/Components/MatchesScore/MatchesScoreComponents/DateSelect/DateSelect.tsx @@ -1,7 +1,75 @@ -import React from "react"; +import React, { FC, useEffect, useState } from "react"; +import { DateSelectProps } from "./index.d"; +import { getSpecificDate } from "../../../../utils/dateUtils"; +import { AiFillCaretRight, AiFillCaretLeft } from "react-icons/ai"; -const DateSelect = () => { - return
DateSelect
; +const DateSelect: FC = ({ activeDateTabHandler }) => { + const [dateArray, setDateArray] = useState([ + { date: getSpecificDate(-1), displayName: "دیروز" }, + { date: getSpecificDate(0), displayName: "امروز" }, + { date: getSpecificDate(1), displayName: "فردا" }, + { date: getSpecificDate(2), displayName: getSpecificDate(2) }, + ]); + + const [activeDateTab, setActiveDateTab] = useState(dateArray[0].date); + const [shownIndex, setShownIndex] = useState(0); + + useEffect(() => { + activeDateTabHandler(activeDateTab); + }, [activeDateTab]); + + const rightScrollClickHandler = () => { + setShownIndex((prev) => prev - 1); + }; + const leftScrollClickHandler = () => { + //check to see if date is already added to array by previous clicks + if (dateArray.some((e) => e.date === getSpecificDate(shownIndex + 3))) { + setShownIndex((prev) => prev + 1); + } else { + const newArray = [ + ...dateArray, + { + date: getSpecificDate(shownIndex + 3), + displayName: getSpecificDate(shownIndex + 3), + }, + ]; + + setDateArray(newArray); + setShownIndex((prev) => prev + 1); + } + }; + + return ( +
+
    +
  • + +
  • + {dateArray.slice(shownIndex, shownIndex + 4).map((item, index) => { + return ( +
  • setActiveDateTab(item.date)} + className={`text-sm py-2 cursor-pointer ${ + item.date === activeDateTab + ? "border-b-4 border-green-500" + : "text-gray-400 hover:text-gray-500" + } + `} + key={index} + > + {item.displayName} +
  • + ); + })}{" "} +
  • + +
  • +
+
+ ); }; export default DateSelect; diff --git a/Components/MatchesScore/MatchesScoreComponents/DateSelect/index.d.ts b/Components/MatchesScore/MatchesScoreComponents/DateSelect/index.d.ts index e69de29b..49f22212 100644 --- a/Components/MatchesScore/MatchesScoreComponents/DateSelect/index.d.ts +++ b/Components/MatchesScore/MatchesScoreComponents/DateSelect/index.d.ts @@ -0,0 +1,3 @@ +export type DateSelectProps = { + activeDateTabHandler: (activeDateTab: string) => string; +}; diff --git a/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/SingleLeagueContainer.tsx b/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/SingleLeagueContainer.tsx index d3560a52..523b9fc8 100644 --- a/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/SingleLeagueContainer.tsx +++ b/Components/MatchesScore/MatchesScoreComponents/SingleLeagueContainer/SingleLeagueContainer.tsx @@ -9,6 +9,8 @@ const SingleLeagueContainer: FC = ({ }) => { const [leagueMatches, setLeagueMatches] = useState([]); const [showResults, setShowResults] = useState(false); + + //to not render filtered leagues useEffect(() => { const filteredLeague = fixtures.filter( (item: any) => item.league.name === leagueName @@ -38,7 +40,12 @@ const SingleLeagueContainer: FC = ({ {leagueMatches.map((item: any) => { const { teams, score, fixture } = item; return ( - + ); })}
diff --git a/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/SingleMatchResult.tsx b/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/SingleMatchResult.tsx index 1d7689c7..47e9382b 100644 --- a/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/SingleMatchResult.tsx +++ b/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/SingleMatchResult.tsx @@ -1,7 +1,12 @@ import React, { FC } from "react"; import { SingleMatchResultProps } from "./index.d"; -const SingleMatchResult: FC = ({ teams, score }) => { +const SingleMatchResult: FC = ({ + teams, + score, + fixture, +}) => { + console.log(fixture, "fixture"); return (
diff --git a/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/index.d.ts b/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/index.d.ts index 5357a444..6c18ee9a 100644 --- a/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/index.d.ts +++ b/Components/MatchesScore/MatchesScoreComponents/SingleMatchResult/index.d.ts @@ -1,4 +1,5 @@ export type SingleMatchResultProps = { teams: any; score: any; + fixture: any; }; diff --git a/Components/MatchesScore/index.d.ts b/Components/MatchesScore/index.d.ts index 45c2d107..266f7533 100644 --- a/Components/MatchesScore/index.d.ts +++ b/Components/MatchesScore/index.d.ts @@ -3,4 +3,5 @@ export type MatchesScoreProps = { leagues: string[]; onSearchHandler: any; searchField: any; + activeDateTabHandler: any; }; diff --git a/pages/_app.tsx b/pages/_app.tsx index 97e213f5..afcc29fa 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -4,7 +4,7 @@ import Layout from "../Components/Layout"; function MyApp({ Component, pageProps }: AppProps) { return ( -
+
diff --git a/pages/matches.tsx b/pages/matches.tsx index 29b6d7e8..010a8fba 100644 --- a/pages/matches.tsx +++ b/pages/matches.tsx @@ -1,11 +1,15 @@ import React, { useEffect, useState } from "react"; import MatchesScore from "../Components/MatchesScore"; +import { getSpecificDate } from "../utils/dateUtils"; const Matches = () => { //getting all available fixtures for a specific date const [allFixturesData, setAllfixturesData] = useState([]); const [allUniqueLeagues, setAllUniqueLeagues] = useState([]); + //get yesterdays fixtures as initial props + const [activeTab, setActiveTab] = useState(getSpecificDate(-1)); + //filtering data after search const [filteredLeagues, setFilteredLeagues] = useState([]); const [filteredFixtures, setFilteredFixtures] = useState([]); @@ -14,7 +18,7 @@ const Matches = () => { //setting initial state after first page load useEffect(() => { - fetch("https://v3.football.api-sports.io/fixtures?date=2022-07-29", { + fetch(`https://v3.football.api-sports.io/fixtures?date=${activeTab}`, { method: "GET", headers: { "x-rapidapi-host": "v3.football.api-sports.io", @@ -40,7 +44,7 @@ const Matches = () => { .catch((err) => { console.log(err); }); - }, []); + }, [activeTab]); //filtering fixtures and leagues based on search useEffect(() => { @@ -74,6 +78,7 @@ const Matches = () => { return ( setActiveTab(e)} fixtures={filteredFixtures} leagues={filteredLeagues} onSearchHandler={(e: string) => setSearchField(e)} diff --git a/utils/dateUtils.ts b/utils/dateUtils.ts new file mode 100644 index 00000000..e65f05f0 --- /dev/null +++ b/utils/dateUtils.ts @@ -0,0 +1,11 @@ +export const getSpecificDate = (i: number) => { + var date = new Date(); + date.setDate(date.getDate() + i); + + const dd = date.getDate().toString().padStart(2, "0"); + const mm = (date.getMonth() + 1).toString().padStart(2, "0"); + + const yyyy = date.getFullYear(); + const string = yyyy + "-" + mm + "-" + dd; + return string; +}; From 6ad108668dd4b0df106df2734fbef7e827ce72a0 Mon Sep 17 00:00:00 2001 From: "m.farbod" Date: Fri, 29 Jul 2022 20:24:06 +0430 Subject: [PATCH 4/4] error message shown on no data --- Components/MatchesScore/MatchesScore.tsx | 24 +++++++++++++++--------- pages/matches.tsx | 5 ++++- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Components/MatchesScore/MatchesScore.tsx b/Components/MatchesScore/MatchesScore.tsx index b3274de6..89bef008 100644 --- a/Components/MatchesScore/MatchesScore.tsx +++ b/Components/MatchesScore/MatchesScore.tsx @@ -27,15 +27,21 @@ const MatchesScore: FC = ({
- {leagues.map((league: string) => { - return ( - - ); - })} + {fixtures.length < 1 && ( +
+ SomeThing went wrong or your search result is empty +
+ )} + {fixtures.length > 0 && + leagues.map((league: string) => { + return ( + + ); + })}
); diff --git a/pages/matches.tsx b/pages/matches.tsx index 010a8fba..cc3b027c 100644 --- a/pages/matches.tsx +++ b/pages/matches.tsx @@ -25,7 +25,10 @@ const Matches = () => { "x-rapidapi-key": "bab104d7215beb3aa15b4edce909daa3", }, }) - .then((response) => response.json()) + .then((response) => { + console.log(response, "resp"); + return response.json(); + }) .then((data) => { const allFixtures = data.response; setFilteredFixtures(allFixtures);