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

🔥 remove banner #196

Merged
merged 1 commit into from
May 3, 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
23 changes: 0 additions & 23 deletions components/Banner.tsx

This file was deleted.

4 changes: 1 addition & 3 deletions components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,7 @@ const Sidebar = ({

return (
<aside
className={`fixed bottom-0 left-0 ${
state.hasBanner ? "top-32" : "top-20"
} z-10 w-72 bg-zinc-700 px-4 py-4 md:py-8 ${
className={`fixed bottom-0 left-0 top-20 z-10 w-72 bg-zinc-700 px-4 py-4 md:py-8 ${
isOpen ? "translate-x-0" : "-translate-x-full"
} overflow-y-auto md:-translate-x-0`}
>
Expand Down
4 changes: 1 addition & 3 deletions components/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ function Modal(props: React.PropsWithChildren<{ opened: boolean }>) {
return props.opened
? ReactDOM.createPortal(
<div
className={`${
state.hasBanner ? "top-12 md:top-32" : "top-0 md:top-20"
} fixed bottom-0 left-0 right-0 z-50 flex grow items-center justify-center bg-black bg-slate-800 bg-opacity-70 md:left-72`}
className={`fixed bottom-0 left-0 right-0 top-0 z-50 flex grow items-center justify-center bg-black bg-slate-800 bg-opacity-70 md:left-72 md:top-20`}
>
<div
className={
Expand Down
6 changes: 3 additions & 3 deletions components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ const NavBar = (_: React.PropsWithChildren) => {

return (
<nav
className={`${menuOpen ? "h-auto" : "h-20"} fixed ${
state?.hasBanner ? "top-12" : "top-0"
} left-0 right-0 z-40 flex w-full flex-col items-center border-b-4 border-zinc-500 bg-graybg md:flex-row`}
className={`${
menuOpen ? "h-auto" : "h-20"
} fixed left-0 right-0 top-0 z-40 flex w-full flex-col items-center border-b-4 border-zinc-500 bg-graybg md:flex-row`}
>
<div className="mx-auto w-full px-4">
<div className="flex h-16 items-center justify-between">
Expand Down
4 changes: 1 addition & 3 deletions components/transferForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,7 @@ function TransferForm(
id="top"
>
<div
className={`sticky z-[5] ${
state.hasBanner ? "top-36" : "top-24"
} ${
className={`sticky top-24 z-[5] ${
isMenuOpen
? "w-full"
: "ml-auto h-12 w-full overflow-hidden"
Expand Down
12 changes: 1 addition & 11 deletions context/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ type tezosState = {
contracts: { [address: string]: contractStorage };
aliases: { [address: string]: string };
aliasTrie: Trie<string>;
hasBanner: boolean;
delegatorAddresses: string[] | undefined;
connectedDapps: {
[address: string]: {
Expand Down Expand Up @@ -77,7 +76,6 @@ let emptyState = (): tezosState => {
accountInfo: null,
connection,
aliasTrie: new Trie<string>(),
hasBanner: true,
delegatorAddresses: undefined,
connectedDapps: {},
proposalRefresher: 0,
Expand Down Expand Up @@ -127,10 +125,6 @@ type action =
keepOld: boolean;
};
}
| {
type: "setBanner";
payload: boolean;
}
| {
type: "addDapp";
payload: {
Expand Down Expand Up @@ -356,11 +350,7 @@ function reducer(state: tezosState, action: action): tezosState {

return newState;
}
case "setBanner":
return {
...state,
hasBanner: action.payload,
};

case "setDelegatorAddresses":
return { ...state, delegatorAddresses: action.payload };
case "refreshProposals":
Expand Down
15 changes: 1 addition & 14 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type { AppProps } from "next/app";
import { usePathname } from "next/navigation";
import { useRouter } from "next/router";
import { useReducer, useEffect, useState } from "react";
import Banner from "../components/Banner";
import LoginModal from "../components/LoginModal";
import PoeModal from "../components/PoeModal";
import Sidebar from "../components/Sidebar";
Expand Down Expand Up @@ -241,14 +240,6 @@ export default function App({ Component, pageProps }: AppProps) {
/>
)}
<PoeModal />
<Banner>
<span className="font-light">Make sure the URL is </span>
{PREFERED_NETWORK === NetworkType.MAINNET
? "tzsafe.marigold.dev"
: PREFERED_NETWORK === NetworkType.GHOSTNET
? "ghostnet.tzsafe.marigold.dev"
: "a valid URL"}
</Banner>
<NavBar />

{isSidebarHidden ? null : (
Expand All @@ -259,11 +250,7 @@ export default function App({ Component, pageProps }: AppProps) {
/>
)}

<div
className={`pb-28 pt-20 ${isSidebarHidden ? "" : "md:pl-72"} ${
state.hasBanner ? "mt-12" : ""
}`}
>
<div className={`pb-28 pt-20 ${isSidebarHidden ? "" : "md:pl-72"}`}>
<button
className="ml-4 mt-4 flex items-center space-x-2 text-zinc-300 md:hidden"
onClick={() => {
Expand Down
Loading