Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions apps/hyperdrive-trading/src/ui/base/components/Well/Well.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PropsWithChildren, ReactElement } from "react";

interface WellProps {
interactive?: boolean;
variant?: "primary" | "secondary" | "accent";
elevation?: "flat" | "elevated";
block?: boolean;
disabled?: boolean;
onClick?: () => void;
Expand All @@ -12,20 +12,18 @@ interface WellProps {
export function Well({
disabled,
interactive,
elevation = "elevated",
children,
block,
variant,
onClick,
}: PropsWithChildren<WellProps>): ReactElement {
const isInteractive = !disabled && (interactive || onClick);
const className = classNames(
"daisy-card p-4 daisy-card-bordered shadow-[rgba(50,_50,_105,_0.15)_0px_2px_5px_0px,_rgba(0,_0,_0,_0.05)_0px_1px_1px_0px] bg-base-200",
{
"w-full": block,
"hover:cursor-pointer hover:-translate-y-1 transition duration-300 hover:shadow-xl ease-in-out":
isInteractive,
},
);
const className = classNames("daisy-card p-4 bg-base-200 border border-1", {
"shadow-md": elevation === "elevated",
"w-full": block,
"hover:cursor-pointer hover:-translate-y-1 transition duration-300 hover:shadow-xl ease-in-out":
isInteractive,
});

if (onClick || interactive) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export function OpenLongModalButton({
{({ showModal }) => (
<Well
interactive
variant="secondary"
onClick={() => {
setSearchParams({
...searchParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export function AddLiquidityModalButton({
{({ showModal }) => (
<Well
interactive
variant="primary"
onClick={() => {
setSearchParams({
...searchParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export function OpenShortModalButton({
{({ showModal }) => (
<Well
interactive
variant="accent"
onClick={() => {
setSearchParams({
...searchParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,19 @@ export function PositionsSection({
activePositionTab={activePositionTab}
/>

<div className="daisy-tabs-boxed mb-1">
<div className="daisy-tabs mb-1">
<button
onClick={() => handleChangeOpenOrClosedTab("Open")}
className={classNames("daisy-tab text-sm", {
"daisy-tab-active !bg-base-300 !text-white":
activeOpenOrClosedTab === "Open",
className={classNames("daisy-tab", {
"daisy-tab-active font-medium": activeOpenOrClosedTab === "Open",
})}
>
Open
</button>
<button
onClick={() => handleChangeOpenOrClosedTab("Closed")}
className={classNames("daisy-tab text-sm", {
"daisy-tab-active !bg-base-300 !text-white":
className={classNames("daisy-tab", {
"daisy-tab-active font-medium":
activeOpenOrClosedTab === "Closed",
})}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function YourBalanceWell({ token }: { token: Token }): ReactElement {
});

return (
<Well>
<Well elevation="flat">
<div className="flex items-center gap-4">
<Stat
label="Your available balance"
Expand Down
9 changes: 1 addition & 8 deletions apps/hyperdrive-trading/src/ui/token/TokenInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,7 @@ export function TokenInput({
</label>
<label className="daisy-input-group">
<span>
{(() => {
if (token.iconUrl) {
return <img className="h-6" src={token.iconUrl} />;
}
if (token.symbol) {
return <span className="daisy-label-text">{token.symbol}</span>;
}
})()}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My max button isn't showing for shorts. Same for you?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional. We don't show one for shorts.

<span className="daisy-label-text">{token.symbol}</span>
</span>
<input
type="number"
Expand Down