Run linting

related to #360
This commit is contained in:
Kurt Hutten
2021-06-13 06:33:03 +10:00
parent d781c94027
commit da81942adc
13 changed files with 258 additions and 209 deletions

View File

@@ -1,62 +1,70 @@
import { Popover } from '@headlessui/react'
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs'
import FullScriptEncoding from 'src/components/EncodedUrl/FullScriptEncoding'
const TopButton = ({
onClick,
children,
className,
iconColor,
}: {
onClick?: () => void
children: React.ReactNode
className?: string
iconColor: string
}) => (
<button onClick={onClick} className={`flex bg-gray-200 h-10 justify-center items-center px-4 rounded ${className}`}>
<div className={`rounded-full h-6 w-6 mr-4 ${iconColor}`}/>
onClick,
children,
className,
iconColor,
}: {
onClick?: () => void
children: React.ReactNode
className?: string
iconColor: string
}) => (
<button
onClick={onClick}
className={`flex bg-gray-200 h-10 justify-center items-center px-4 rounded ${className}`}
>
<div className={`rounded-full h-6 w-6 mr-4 ${iconColor}`} />
{children}
</button>
)
const IdeHeader = ({handleRender}: {handleRender: () => void}) => {
const IdeHeader = ({ handleRender }: { handleRender: () => void }) => {
return (
<div className="h-16 w-full bg-gray-900 flex justify-between items-center">
<div className="bg-gray-700 pr-48 h-full">
</div>
<div className="bg-gray-700 pr-48 h-full"></div>
<div className="text-gray-200 flex gap-4 mr-4">
<TopButton
className="bg-gray-600 text-gray-200"
iconColor="bg-gray-300"
onClick={handleRender}
>Render</TopButton>
>
Render
</TopButton>
<Popover className="relative outline-none w-full h-full">
{({open}) => {
{({ open }) => {
return (
<>
<Popover.Button className="h-full w-full outline-none">
<TopButton iconColor="bg-gray-600" className="text-gray-700">Share</TopButton>
<TopButton iconColor="bg-gray-600" className="text-gray-700">
Share
</TopButton>
</Popover.Button>
{open && <Popover.Panel className="absolute z-10 mt-4 right-0">
<Tabs
className="bg-gray-300 rounded-md shadow-md overflow-hidden text-gray-700"
selectedTabClassName="bg-gray-200"
>
<TabPanel className="p-4">
<FullScriptEncoding />
</TabPanel>
<TabPanel>
<p>blah</p>
<input onPaste={(e) => console.log(e)} />
</TabPanel>
{open && (
<Popover.Panel className="absolute z-10 mt-4 right-0">
<Tabs
className="bg-gray-300 rounded-md shadow-md overflow-hidden text-gray-700"
selectedTabClassName="bg-gray-200"
>
<TabPanel className="p-4">
<FullScriptEncoding />
</TabPanel>
<TabPanel>
<p>blah</p>
<input onPaste={(e) => console.log(e)} />
</TabPanel>
<TabList className="flex whitespace-nowrap text-gray-700 border-t border-gray-700">
<Tab className="p-3 px-5">encoded script</Tab>
<Tab className="p-3 px-5">external script</Tab>
</TabList>
</Tabs>
</Popover.Panel>}
<TabList className="flex whitespace-nowrap text-gray-700 border-t border-gray-700">
<Tab className="p-3 px-5">encoded script</Tab>
<Tab className="p-3 px-5">external script</Tab>
</TabList>
</Tabs>
</Popover.Panel>
)}
</>
)
}}