From 97a1bdb51b872147b9c6e8aedb17a8523b6b3ba5 Mon Sep 17 00:00:00 2001 From: Sinclair Chen Date: Wed, 5 Oct 2022 14:40:43 -0700 Subject: [PATCH] Make embed and challenge buttons non-daisyui --- web/components/button.tsx | 4 ++-- web/components/contract/share-modal.tsx | 13 +++++++------ web/components/share-embed-button.tsx | 26 ++++++++++++------------- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/web/components/button.tsx b/web/components/button.tsx index 57c0bb4b..4a81dc8c 100644 --- a/web/components/button.tsx +++ b/web/components/button.tsx @@ -20,7 +20,7 @@ export function Button(props: { onClick?: MouseEventHandler | undefined children?: ReactNode size?: SizeType - color?: ColorType + color?: ColorType | 'override' type?: 'button' | 'reset' | 'submit' disabled?: boolean loading?: boolean @@ -50,7 +50,7 @@ export function Button(props: { + )} diff --git a/web/components/share-embed-button.tsx b/web/components/share-embed-button.tsx index 0a5dc0c9..ad57b2f7 100644 --- a/web/components/share-embed-button.tsx +++ b/web/components/share-embed-button.tsx @@ -1,6 +1,5 @@ import React from 'react' import { CodeIcon } from '@heroicons/react/outline' -import { Menu } from '@headlessui/react' import toast from 'react-hot-toast' import { Contract } from 'common/contract' @@ -8,6 +7,7 @@ import { contractPath } from 'web/lib/firebase/contracts' import { DOMAIN } from 'common/envs/constants' import { copyToClipboard } from 'web/lib/util/copy' import { track } from 'web/lib/service/analytics' +import { Button } from './button' export function embedContractCode(contract: Contract) { const title = contract.question @@ -15,6 +15,7 @@ export function embedContractCode(contract: Contract) { return `` } +// TODO: move this function elsewhere export function embedContractGridCode(contracts: Contract[]) { const height = (contracts.length - (contracts.length % 2)) * 100 + 'px' const src = `https://${DOMAIN}/embed/grid/${contracts @@ -26,24 +27,21 @@ export function embedContractGridCode(contracts: Contract[]) { export function ShareEmbedButton(props: { contract: Contract }) { const { contract } = props - const codeIcon =