Skip to content

Commit

Permalink
feat(ui): Add improved WormholeForm
Browse files Browse the repository at this point in the history
Author: @cyphertrace
  • Loading branch information
wormat committed Oct 21, 2022
1 parent 81c5729 commit 2a63f9b
Show file tree
Hide file tree
Showing 23 changed files with 1,018 additions and 357 deletions.
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 = {
readonly token: WormholeToken;
readonly isSelected: boolean;
};

export const WormholeTokenIcon = ({
token,
isSelected,
}: WormholeTokenIconProps): ReactElement => {
const { logo, symbol, displayName } = token;
return (
<div>
<WithIcon
type={logo}
size="m"
title={displayName}
style={{ marginRight: 5 }}
/>
<span>{isSelected ? `${symbol}` : `${symbol} - ${displayName}`}</span>
</div>
);
};

type WithIconProps = ComponentProps<typeof EuiIcon>;
const WithIcon = ({ children, ...rest }: WithIconProps) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion apps/ui/src/components/TokenSearchModal.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.tokenSearchModal {
min-height: 50vh;
max-width: 430px;
max-width: 430px !important;
}
.modalBody {
height: 30vh;
Expand Down
330 changes: 0 additions & 330 deletions apps/ui/src/components/WormholeForm.tsx

This file was deleted.

Loading

0 comments on commit 2a63f9b

Please sign in to comment.