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

feat: view json block + proposal details #835

Merged
merged 1 commit into from
Mar 21, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

- [#835](https://github.com/alleslabs/celatone-frontend/pull/835) Add amp view in json - block and proposal details
- [#823](https://github.com/alleslabs/celatone-frontend/pull/823) Add validator uptime and penalty events
- [#822](https://github.com/alleslabs/celatone-frontend/pull/822) Add validator list page
- [#819](https://github.com/alleslabs/celatone-frontend/pull/819) Add validator detail overview section with data from APIs
Expand Down
6 changes: 5 additions & 1 deletion src/lib/pages/block-details/components/BlockDetailsTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Text,
} from "@chakra-ui/react";

import { trackUseViewJSON } from "lib/amplitude";
import { useBaseApiRoute } from "lib/app-provider";
import { AppLink } from "lib/components/AppLink";
import { CopyLink } from "lib/components/CopyLink";
Expand All @@ -31,10 +32,13 @@ export const BlockDetailsTop = ({ blockData }: BlockDetailsTopProps) => {
const block = Number(blockData.height);
const lcdEndpoint = useBaseApiRoute("rest");

const openLcdPage = () =>
const openLcdPage = () => {
trackUseViewJSON("Block Details");
openNewTab(
`${lcdEndpoint}/cosmos/base/tendermint/v1beta1/blocks/${blockData.height}`
);
};

const disablePrevious = block <= 1;
return (
<Flex
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Button } from "@chakra-ui/react";

import { trackUseViewJSON } from "lib/amplitude";
import { useGovConfig, useInitia, useLCDEndpoint } from "lib/app-provider";
import { CustomIcon } from "lib/components/icon";
import { openNewTab } from "lib/utils";
Expand All @@ -15,10 +16,12 @@ export const ViewProposalJson = ({ id }: ViewProposalJsonProps) => {

if (!config.enabled) return null;

const openLcdPage = () =>
const openLcdPage = () => {
trackUseViewJSON("Proposal Details");
openNewTab(
`${endpoint}/${isInitia ? "initia" : "cosmos"}/gov/${config.version}/proposals/${encodeURIComponent(id)}`
);
};

return (
<Button
Expand Down
Loading