Path: blob/master/src/packages/frontend/app/warnings.tsx
1496 views
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Icon } from "@cocalc/frontend/components";6import { SiteName } from "@cocalc/frontend/customize";7import { get_browser } from "@cocalc/frontend/feature";8import { type CSSProperties } from "react";910const WARNING_STYLE = {11position: "fixed",12left: 12,13backgroundColor: "red",14color: "#fff",15top: 20,16opacity: 0.9,17borderRadius: 4,18padding: 5,19marginTop: "1em",20zIndex: 100000,21boxShadow: "8px 8px 4px #888",22width: "70%",23} as CSSProperties;2425export function CookieWarning() {26return (27<div style={WARNING_STYLE}>28<Icon name="warning" /> You <em>must</em> enable cookies to use{" "}29<SiteName />.30</div>31);32}3334const STORAGE_WARNING_STYLE = {35...WARNING_STYLE,36top: 55,37} as CSSProperties;3839export function LocalStorageWarning() {40return (41<div style={STORAGE_WARNING_STYLE}>42<Icon name="warning" /> You <em>must</em> enable local storage to use{" "}43<SiteName />44{get_browser() === "safari"45? " (on Safari you must disable private browsing mode)"46: undefined}47.48</div>49);50}515253