import React, { useState } from 'react' import { MemoryRouter, Route } from 'react-router-dom' import { Location } from 'history' import styled from 'styled-components' const LIGHT_GRAY = 'hsl(0, 0%, 32%)' const GRAY = 'hsl(0, 0%, 78%)' const LeftArrowIcon: React.FC> = props => ( ) const RightArrowIcon: React.FC> = props => ( ) const FileCodeIcon: React.FC<{ style: React.CSSProperties }> = ({ style, ...props }) => ( ) const SButton = styled.button` display: inline-block; border: none; margin: 0; padding: 0; background: none; font-size: 200%; margin-top: -3px; outline: none; ` const getUserConfirmation = ( message: string, callback: (ok: boolean) => void // eslint-disable-next-line ): void => callback(window.confirm(message)) const createPath = (location: Location) => location.pathname + location.search const FakeBrowser: React.FC<{}> = ({ children, ...props }) => { const [url, setUrl] = useState(null) return ( (
{ setUrl(e.target.value) }} onKeyDown={e => { if (e.key === 'Enter') { setUrl(null) history.push((e.target as HTMLInputElement).value) } }} />
{children}
)} />
) } export default FakeBrowser