replace style props with tailwind classes

This commit is contained in:
Sinclair Chen 2022-08-25 19:29:32 -07:00
parent 19dbc46a5c
commit 39838e83cc
5 changed files with 14 additions and 50 deletions

View File

@ -1,38 +0,0 @@
import clsx from 'clsx'
import { useState, ReactNode } from 'react'
export function AdvancedPanel(props: { children: ReactNode }) {
const { children } = props
const [collapsed, setCollapsed] = useState(true)
return (
<div
tabIndex={0}
className={clsx(
'collapse collapse-arrow relative',
collapsed ? 'collapse-close' : 'collapse-open'
)}
>
<div
onClick={() => setCollapsed((collapsed) => !collapsed)}
className="cursor-pointer"
>
<div className="mt-4 mr-6 text-right text-sm text-gray-500">
Advanced
</div>
<div
className="collapse-title absolute h-0 min-h-0 w-0 p-0"
style={{
top: -2,
right: -15,
color: '#6a7280' /* gray-500 */,
}}
/>
</div>
<div className="collapse-content m-0 !bg-transparent !p-0">
{children}
</div>
</div>
)
}

View File

@ -1,4 +1,5 @@
import { Point, ResponsiveLine } from '@nivo/line' import { Point, ResponsiveLine } from '@nivo/line'
import clsx from 'clsx'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { zip } from 'lodash' import { zip } from 'lodash'
import { useWindowSize } from 'web/hooks/use-window-size' import { useWindowSize } from 'web/hooks/use-window-size'
@ -26,8 +27,10 @@ export function DailyCountChart(props: {
return ( return (
<div <div
className="w-full overflow-hidden" className={clsx(
style={{ height: !small && (!width || width >= 800) ? 400 : 250 }} 'h-[250px] w-full overflow-hidden',
!small && 'md:h-[400px]'
)}
> >
<ResponsiveLine <ResponsiveLine
data={data} data={data}
@ -78,8 +81,10 @@ export function DailyPercentChart(props: {
return ( return (
<div <div
className="w-full overflow-hidden" className={clsx(
style={{ height: !small && (!width || width >= 800) ? 400 : 250 }} 'h-[250px] w-full overflow-hidden',
!small && 'md:h-[400px]'
)}
> >
<ResponsiveLine <ResponsiveLine
data={data} data={data}

View File

@ -250,7 +250,7 @@ export default function Sidebar(props: { className?: string }) {
<CreateQuestionButton user={user} /> <CreateQuestionButton user={user} />
<Spacer h={4} /> <Spacer h={4} />
{user && ( {user && (
<div className="w-full" style={{ minHeight: 80 }}> <div className="min-h-[80px] w-full">
<ProfileSummary user={user} /> <ProfileSummary user={user} />
</div> </div>
)} )}

View File

@ -203,8 +203,7 @@ function NewBidTable(props: {
<input <input
type="number" type="number"
placeholder="0" placeholder="0"
className="input input-bordered" className="input input-bordered max-w-[100px]"
style={{ maxWidth: 100 }}
value={newBid.toString()} value={newBid.toString()}
onChange={(e) => setNewBid(parseInt(e.target.value) || 0)} onChange={(e) => setNewBid(parseInt(e.target.value) || 0)}
onKeyUp={(e) => { onKeyUp={(e) => {
@ -292,7 +291,7 @@ export default function Simulator() {
YES YES
</div> </div>
</h1> </h1>
<div className="mb-10 w-full" style={{ height: 500 }}> <div className="mb-10 h-[500px] w-full">
<ResponsiveLine <ResponsiveLine
data={data} data={data}
yScale={{ min: 0, max: 100, type: 'linear' }} yScale={{ min: 0, max: 100, type: 'linear' }}

View File

@ -375,11 +375,10 @@ export function FirebaseAnalytics() {
</p> </p>
<Spacer h={4} /> <Spacer h={4} />
<iframe <iframe
className="w-full" className="w-full border-0"
height={2200} height={2200}
src="https://datastudio.google.com/embed/reporting/faeaf3a4-c8da-4275-b157-98dad017d305/page/Gg3" src="https://datastudio.google.com/embed/reporting/faeaf3a4-c8da-4275-b157-98dad017d305/page/Gg3"
frameBorder="0" frameBorder="0"
style={{ border: 0 }}
allowFullScreen allowFullScreen
/> />
</> </>
@ -400,11 +399,10 @@ export function WasabiCharts() {
</p> </p>
<Spacer h={4} /> <Spacer h={4} />
<iframe <iframe
className="w-full" className="w-full border-0"
height={21000} height={21000}
src="https://wasabipesto.com/jupyter/manifold/" src="https://wasabipesto.com/jupyter/manifold/"
frameBorder="0" frameBorder="0"
style={{ border: 0 }}
allowFullScreen allowFullScreen
/> />
</> </>