Skip to content

Commit

Permalink
Merge pull request #6 from Stellarthoughts/branding_2
Browse files Browse the repository at this point in the history
  • Loading branch information
andskur authored Mar 15, 2024
2 parents 0006445 + ef8460f commit fc669d1
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ VITE_FIAT_EXCHANGE_RATES_API_URL=https://api.exchangeratesapi.io/v1/latest
VITE_FIAT_EXCHANGE_RATES_API_KEY=
VITE_FIAT_EXCHANGE_RATES_ETHEREUM_USDC_ADDRESS=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48

# LOGO AND BRANDING
VITE_LOGO_PATH=/src/assets/gpt-logo-white-transparent.svg

# OUTDATED NETWORK MODAL
VITE_ENABLE_OUTDATED_NETWORK_MODAL=true
VITE_OUTDATED_NETWORK_MODAL_TITLE=Welcome to the new Polygon zkEVM testnet!
Expand All @@ -39,3 +42,4 @@ VITE_REPORT_FORM_URL=https://docs.google.com/forms/d/xxxxxx/viewform
VITE_REPORT_FORM_ERROR_ENTRY=entry.xxxxxx
VITE_REPORT_FORM_PLATFORM_ENTRY=entry.xxxxxx
VITE_REPORT_FORM_URL_ENTRY=entry.xxxxxx

4 changes: 2 additions & 2 deletions .github/workflows/push-docker-main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
branches:
- main
- develop

