Skip to content

Commit

Permalink
fix: network switch
Browse files Browse the repository at this point in the history
  • Loading branch information
fearlessfe committed Aug 25, 2024
1 parent 81121d4 commit 8300375
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
pull_request:
branches:
- "development"
types:
- closed

jobs:
build:
Expand Down
20 changes: 12 additions & 8 deletions src/components/NavMenusSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,29 @@ export const NavMenusSection: React.FC = () => {

const handleSelectNetwork = (e: Network) => {
const { origin } = networkConfigs[e];
if (origin.includes(window.location.origin)) return;
window.open(origin);
// window.open(origin);
if (origin.includes(window.location.host)) return;
const target = `${window.location.protocol}//${origin}`;
window.location.href = target;
};

return (
<div className="relative mx-auto flex max-w-screen-xl flex-wrap items-center justify-between p-4">
<Button
className={`md:hidden ${isMobileMenuOpen
? "stroke-controlBorderActive-light dark:stroke-controlBorderActive-dark"
: ""
}`}
className={`md:hidden ${
isMobileMenuOpen
? "stroke-controlBorderActive-light dark:stroke-controlBorderActive-dark"
: ""
}`}
variant="icon"
icon={isMobileMenuOpen ? <XMarkIcon /> : <Bars3Icon />}
aria-expanded={isMobileMenuOpen}
onClick={() => setIsMobileMenuOpen(!isMobileMenuOpen)}
/>
<div
className={`fixed inset-x-0 top-0 z-50 mt-14 transform ${isMobileMenuOpen ? "block" : "hidden"
} md:relative md:top-auto md:mt-0 md:block`}
className={`fixed inset-x-0 top-0 z-50 mt-14 transform ${
isMobileMenuOpen ? "block" : "hidden"
} md:relative md:top-auto md:mt-0 md:block`}
id="navbar-dropdown"
>
<div className="mx-auto w-full max-w-md rounded-lg bg-surface-light p-4 shadow-lg md:max-w-screen-xl md:bg-transparent md:p-0 md:shadow-none">
Expand Down

0 comments on commit 8300375

Please sign in to comment.