Skip to content

Commit

Permalink
Merge branch 'develop' into pages/pool-list
Browse files Browse the repository at this point in the history
  • Loading branch information
songwongtp committed May 3, 2023
2 parents 3618076 + b155134 commit 7721a9a
Show file tree
Hide file tree
Showing 78 changed files with 917 additions and 256 deletions.
26 changes: 25 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#277](https://github.com/alleslabs/celatone-frontend/pull/277) Wire up data for pool navigation page
- [#275](https://github.com/alleslabs/celatone-frontend/pull/275) Add Pool navigation and pool detail data
- [#270](https://github.com/alleslabs/celatone-frontend/pull/270) Add Pool navigation and detail page

### Improvements

- [#283](https://github.com/alleslabs/celatone-frontend/pull/283) Change unsupported token icon render logic

### Bug fixes

## v1.0.3

### Features

- [#310](https://github.com/alleslabs/celatone-frontend/pull/310) Add amplitude for landing on the following pages - blocks, block detail, txs, network overview
- [#268](https://github.com/alleslabs/celatone-frontend/pull/268) Wireup create proposal to whitelisting
- [#266](https://github.com/alleslabs/celatone-frontend/pull/250) Add proposal whitelisting page
- [#286](https://github.com/alleslabs/celatone-frontend/pull/286) Add block proposer
Expand All @@ -68,7 +80,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Improvements

- [#283](https://github.com/alleslabs/celatone-frontend/pull/283) Change unsupported token icon render logic
- [#309](https://github.com/alleslabs/celatone-frontend/pull/309) Add public account name and description in account detail page
- [#289](https://github.com/alleslabs/celatone-frontend/pull/289) Add public accounts to public projects
- [#308](https://github.com/alleslabs/celatone-frontend/pull/308) Adjust view more button to full width and fix empty state layout in contract history
- [#304](https://github.com/alleslabs/celatone-frontend/pull/304) Remove suffix for token card
- [#282](https://github.com/alleslabs/celatone-frontend/pull/282) Change details page top section explorer link to copy link
- [#293](https://github.com/alleslabs/celatone-frontend/pull/293) Add comma separator to pagination and total blocks
- [#291](https://github.com/alleslabs/celatone-frontend/pull/291) Update tx count query
Expand All @@ -87,6 +102,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Bug fixes

- [#306](https://github.com/alleslabs/celatone-frontend/pull/306) Fix react query function timeout and retries, minor ui bugs
- [#307](https://github.com/alleslabs/celatone-frontend/pull/307) Remove minor ui in account detail
- [#297](https://github.com/alleslabs/celatone-frontend/pull/297) Fix open new tab on tx modal link clicked
- [#303](https://github.com/alleslabs/celatone-frontend/pull/303) Fix pagination problem when using filter
- [#301](https://github.com/alleslabs/celatone-frontend/pull/301) Fix whitelist revalidation trigger
- [#305](https://github.com/alleslabs/celatone-frontend/pull/305) Fix UI avatar for validator not shown when encounter special chars
- [#302](https://github.com/alleslabs/celatone-frontend/pull/302) Fix token card width, text size for unsupported token button in account details page and tx count color when equal to zero
- [#300](https://github.com/alleslabs/celatone-frontend/pull/300) Fix search bar's placeholder text and remove separator in latest block height
- [#290](https://github.com/alleslabs/celatone-frontend/pull/290) Fix spacing and styling in account detail
- [#280](https://github.com/alleslabs/celatone-frontend/pull/280) Fix begin unlocking optional coins field causing crash
- [#269](https://github.com/alleslabs/celatone-frontend/pull/269) Fix array value json string format and receipt row text color
Expand All @@ -98,6 +121,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#241](https://github.com/alleslabs/celatone-frontend/pull/241) Fix NAToken size
- [#244](https://github.com/alleslabs/celatone-frontend/pull/244) Fix json funds instantiate cannot edit
- [#243](https://github.com/alleslabs/celatone-frontend/pull/243) Fix Json viewer and view more btn
- [#299](https://github.com/alleslabs/celatone-frontend/pull/299) Fix validator identity url

## v1.0.2

Expand Down
2 changes: 1 addition & 1 deletion codegen.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CodegenConfig } from "@graphql-codegen/cli";

const config: CodegenConfig = {
schema: "https://osmosis-testnet-graphql2.alleslabs.dev/v1/graphql",
schema: "https://osmosis-testnet-graphql.alleslabs.dev/v1/graphql",
documents: ["src/**/*.tsx", "src/**/*.ts"],
ignoreNoDocuments: true, // for better experience with the watcher
generates: {
Expand Down
6 changes: 5 additions & 1 deletion src/lib/app-fns/tx/clearAdmin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ export const clearAdminTx = ({
title: "Tx Hash",
value: txInfo.transactionHash,
html: (
<ExplorerLink type="tx_hash" value={txInfo.transactionHash} />
<ExplorerLink
type="tx_hash"
value={txInfo.transactionHash}
openNewTab
/>
),
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/app-fns/tx/common/catchTxError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const getTxHashReceipt = (txHash?: string) =>
{
title: "Tx Hash",
value: txHash,
html: <ExplorerLink type="tx_hash" value={txHash} />,
html: <ExplorerLink type="tx_hash" value={txHash} openNewTab />,
},
]
: [];
Expand Down
6 changes: 5 additions & 1 deletion src/lib/app-fns/tx/common/post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ export const postTx = <T extends TxResult>({ postFn }: PostTxParams<T>) => {
{
title: "Tx Hash",
html: (
<ExplorerLink type="tx_hash" value={txResult.transactionHash} />
<ExplorerLink
type="tx_hash"
value={txResult.transactionHash}
openNewTab
/>
),
},
{
Expand Down
6 changes: 5 additions & 1 deletion src/lib/app-fns/tx/execute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ export const executeContractTx = ({
title: "Tx Hash",
value: txInfo.transactionHash,
html: (
<ExplorerLink type="tx_hash" value={txInfo.transactionHash} />
<ExplorerLink
type="tx_hash"
value={txInfo.transactionHash}
openNewTab
/>
),
},
{
Expand Down
6 changes: 5 additions & 1 deletion src/lib/app-fns/tx/migrate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ export const migrateContractTx = ({
title: "Tx Hash",
value: txInfo.transactionHash,
html: (
<ExplorerLink type="tx_hash" value={txInfo.transactionHash} />
<ExplorerLink
type="tx_hash"
value={txInfo.transactionHash}
openNewTab
/>
),
},
{
Expand Down
6 changes: 5 additions & 1 deletion src/lib/app-fns/tx/resend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ export const resendTx = ({
title: "Tx Hash",
value: txInfo.transactionHash,
html: (
<ExplorerLink type="tx_hash" value={txInfo.transactionHash} />
<ExplorerLink
type="tx_hash"
value={txInfo.transactionHash}
openNewTab
/>
),
},
{
Expand Down
10 changes: 8 additions & 2 deletions src/lib/app-fns/tx/submitProposal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,19 @@ export const submitProposalTx = ({
{
title: "Proposal ID",
value: proposalId,
html: <ExplorerLink type="proposal_id" value={proposalId} />,
html: (
<ExplorerLink type="proposal_id" value={proposalId} openNewTab />
),
},
{
title: "Tx Hash",
value: txInfo.transactionHash,
html: (
<ExplorerLink type="tx_hash" value={txInfo.transactionHash} />
<ExplorerLink
type="tx_hash"
value={txInfo.transactionHash}
openNewTab
/>
),
},
{
Expand Down
6 changes: 5 additions & 1 deletion src/lib/app-fns/tx/updateAdmin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ export const updateAdminTx = ({
title: "Tx Hash",
value: txInfo.transactionHash,
html: (
<ExplorerLink type="tx_hash" value={txInfo.transactionHash} />
<ExplorerLink
type="tx_hash"
value={txInfo.transactionHash}
openNewTab
/>
),
},
{
Expand Down
12 changes: 10 additions & 2 deletions src/lib/app-fns/tx/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,23 @@ export const uploadContractTx = ({
value: txInfo.codeId,
html: (
<div style={{ display: "inline-flex", alignItems: "center" }}>
<ExplorerLink type="code_id" value={txInfo.codeId.toString()} />
<ExplorerLink
type="code_id"
value={txInfo.codeId.toString()}
openNewTab
/>
</div>
),
},
{
title: "Tx Hash",
value: txInfo.transactionHash,
html: (
<ExplorerLink type="tx_hash" value={txInfo.transactionHash} />
<ExplorerLink
type="tx_hash"
value={txInfo.transactionHash}
openNewTab
/>
),
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/app-provider/hooks/useInternalNavigate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Router } from "next/router";
import type { ParsedUrlQueryInput } from "node:querystring";
import { useCallback } from "react";

interface NavigationArgs {
export interface NavigationArgs {
pathname: string;
query?: ParsedUrlQueryInput;
options?: Parameters<Pick<Router, "push">["push"]>[2];
Expand Down
4 changes: 2 additions & 2 deletions src/lib/app-provider/query-client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export const GRAPH_URL: Record<string, string> = {
/**
* Revisit graphql for terra2 mainnet and osmosis mainnet
*/
osmosis: "https://osmosis-mainnet-graphql2.alleslabs.dev/v1/graphql",
osmosistestnet: "https://osmosis-testnet-graphql2.alleslabs.dev/v1/graphql",
osmosis: "https://osmosis-mainnet-graphql.alleslabs.dev/v1/graphql",
osmosistestnet: "https://osmosis-testnet-graphql.alleslabs.dev/v1/graphql",
terra2testnet: "https://terra-testnet-graphql.alleslabs.dev/v1/graphql",
};

Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/CustomTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const CustomTab = ({ count, ...restProps }: CustomTabProps) => {
fontWeight="700"
lineHeight="24px"
letterSpacing="0.4px"
variant="ghost"
variant="ghost-gray"
color="text.dark"
mb={0}
sx={{
Expand Down
12 changes: 10 additions & 2 deletions src/lib/components/ExplorerLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import {
getExplorerValidatorUrl,
} from "lib/app-fns/explorer";
import type { AddressReturnType } from "lib/app-provider";
import { useCurrentNetwork } from "lib/app-provider/hooks/useCurrentNetwork";
import { AmpTrackMintscan } from "lib/services/amplitude";
import type { Option } from "lib/types";
import { truncate } from "lib/utils";

import { AppLink } from "./AppLink";
Expand All @@ -30,6 +32,7 @@ interface ExplorerLinkProps extends BoxProps {
maxWidth?: string;
textVariant?: TextProps["variant"];
ampCopierSection?: string;
openNewTab?: boolean;
}

const getNavigationUrl = (
Expand Down Expand Up @@ -93,6 +96,7 @@ const LinkRender = ({
isEllipsis,
maxWidth,
textVariant,
openNewTab,
}: {
type: string;
isInternal: boolean;
Expand All @@ -101,7 +105,9 @@ const LinkRender = ({
isEllipsis: boolean;
maxWidth: ExplorerLinkProps["maxWidth"];
textVariant: TextProps["variant"];
openNewTab: Option<boolean>;
}) => {
const { network } = useCurrentNetwork();
const textElement = (
<Text
variant={textVariant}
Expand All @@ -116,13 +122,13 @@ const LinkRender = ({
</Text>
);

return isInternal ? (
return isInternal && !openNewTab ? (
<AppLink href={hrefLink} passHref onClick={(e) => e.stopPropagation()}>
{textElement}
</AppLink>
) : (
<a
href={hrefLink}
href={isInternal ? `/${network}${hrefLink}` : hrefLink}
target="_blank"
rel="noopener noreferrer"
data-peer
Expand All @@ -146,6 +152,7 @@ export const ExplorerLink = ({
maxWidth = "160px",
textVariant = "body2",
ampCopierSection,
openNewTab,
...componentProps
}: ExplorerLinkProps) => {
const { address, currentChainName } = useWallet();
Expand Down Expand Up @@ -189,6 +196,7 @@ export const ExplorerLink = ({
isEllipsis={textFormat === "ellipsis"}
maxWidth={maxWidth}
textVariant={textVariant}
openNewTab={openNewTab}
/>
<Copier
type={type}
Expand Down
6 changes: 4 additions & 2 deletions src/lib/components/LabelText.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { FlexProps } from "@chakra-ui/react";
import { Flex, Text } from "@chakra-ui/react";

interface LabelTextProps {
interface LabelTextProps extends FlexProps {
label: string;
children: string | JSX.Element;
helperText1?: string;
Expand All @@ -12,8 +13,9 @@ export const LabelText = ({
children,
helperText1,
helperText2,
...flexProps
}: LabelTextProps) => (
<Flex direction="column" gap={1}>
<Flex direction="column" gap={1} {...flexProps}>
<Text variant="body2" color="text.dark" fontWeight={500}>
{label}
</Text>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/TokenCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const TokenCard = ({

<Flex direction="column">
<Text fontWeight="700" variant="body2">
{formatUTokenWithPrecision(amount as U<Token>, precision)}
{formatUTokenWithPrecision(amount as U<Token>, precision, false)}
</Text>
<Text variant="body3" color="text.dark">
{price
Expand Down
7 changes: 4 additions & 3 deletions src/lib/components/ValidatorBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useWallet } from "@cosmos-kit/react";
import { getChainApiPath } from "env";
import { ExplorerLink } from "lib/components/ExplorerLink";
import type { ValidatorInfo } from "lib/types";
import { removeSpecialChars } from "lib/utils";

interface ValidatorBadgeProps {
validator: ValidatorInfo | null;
Expand Down Expand Up @@ -42,11 +43,11 @@ export const ValidatorBadge = ({
boxSize={badgeSize}
src={`https://raw.githubusercontent.com/cosmostation/chainlist/master/chain/${getChainApiPath(
currentChainName
)}/${validator.validatorAddress}.png`}
)}/moniker/${validator.validatorAddress}.png`}
alt={validator.moniker}
fallbackSrc={`https://ui-avatars.com/api/?name=${
fallbackSrc={`https://ui-avatars.com/api/?name=${removeSpecialChars(
validator.moniker ?? ""
}&background=9793F3&color=fff`}
)}&background=9793F3&color=fff`}
borderRadius="50%"
/>
<ExplorerLink
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/button/CustomIconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const CustomIconButton = ({
onClick,
}: CustomIconButtonProps) => (
<Button
variant="ghost"
variant="ghost-gray"
size="xs"
px="1"
minWidth="32px"
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/modal/UnsupportedTokensModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,10 @@ export const UnsupportedTokensModal = ({
}}
>
<Button
variant="ghost"
variant="ghost-gray"
color="text.dark"
mb={1}
fontSize="12px"
fontWeight={500}
{...buttonProps}
>
Expand Down
11 changes: 6 additions & 5 deletions src/lib/components/state/EmptyState.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Flex, Text, Heading } from "@chakra-ui/react";
import { Flex, Heading } from "@chakra-ui/react";
import type { ReactElement } from "react";

import type { ImageVariant } from "./StateImage";
import { StateImage } from "./StateImage";

interface EmptyStateProps {
export interface EmptyStateProps {
imageVariant?: ImageVariant;
message: string;
message: string | ReactElement;
heading?: string;
withBorder?: boolean;
}
Expand All @@ -30,9 +31,9 @@ export const EmptyState = ({
{heading}
</Heading>
)}
<Text color="text.dark" textAlign="center">
<Flex fontSize="16px" color="text.dark">
{message}
</Text>
</Flex>
</Flex>
</Flex>
);
Loading

0 comments on commit 7721a9a

Please sign in to comment.