From 748efdb0242efcbc40c1999555eed527960014c3 Mon Sep 17 00:00:00 2001 From: Nick Babcock Date: Mon, 24 Jan 2022 16:46:58 -0600 Subject: [PATCH] Add Safari 15.2+ to the supported browsers list Confirmed to be working in #6. Looks like some bugs remain (#23), so Safari isn't included in the "Works best in" line. Instead it's listed as supported. --- src/app/src/components/icons/SafariIcon.tsx | 22 +++++++++++++++++++++ src/app/src/components/icons/index.tsx | 1 + src/app/src/components/landing/Home.tsx | 16 +++++++++++---- src/app/src/pages/api/admin/reprocess.ts | 7 +++++-- src/app/src/server-lib/leaderboard.ts | 1 - src/app/src/styles/styles.css | 4 ++++ 6 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 src/app/src/components/icons/SafariIcon.tsx diff --git a/src/app/src/components/icons/SafariIcon.tsx b/src/app/src/components/icons/SafariIcon.tsx new file mode 100644 index 00000000..0ff8341a --- /dev/null +++ b/src/app/src/components/icons/SafariIcon.tsx @@ -0,0 +1,22 @@ +import Icon from "@ant-design/icons"; + +// https://simpleicons.org/?q=safari +export const SafariSvg: React.FC<{}> = () => { + return ( + + Safari + + + ); +}; + +type SafariProps = React.ComponentProps; +export const SafariIcon: React.FC = (props) => ( + +); diff --git a/src/app/src/components/icons/index.tsx b/src/app/src/components/icons/index.tsx index db6c7d44..94411952 100644 --- a/src/app/src/components/icons/index.tsx +++ b/src/app/src/components/icons/index.tsx @@ -5,3 +5,4 @@ export * from "./FilterIcon"; export * from "./EdgeIcon"; export * from "./ChromeIcon"; export * from "./FirefoxIcon"; +export * from "./SafariIcon"; diff --git a/src/app/src/components/landing/Home.tsx b/src/app/src/components/landing/Home.tsx index fbe3182a..4634914f 100644 --- a/src/app/src/components/landing/Home.tsx +++ b/src/app/src/components/landing/Home.tsx @@ -13,7 +13,12 @@ import { selectEngineError } from "@/features/engine"; import { Alert } from "antd"; import Link from "next/link"; import { BrowserCheck } from "./BrowserCheck"; -import { ChromeIcon, EdgeIcon, FirefoxIcon } from "@/components/icons"; +import { + ChromeIcon, + EdgeIcon, + FirefoxIcon, + SafariIcon, +} from "@/components/icons"; interface HomeProps { openLink?: string; @@ -189,10 +194,13 @@ export const Home: React.FC = () => {
+
+ +
+
+ Works best in Firefox (62+), Chrome (66+), Edge (79+). +
Safari 15.2+ also supported.
- - Works best in Firefox (62+), Chrome (66+), and Edge (79+) -
diff --git a/src/app/src/pages/api/admin/reprocess.ts b/src/app/src/pages/api/admin/reprocess.ts index c2afd933..deafec01 100644 --- a/src/app/src/pages/api/admin/reprocess.ts +++ b/src/app/src/pages/api/admin/reprocess.ts @@ -2,7 +2,10 @@ import type { NextApiRequest, NextApiResponse } from "next"; import { withCoreMiddleware } from "@/server-lib/middlware"; import { calcWeightedScore, ParsedFile } from "@/server-lib/pool"; import { db } from "@/server-lib/db"; -import { addToLeaderboard, removeFromLeaderboard } from "@/server-lib/leaderboard"; +import { + addToLeaderboard, + removeFromLeaderboard, +} from "@/server-lib/leaderboard"; type ReprocessEntry = { saveId: string; @@ -33,7 +36,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { patch_shorthand: patch_shorthand, weighted_score: weighted_score.days, }; - + await removeFromLeaderboard(saveRow); await addToLeaderboard( diff --git a/src/app/src/server-lib/leaderboard.ts b/src/app/src/server-lib/leaderboard.ts index ed9b3489..5c2ca0f9 100644 --- a/src/app/src/server-lib/leaderboard.ts +++ b/src/app/src/server-lib/leaderboard.ts @@ -108,7 +108,6 @@ export const removeFromLeaderboard = async (save: Save) => { await client.zRem(raw, save.id); await client.zRem(top, save.id); } - }; export const getAchievementLeaderboardSaveIds = async ( diff --git a/src/app/src/styles/styles.css b/src/app/src/styles/styles.css index 75cda955..19dd9b90 100644 --- a/src/app/src/styles/styles.css +++ b/src/app/src/styles/styles.css @@ -67,6 +67,10 @@ line-height: 1rem; } +.text-center { + text-align: center; +} + .font-bold { font-weight: 700; }