Skip to content

Commit

Permalink
Add viewport meta tag and change its content for iOS
Browse files Browse the repository at this point in the history
* Remove `robots.txt`

Signed-off-by: Marvin A. Ruder <signed@mruder.dev>
  • Loading branch information
marvinruder committed Mar 2, 2024
1 parent 12f2c21 commit 9d48420
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 0 additions & 2 deletions packages/frontend/public/robots.txt

This file was deleted.

1 change: 1 addition & 0 deletions packages/frontend/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta id="meta-theme-color-light" name="theme-color" content="#F5F5F5" media="(prefers-color-scheme: light)">
<meta id="meta-theme-color-dark" name="theme-color" content="#171717" media="(prefers-color-scheme: dark)">
<meta name="description" content="A web service fetching and providing financial and ESG ratings for stocks.">
Expand Down
10 changes: 4 additions & 6 deletions packages/frontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import { BrowserRouter } from "react-router-dom";

import App from "./App";

if (/iPad|iPhone|iPod/.test(navigator.platform)) {
const viewportMeta = document.createElement("meta");
viewportMeta.name = "viewport";
viewportMeta.content = "width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no";
document.head.appendChild(viewportMeta);
}
if (/iPad|iPhone|iPod/.test(navigator.platform))
document
.querySelector('meta[name="viewport"]')
?.setAttribute("content", "width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no");

createRoot(document.getElementById("root")).render(
<BrowserRouter>
Expand Down

0 comments on commit 9d48420

Please sign in to comment.