Skip to content

Commit

Permalink
fix: add label to nova landing (#1476)
Browse files Browse the repository at this point in the history
* fix: add label to nova landing

Signed-off-by: Eugene Panteleymonchuk <[email protected]>

* fix: add label to nova landing

Signed-off-by: Eugene Panteleymonchuk <[email protected]>

---------

Signed-off-by: Eugene Panteleymonchuk <[email protected]>
Co-authored-by: Begoña Álvarez de la Cruz <[email protected]>
  • Loading branch information
panteleymonchuk and begonaalvarezd authored May 13, 2024
1 parent e25ae08 commit 044edab
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
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

0 comments on commit 044edab

Please sign in to comment.