jobs:
build:
Expand All @@ -28,4 +28,4 @@ jobs:
with:
platforms: linux/amd64,linux/arm64
push: true
tags: hermeznetwork/zkevm-bridge-ui:stable
tags: gatewayfm/zkevm-bridge-ui-generic:v0.0.2
5 changes: 5 additions & 0 deletions src/adapters/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface Env {
VITE_FIAT_EXCHANGE_RATES_API_KEY?: string;
VITE_FIAT_EXCHANGE_RATES_API_URL?: string;
VITE_FIAT_EXCHANGE_RATES_ETHEREUM_USDC_ADDRESS?: string;
VITE_LOGO_PATH: string;
VITE_OUTDATED_NETWORK_MODAL_MESSAGE_PARAGRAPH_1?: string;
VITE_OUTDATED_NETWORK_MODAL_MESSAGE_PARAGRAPH_2?: string;
VITE_OUTDATED_NETWORK_MODAL_TITLE?: string;
Expand Down Expand Up @@ -168,6 +169,7 @@ const envToDomain = ({
VITE_FIAT_EXCHANGE_RATES_API_KEY,
VITE_FIAT_EXCHANGE_RATES_API_URL,
VITE_FIAT_EXCHANGE_RATES_ETHEREUM_USDC_ADDRESS,
VITE_LOGO_PATH,
VITE_OUTDATED_NETWORK_MODAL_MESSAGE_PARAGRAPH_1,
VITE_OUTDATED_NETWORK_MODAL_MESSAGE_PARAGRAPH_2,
VITE_OUTDATED_NETWORK_MODAL_TITLE,
Expand All @@ -189,6 +191,7 @@ const envToDomain = ({
VITE_ETHEREUM_FORCE_UPDATE_GLOBAL_EXIT_ROOT
);
const bridgeApiUrl = VITE_BRIDGE_API_URL;
const logoPath = VITE_LOGO_PATH;
const outdatedNetworkModal: domain.Env["outdatedNetworkModal"] = isOutdatedNetworkModalEnabled
? {
isEnabled: true,
Expand Down Expand Up @@ -235,6 +238,7 @@ const envToDomain = ({
}),
forceUpdateGlobalExitRootForL1,
isDepositWarningEnabled,
logoPath,
outdatedNetworkModal,
reportForm: getReportFormEnv({
VITE_ENABLE_REPORT_FORM,
Expand Down Expand Up @@ -264,6 +268,7 @@ const envParser = StrictSchema<Env, domain.Env>()(
VITE_FIAT_EXCHANGE_RATES_API_KEY: z.string().optional(),
VITE_FIAT_EXCHANGE_RATES_API_URL: z.string().url().optional(),
VITE_FIAT_EXCHANGE_RATES_ETHEREUM_USDC_ADDRESS: z.string().length(42).optional(),
VITE_LOGO_PATH: z.string(),
VITE_OUTDATED_NETWORK_MODAL_MESSAGE_PARAGRAPH_1: z.string().optional(),
VITE_OUTDATED_NETWORK_MODAL_MESSAGE_PARAGRAPH_2: z.string().optional(),
VITE_OUTDATED_NETWORK_MODAL_TITLE: z.string().optional(),
Expand Down
16 changes: 16 additions & 0 deletions src/assets/gpt-logo-white-transparent.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/domain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export interface Env {
};
forceUpdateGlobalExitRootForL1: boolean;
isDepositWarningEnabled: boolean;
logoPath: string;
outdatedNetworkModal:
| {
isEnabled: false;
Expand Down
6 changes: 4 additions & 2 deletions src/views/home/components/header/header.view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Link } from "react-router-dom";

import { ReactComponent as ClockIcon } from "src/assets/icons/clock.svg";
import { ReactComponent as SettingIcon } from "src/assets/icons/setting.svg";
import { ReactComponent as PolygonZkEVMLogo } from "src/assets/polygon-zkevm-logo.svg";
import { ReactComponent as Logo } from "src/assets/polygon-zkevm-logo.svg";
import { useEnvContext } from "src/contexts/env.context";
import { routes } from "src/routes";
import { areSettingsVisible } from "src/utils/feature-toggles";
Expand All @@ -19,6 +19,8 @@ export const Header: FC = () => {
return null;
}

const logo = env.logoPath;

return (
<header className={classes.header}>
<div className={`${classes.block} ${classes.leftBlock}`}>
Expand All @@ -35,7 +37,7 @@ export const Header: FC = () => {
</Link>
</div>
<div className={`${classes.block} ${classes.centerBlock}`}>
<PolygonZkEVMLogo className={classes.logo} />
{logo ? <img className={classes.logo} src={logo}></img> : <Logo className={classes.logo} />}
</div>
<div className={`${classes.block} ${classes.rightBlock}`}>
<NetworkSelector />
Expand Down
5 changes: 3 additions & 2 deletions src/views/login/login.view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useLocation, useNavigate } from "react-router-dom";

import { routerStateParser } from "src/adapters/browser";
import { getPolicyCheck, setPolicyCheck } from "src/adapters/storage";
import { ReactComponent as PolygonZkEVMLogo } from "src/assets/polygon-zkevm-logo.svg";
import { ReactComponent as Logo } from "src/assets/polygon-zkevm-logo.svg";
import { useEnvContext } from "src/contexts/env.context";
import { useProvidersContext } from "src/contexts/providers.context";
import { EthereumChainId, PolicyCheck, WalletName } from "src/domain";
Expand Down Expand Up @@ -59,14 +59,15 @@ export const Login: FC = () => {
return null;
}

const logo = env.logoPath;
const ethereumChain = env.chains[0];
const deploymentName = getDeploymentName(ethereumChain);
const appName = deploymentName !== undefined ? `${deploymentName} Bridge` : "Bridge";

return (
<div className={classes.login}>
<div className={classes.contentWrapper}>
<PolygonZkEVMLogo className={classes.logo} />
{logo ? <img className={classes.logo} src={logo}></img> : <Logo className={classes.logo} />}
<Typography className={classes.appName} type="body1">
{appName}
</Typography>
Expand Down
5 changes: 0 additions & 5 deletions src/views/network-error/network-error.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ export const useNetworkErrorStyles = createUseStyles((theme: Theme) => ({
marginTop: theme.spacing(4),
padding: [theme.spacing(1), theme.spacing(5)],
},
logo: {
marginBottom: theme.spacing(4),
maxWidth: "300px",
width: "100%",
},
textBox: {
backgroundColor: theme.palette.white,
borderRadius: 8,
Expand Down
2 changes: 0 additions & 2 deletions src/views/network-error/network-error.view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { FC, useEffect } from "react";
import { Navigate, useLocation, useNavigate } from "react-router-dom";

import { providerError } from "src/adapters/error";
import { ReactComponent as PolygonZkEVMLogo } from "src/assets/polygon-zkevm-logo.svg";
import { useEnvContext } from "src/contexts/env.context";
import { ProviderError } from "src/domain";
import { routes } from "src/routes";
Expand All @@ -25,7 +24,6 @@ export const NetworkError: FC = () => {

return parsedProviderError.success ? (
<div className={classes.wrapper}>
<PolygonZkEVMLogo className={classes.logo} />
<div className={classes.textBox}>
<Typography type="h1">Network Error</Typography>
<Typography type="body1">
Expand Down

0 comments on commit fc669d1

Please sign in to comment.