Skip to content

Commit

Permalink
Add Safari 15.2+ to the supported browsers list
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nickbabcock committed Jan 24, 2022
1 parent ed087ae commit 748efdb
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 7 deletions.
22 changes: 22 additions & 0 deletions 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 (
<svg
role="img"
viewBox="0 0 24 24"
width={32}
height={32}
xmlns="http://www.w3.org/2000/svg"
>
<title>Safari</title>
<path d="M12 24C5.373 24 0 18.627 0 12S5.373 0 12 0s12 5.373 12 12-5.373 12-12 12zm0-.75c6.213 0 11.25-5.037 11.25-11.25S18.213.75 12 .75.75 5.787.75 12 5.787 23.25 12 23.25zM12 2a.25.25 0 0 1 .25.25v1a.25.25 0 1 1-.5 0v-1A.25.25 0 0 1 12 2zm0 18.5a.25.25 0 0 1 .25.25v1a.25.25 0 1 1-.5 0v-1a.25.25 0 0 1 .25-.25zm7.071-15.571a.25.25 0 0 1 0 .353l-.707.708a.25.25 0 0 1-.354-.354l.708-.707a.25.25 0 0 1 .353 0zM5.99 18.01a.25.25 0 0 1 0 .354l-.708.707a.25.25 0 1 1-.353-.353l.707-.708a.25.25 0 0 1 .354 0zM4.929 4.93a.25.25 0 0 1 .353 0l.708.707a.25.25 0 0 1-.354.354l-.707-.708a.25.25 0 0 1 0-.353zM18.01 18.01a.25.25 0 0 1 .354 0l.707.708a.25.25 0 1 1-.353.353l-.708-.707a.25.25 0 0 1 0-.354zM2 12a.25.25 0 0 1 .25-.25h1a.25.25 0 1 1 0 .5h-1A.25.25 0 0 1 2 12zm18.5 0a.25.25 0 0 1 .25-.25h1a.25.25 0 1 1 0 .5h-1a.25.25 0 0 1-.25-.25zm-4.593-9.205a.25.25 0 0 1 .133.328l-.391.92a.25.25 0 1 1-.46-.195l.39-.92a.25.25 0 0 1 .328-.133zM8.68 19.825a.25.25 0 0 1 .132.327l-.39.92a.25.25 0 0 1-.46-.195l.39-.92a.25.25 0 0 1 .328-.133zM21.272 8.253a.25.25 0 0 1-.138.325l-.927.375a.25.25 0 1 1-.188-.464l.927-.374a.25.25 0 0 1 .326.138zm-17.153 6.93a.25.25 0 0 1-.138.326l-.927.374a.25.25 0 1 1-.188-.463l.927-.375a.25.25 0 0 1 .326.138zM8.254 2.728a.25.25 0 0 1 .325.138l.375.927a.25.25 0 0 1-.464.188l-.374-.927a.25.25 0 0 1 .138-.326zm6.93 17.153a.25.25 0 0 1 .326.138l.374.927a.25.25 0 1 1-.463.188l-.375-.927a.25.25 0 0 1 .138-.326zM2.795 8.093a.25.25 0 0 1 .328-.133l.92.391a.25.25 0 0 1-.195.46l-.92-.39a.25.25 0 0 1-.133-.328zm17.03 7.228a.25.25 0 0 1 .327-.132l.92.39a.25.25 0 1 1-.195.46l-.92-.39a.25.25 0 0 1-.133-.328zM12.879 12.879L11.12 11.12l-4.141 5.9 5.899-4.142zm6.192-7.95l-5.834 8.308-8.308 5.834 5.834-8.308 8.308-5.834z" />
</svg>
);
};

type SafariProps = React.ComponentProps<typeof Icon>;
export const SafariIcon: React.FC<SafariProps> = (props) => (
<Icon component={SafariSvg} {...props} />
);
1 change: 1 addition & 0 deletions src/app/src/components/icons/index.tsx
Expand Up @@ -5,3 +5,4 @@ export * from "./FilterIcon";
export * from "./EdgeIcon";
export * from "./ChromeIcon";
export * from "./FirefoxIcon";
export * from "./SafariIcon";
16 changes: 12 additions & 4 deletions src/app/src/components/landing/Home.tsx
Expand Up @@ -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;
Expand Down Expand Up @@ -189,10 +194,13 @@ export const Home: React.FC<HomeProps> = () => {
<ChromeIcon style={{ fill: "lightgrey" }} />
<div className="divider" />
<EdgeIcon style={{ fill: "lightgrey" }} />
<div className="divider" />
<SafariIcon style={{ fill: "lightgrey" }} />
</div>
<div className="text-xs text-center">
Works best in Firefox (62+), Chrome (66+), Edge (79+).
<div>Safari 15.2+ also supported.</div>
</div>
<span className="text-xs">
Works best in Firefox (62+), Chrome (66+), and Edge (79+)
</span>
<BrowserCheck />
</div>
</div>
Expand Down
7 changes: 5 additions & 2 deletions src/app/src/pages/api/admin/reprocess.ts
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand Down
1 change: 0 additions & 1 deletion src/app/src/server-lib/leaderboard.ts
Expand Up @@ -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 (
Expand Down
4 changes: 4 additions & 0 deletions src/app/src/styles/styles.css
Expand Up @@ -67,6 +67,10 @@
line-height: 1rem;
}

.text-center {
text-align: center;
}

.font-bold {
font-weight: 700;
}

0 comments on commit 748efdb

Please sign in to comment.