Skip to content

Commit

Permalink
Hide network on sign in page
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev committed Dec 17, 2024
1 parent 8fba709 commit c5a99f1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function CreateControllerView({
: `Play ${theme.name}`
}
description="Connect your Controller"
hideNetwork
>
<form
style={{ width: "100%" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ import { useMemo } from "react";
export type TopBarProps = {
onBack?: () => void;
hideAccount?: boolean;
hideNetwork?: boolean;
onClose?: () => void;
};

export function TopBar({ onBack, hideAccount, onClose }: TopBarProps) {
export function TopBar({
onBack,
hideAccount,
hideNetwork,
onClose,
}: TopBarProps) {
const { openSettings, context } = useConnection();
const showSettings = useMemo(
() => !context || !["connect", "open-settings"].includes(context.type),
Expand Down Expand Up @@ -40,9 +46,10 @@ export function TopBar({ onBack, hideAccount, onClose }: TopBarProps) {

<Spacer />

{!hideNetwork && <NetworkStatus />}

{!hideAccount && (
<>
<NetworkStatus />
{/* {!!address && (
<>
<EthBalance chainId={chainId} address={address} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ export type HeaderProps = TopBarProps & BannerProps;

export function Header({
onBack,
hideNetwork,
hideAccount,
onClose,
...bannerProps
}: HeaderProps & { onClose?: () => void }) {
return (
<Box position="sticky" top={0} w="full" zIndex={1} bg="solid.bg">
<Banner {...bannerProps} />
<TopBar onBack={onBack} onClose={onClose} hideAccount={hideAccount} />
<TopBar
onBack={onBack}
onClose={onClose}
hideAccount={hideAccount}
hideNetwork={hideNetwork}
/>
</Box>
);
}
2 changes: 2 additions & 0 deletions packages/keychain/src/components/layout/Container/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export function Container({
onBack,
onClose,
hideAccount,
hideNetwork,
Icon,
icon,
title,
Expand All @@ -31,6 +32,7 @@ export function Container({
onBack={onBack}
onClose={onClose}
hideAccount={hideAccount}
hideNetwork={hideNetwork}
Icon={Icon}
icon={icon}
title={title}
Expand Down

0 comments on commit c5a99f1

Please sign in to comment.