import * as React from "react";
import * as Constants from "~/common/constants";
import * as SVG from "~/common/svg";
import { css, keyframes } from "@emotion/react";
import { SearchModal } from "~/components/core/SearchModal";
import { dispatchCustomEvent } from "~/common/custom-events";
const STYLES_ICON_ELEMENT = css`
height: 40px;
width: 40px;
display: inline-flex;
align-items: center;
justify-content: center;
color: #565151;
user-select: none;
cursor: pointer;
pointer-events: auto;
:hover {
color: ${Constants.system.brand};
}
svg {
transform: rotate(0deg);
transition: 200ms ease transform;
}
`;
const STYLES_APPLICATION_HEADER = css`
display: flex;
align-items: flex-start;
justify-content: space-between;
width: 100%;
height: 56px;
padding: 12px 48px 0 36px;
pointer-events: none;
background: ${Constants.system.white};
@media (max-width: ${Constants.sizes.mobile}px) {
padding: 12px 24px 0 12px;
}
`;
const STYLES_LEFT = css`
flex-shrink: 0;
width: 352px;
display: flex;
align-items: center;
justify-content: flex-start;
`;
const STYLES_MIDDLE = css`
min-width: 10%;
width: 100%;
padding: 0 24px 0 48px;
`;
const STYLES_RIGHT = css`
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: flex-end;
padding-right: 16px;
`;
const rotate = keyframes`
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
`;
const STYLES_ROTATION = css`
animation: ${rotate} 1s linear infinite;
`;
const STYLES_STATIC = css`
transition: 200ms ease all;
`;
export default class ApplicationHeader extends React.Component {
state = {
isRefreshing: false,
};
_handleCreateSearch = (e) => {
dispatchCustomEvent({
name: "create-modal",
detail: { modal: },
});
};
_handleRehydrate = (e) => {
this.setState({ isRefreshing: true }, async () => {
await this.props.onRehydrate();
this.setState({ isRefreshing: false });
});
};
render() {
const isBackDisabled =
this.props.currentIndex === 0 || this.props.history.length < 2;
const isForwardDisabled =
this.props.currentIndex === this.props.history.length - 1 ||
this.props.history.length < 2;
return (
);
}
}