Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaJ2305 committed Aug 24, 2024
1 parent e275208 commit da121c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import ThemedFavicon from "./CAREUI/misc/ThemedFavicon";
import Intergrations from "./Integrations";
import Loading from "./Components/Common/Loading";
import BrowserWarning from "./BrowserWarning";
import BrowserWarning from "./Components/ErrorPages/BrowserWarning";
const App = () => {

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react";
import browserslist from "browserslist";
import { getUserAgentRegex } from "browserslist-useragent-regexp";
import packageJson from "../package.json";
import packageJson from "../../../package.json";

const BrowserWarning = () => {
const [isSupported, setIsSupported] = useState(true);
Expand All @@ -14,8 +14,8 @@ const BrowserWarning = () => {
const regex = getUserAgentRegex({
browsers: supportedBrowsers,
allowHigherVersions: true,
ignorePatch: true,
ignoreMinor: true,
ignorePatch: true,
ignoreMinor: true,
});

if (!regex.test(userAgent)) {
Expand All @@ -28,7 +28,7 @@ const BrowserWarning = () => {
}

return (
<div style={warningStyle}>
<div className="fixed left-0 top-0 z-50 w-full bg-red-500 p-2 text-center text-white">
<h2>Unsupported Browser</h2>
<p>
You are using an unsupported browser. Please switch to a supported
Expand All @@ -38,16 +38,5 @@ const BrowserWarning = () => {
);
};

const warningStyle: React.CSSProperties = {
position: "fixed",
top: 0,
left: 0,
width: "100%",
backgroundColor: "red",
color: "white",
textAlign: "center",
padding: "10px",
zIndex: 1000,
};

export default BrowserWarning;

0 comments on commit da121c7

Please sign in to comment.