import * as React from "react";
import * as Constants from "~/common/constants";
import * as SVG from "~/common/svg";
import * as Events from "~/common/custom-events";
import * as Styles from "~/common/styles";
import {
ApplicationUserControls,
ApplicationUserControlsPopup,
} from "~/components/core/ApplicationUserControls";
import { css, keyframes } from "@emotion/react";
import { Boundary } from "~/components/system/components/fragments/Boundary";
import { PopoverNavigation } from "~/components/system";
import { DarkSymbol } from "~/common/logo";
import { Link } from "~/components/core/Link";
import { ButtonPrimary, ButtonTertiary } from "~/components/system/components/Buttons";
const STYLES_NAV_LINKS = css`
display: flex;
flex-direction: row;
@media (max-width: ${Constants.sizes.mobile}px) {
flex-direction: column;
overflow: hidden;
}
`;
const STYLES_NAV_LINK = css`
color: ${Constants.semantic.textGray};
text-decoration: none;
transition: 200ms ease color;
display: block;
cursor: pointer;
padding: 4px 24px;
font-size: ${Constants.typescale.lvl1};
:hover {
color: ${Constants.system.blue};
}
@media (max-width: ${Constants.sizes.mobile}px) {
border-bottom: 1px solid ${Constants.system.grayLight2};
margin: 0px 24px;
padding: 12px 0px;
${Styles.P2};
}
`;
const STYLES_APPLICATION_HEADER_CONTAINER = (theme) => css`
width: 100%;
background-color: ${theme.system.white};
box-shadow: 0 0 0 1px ${theme.semantic.bgGrayLight};
@supports ((-webkit-backdrop-filter: blur(25px)) or (backdrop-filter: blur(25px))) {
-webkit-backdrop-filter: blur(25px);
backdrop-filter: blur(25px);
background-color: rgba(255, 255, 255, 0.7);
}
`;
const STYLES_APPLICATION_HEADER = css`
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: center;
${"" /* justify-content: space-between; */}
width: 100%;
height: ${Constants.sizes.header}px;
${"" /* padding: 0 24px 0 16px; */}
padding: 0px 32px;
@media (max-width: ${Constants.sizes.mobile}px) {
padding: 0px 24px;
width: 100%;
}
`;
const STYLES_LEFT = css`
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: flex-start;
`;
const STYLES_MIDDLE = css`
min-width: 10%;
width: 100%;
padding: 0 24px;
display: flex;
justify-content: center;
`;
const STYLES_RIGHT = css`
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: flex-end;
`;
const STYLES_BACKGROUND = css`
position: absolute;
width: 100vw;
height: 100vh;
background-color: ${Constants.semantic.bgBlurDark6};
pointer-events: auto;
@keyframes fade-in {
from {
opacity: 50%;
}
to {
opacity: 100%;
}
}
animation: fade-in 200ms ease-out;
`;
const STYLES_UPLOAD_BUTTON = css`
background-color: ${Constants.semantic.bgGrayLight};
border-radius: 8px;
width: 24px;
height: 24px;
cursor: pointer;
pointer-events: auto;
${Styles.CONTAINER_CENTERED};
`;
export default class ApplicationHeader extends React.Component {
keysPressed = {};
searchModKey = this.props.isMac ? (