Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI/wormhole form #453

Open
wants to merge 5 commits into
base: ui/wormhole-hooks
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions apps/ui/src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ export const Layout = ({
</CustomHeaderLink>
{/* TODO: Enable when token is launched */}
{/* <CustomHeaderLink to={"/stake"}>Stake</CustomHeaderLink> */}
<CustomHeaderLink to={"/wormhole"}>
{t("nav.wormhole")}
</CustomHeaderLink>
<CustomHeaderLink to={"/help"}>
{t("nav.help")}
</CustomHeaderLink>
Expand Down
26 changes: 25 additions & 1 deletion apps/ui/src/components/TokenIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { EuiIcon } from "@elastic/eui";
import type { TokenProject } from "@swim-io/token-projects";
import { TOKEN_PROJECTS_BY_ID } from "@swim-io/token-projects";
import type { WormholeToken } from "models";
import type { ComponentProps, ReactElement } from "react";
import { Fragment } from "react";
import { Trans } from "react-i18next";

import type { EcosystemId, TokenConfig } from "../config";
import { ECOSYSTEMS } from "../config";
import type { EcosystemId, TokenConfig } from "../config";
import { useIntlListSeparators } from "../hooks";
import type { Amount } from "../models/amount";

Expand All @@ -18,6 +19,29 @@ interface TokenIconProps
readonly showFullName?: boolean;
}

type WormholeTokenIconProps = {
wormat marked this conversation as resolved.
Show resolved Hide resolved
readonly token: WormholeToken;
readonly displaySymbol: boolean;
};

export const WormholeTokenIcon = ({
token,
displaySymbol,
wormat marked this conversation as resolved.
Show resolved Hide resolved
}: WormholeTokenIconProps): ReactElement => {
const { logo, symbol, displayName } = token;
return (
<div>
<WithIcon
type={logo || "questionInCircle"}
size="m"
title={displayName}
style={{ marginRight: 5 }}
/>
<span>{displaySymbol ? `${symbol}` : `${symbol} - ${displayName}`}</span>
</div>
);
};

type WithIconProps = ComponentProps<typeof EuiIcon>;
const WithIcon = ({ children, ...rest }: WithIconProps) => {
return (
Expand Down
329 changes: 0 additions & 329 deletions apps/ui/src/components/WormholeForm.tsx

This file was deleted.

Loading