diff --git a/app/actions.ts b/app/actions.ts index 7d66790..f9772fb 100644 --- a/app/actions.ts +++ b/app/actions.ts @@ -183,8 +183,6 @@ export async function resetLeaderboardFilters(string: string) { } export async function applyLeaderboardFilters(params: {}) { - /* const { type, rank, rating, matches, winrate, inclTier, exclTier } = params; */ - let urlStringObject = {}; Object.keys(params).forEach((key) => { @@ -200,7 +198,6 @@ export async function applyLeaderboardFilters(params: {}) { let string = ''; params[key].forEach((value, index) => { - console.log(value); string += `${value}${index === 0 ? `&${key}=` : ''}`; }); @@ -417,8 +414,6 @@ export async function fetchDashboard() { export async function paginationParamsToURL(params: {}) { let url = ''; - console.log(params); - if (Object.keys(params).length > 0) { Object.keys(params).forEach((key, index) => { if (key === 'page') return; @@ -427,20 +422,16 @@ export async function paginationParamsToURL(params: {}) { let string = `${index !== 0 ? '&' : ''}${key}=`; params[key].forEach((value, index) => { - console.log(value); string += `${value}${index === 0 ? `&${key}=` : ''}`; }); - return (url += `${string}${ - index === Object.keys(params).length - 1 ? '&' : '' - }`); + return (url += `${string}`); } return (url += `${index !== 0 ? '&' : ''}${key}=${params[key]}${ index === Object.keys(params).length - 1 ? '&' : '' }`); }); - console.log(url); } return url; diff --git a/components/Collapsible/FiltersCollapsible/FiltersCollapsible.module.css b/components/Collapsible/FiltersCollapsible/FiltersCollapsible.module.css index fe17e55..c23eadd 100644 --- a/components/Collapsible/FiltersCollapsible/FiltersCollapsible.module.css +++ b/components/Collapsible/FiltersCollapsible/FiltersCollapsible.module.css @@ -23,7 +23,14 @@ flex-grow: 1; } -.filter h2 { +.filterName { + display: flex; + flex-flow: row; + gap: 0 0.5rem; +} + +.filter h2, +.filterName { font-weight: 600; font-size: 1.8rem; } diff --git a/components/Collapsible/FiltersCollapsible/FiltersCollapsible.tsx b/components/Collapsible/FiltersCollapsible/FiltersCollapsible.tsx index 57bf156..8858edf 100644 --- a/components/Collapsible/FiltersCollapsible/FiltersCollapsible.tsx +++ b/components/Collapsible/FiltersCollapsible/FiltersCollapsible.tsx @@ -3,6 +3,7 @@ import { applyLeaderboardFilters, resetLeaderboardFilters, } from '@/app/actions'; +import InfoIcon from '@/components/Form/InfoIcon/InfoIcon'; import RangeSlider from '@/components/Range/RangeSlider'; import TierSelector from '@/components/TierSelector/TierSelector'; import { AnimatePresence, motion } from 'framer-motion'; @@ -30,18 +31,6 @@ export default function FiltersCollapsible({ return resetLeaderboardFilters(string); }; - /* useEffect(() => { - setParamsToPush({ - ...params, - inclTier: inclTier != null ? inclTier.split(',') : [], - exclTier: exclTier != null ? exclTier.split(',') : [], - rank: rank != null ? rank.split(',') : [], - rating: rating != null ? rating.split(',') : [], - matches: matches != null ? matches.split(',') : [], - winrate: winrate != null ? winrate.split(',') : [], - }); - }, [params]); */ - useEffect(() => { setParamsToPush({ ...params, @@ -117,7 +106,14 @@ export default function FiltersCollapsible({ > -

Rank

+
+

Rank

+ +
{"Player's
diff --git a/components/Form/InfoIcon/InfoIcon.module.css b/components/Form/InfoIcon/InfoIcon.module.css index 0c92b1e..3d98207 100644 --- a/components/Form/InfoIcon/InfoIcon.module.css +++ b/components/Form/InfoIcon/InfoIcon.module.css @@ -1,9 +1,4 @@ .infoIcon { - /* position: absolute; - right: 1rem; - height: 100%; - width: 100%; - aspect-ratio: 1; */ position: relative; cursor: pointer; } @@ -32,6 +27,17 @@ visibility: hidden; opacity: 0; transition: opacity 0.2s ease-out; + z-index: 2; +} + +.tooltip.positionBottom { + bottom: inherit; + top: 2.2rem; +} + +.tooltip.startLeft { + left: -1rem; + right: inherit; } .infoIcon:hover > .tooltip { diff --git a/components/Form/InfoIcon/InfoIcon.tsx b/components/Form/InfoIcon/InfoIcon.tsx index 8e6688d..2bad3dc 100644 --- a/components/Form/InfoIcon/InfoIcon.tsx +++ b/components/Form/InfoIcon/InfoIcon.tsx @@ -1,22 +1,32 @@ 'use client'; -/* import icon from '@/public/icons/info-icon.svg'; -import Image from 'next/image'; */ import { faQuestion } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import clsx from 'clsx'; import styles from './InfoIcon.module.css'; export default function InfoIcon({ infoText, + positionBottom, + startLeft, children, }: { infoText?: string; + positionBottom?: boolean; + startLeft?: boolean; children?: React.ReactNode; }) { return (
- {/* Info */} -
{infoText || children}
+
+ {infoText || children} +
); } diff --git a/components/Pagination/Pagination.tsx b/components/Pagination/Pagination.tsx index 150231e..6f2ddce 100644 --- a/components/Pagination/Pagination.tsx +++ b/components/Pagination/Pagination.tsx @@ -37,7 +37,7 @@ export default function Pagination({ const onPageChange = async (number: number) => { let url = await paginationParamsToURL(params); - router.push(`/leaderboards?${url}page=${number}#leaderboard`, { + router.push(`/leaderboards?${url}&page=${number}#leaderboard`, { scroll: true, }); @@ -53,7 +53,7 @@ export default function Pagination({ const onNext = async () => { if (currentPage < parseInt(lastPage)) { let url = await paginationParamsToURL(params); - router.push(`/leaderboards?${url}page=${currentPage + 1}#leaderboard`, { + router.push(`/leaderboards?${url}&page=${currentPage + 1}#leaderboard`, { scroll: true, }); } @@ -62,7 +62,7 @@ export default function Pagination({ const onPrevious = async () => { if (currentPage > 1) { let url = await paginationParamsToURL(params); - router.push(`/leaderboards?${url}page=${currentPage - 1}#leaderboard`, { + router.push(`/leaderboards?${url}&page=${currentPage - 1}#leaderboard`, { scroll: true, }); } diff --git a/components/Range/RangeSlider.tsx b/components/Range/RangeSlider.tsx index 6373bb1..4159ce3 100644 --- a/components/Range/RangeSlider.tsx +++ b/components/Range/RangeSlider.tsx @@ -78,13 +78,13 @@ export default function RangeSlider({ setParamsToPush((prev: any) => ({ ...prev, [name]: [ - values[0], Math.max( min - 1, Math.min(values[1], Number(e.target.value)) ) < min ? min : Math.min(max, Number(e.target.value)), + values[1], ], })); }} diff --git a/components/SubmitMatches/Guidelines/Guidelines.tsx b/components/SubmitMatches/Guidelines/Guidelines.tsx index 62a3d57..1e0ad9b 100644 --- a/components/SubmitMatches/Guidelines/Guidelines.tsx +++ b/components/SubmitMatches/Guidelines/Guidelines.tsx @@ -6,7 +6,7 @@ export default function Guidelines() { return (
}) {
-

Tournament

+

Tournament Submission

- We’re currently prioritizing badged tournaments, but you can - submit an unbadged tournament as well as long as it follows the - rules. + Any tournament, regardless of badge status, may be submitted, so + long as it follows our rules.