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

fix: add label to nova landing #1476

Merged
merged 3 commits into from
May 13, 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
2 changes: 1 addition & 1 deletion client/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const App: React.FC<RouteComponentProps<AppRouteProps>> = ({
scrollToTop();

if (networkConfig?.protocolVersion === NOVA) {
populateNetworkInfoNova(networkConfig.network);
populateNetworkInfoNova(networkConfig.network, networkConfig.label);
}

const body = document.querySelector("body");
Expand Down
3 changes: 2 additions & 1 deletion client/src/app/AppUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const getFaviconHelmet = (isShimmer: boolean) => {
);
};

export const populateNetworkInfoNova = (networkName: string) => {
export const populateNetworkInfoNova = (networkName: string, networkLabel: string) => {
const nodeService = ServiceFactory.get<NodeInfoServiceNova>("node-info-nova");
if (nodeService) {
const nodeInfo: InfoResponse = nodeService.get(networkName);
Expand All @@ -193,6 +193,7 @@ export const populateNetworkInfoNova = (networkName: string) => {

setNetworkInfoNova({
name: networkName,
label: networkLabel,
tokenInfo: nodeInfo?.baseToken ?? {},
manaInfo: MANA_INFO_DEFAULT,
protocolVersion: protocolInfo?.parameters.version ?? -1,
Expand Down
4 changes: 2 additions & 2 deletions client/src/app/routes/nova/landing/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { formatAmount } from "~/helpers/stardust/valueFormatHelper";
import "./Landing.scss";

const Landing: React.FC = () => {
const { name: network, tokenInfo } = useNetworkInfoNova((s) => s.networkInfo);
const { name: network, tokenInfo, label: networkLabel } = useNetworkInfoNova((s) => s.networkInfo);
const { chronicleAnalyticStats } = useChronicleAnalytics();
const { validatorStats } = useValidatorStats();
const { blocksPerSecond, confirmationRate } = useNetworkStats(network);
Expand Down Expand Up @@ -65,7 +65,7 @@ const Landing: React.FC = () => {

return (
<div className="landing-nova">
<Hero network={network} overline="Explore network" networkStats={networkStats} assetStats={assetsStats} />
<Hero network={networkLabel} overline="Explore network" networkStats={networkStats} assetStats={assetsStats} />
<div className="wrapper">
<div className="inner">
<LandingEpochSection />
Expand Down
2 changes: 2 additions & 0 deletions client/src/helpers/nova/networkInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const MANA_INFO_DEFAULT = {

interface INetworkInfo {
name: string;
label: string;
tokenInfo: BaseTokenResponse;
manaInfo: BaseTokenResponse;
protocolVersion: number;
Expand All @@ -28,6 +29,7 @@ interface NetworkInfoState {
export const useNetworkInfoNova = create<NetworkInfoState>((set) => ({
networkInfo: {
name: "",
label: "",
tokenInfo: {
name: "",
tickerSymbol: "",
Expand Down
Loading