Skip to content

Commit

Permalink
fix navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotBraem committed Jan 29, 2024
1 parent f606797 commit 75feaa6
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 22 deletions.
21 changes: 15 additions & 6 deletions apps/builddao/widget/components/buttons/Connect.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { joinBtnChildren, connectedChildren, showActivity, className, href } = props;

const { Bullet } = VM.require("buildhub.near/widget/components.Bullet");
const DaoSDK = VM.require("sdks.near/widget/SDKs.Sputnik.DaoSDK");
const { joinBtnChildren, connectedChildren, showActivity, className } = props;

if (!DaoSDK) {
return <></>;
Expand Down Expand Up @@ -150,11 +151,19 @@ const Component = () => {
}
return <div>{connectedChildren}</div>;
} else {
return (
<button className={className} onClick={handleJoin}>
{joinBtnChildren}
</button>
);
if (href) {
return (
<a type="button" href={href} className={className}>
{joinBtnChildren}
</a>
);
} else {
return (
<button className={className} onClick={handleJoin}>
{joinBtnChildren}
</button>
);
}
}
};

Expand Down
3 changes: 2 additions & 1 deletion apps/builddao/widget/section/cta.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ return (
props={{
joinBtnChildren: "Join Now",
showActivity: true,
className: "custom-button"
className: "custom-button",
href: "/join"
}}
/>
</Card>
Expand Down
3 changes: 2 additions & 1 deletion apps/builddao/widget/section/join.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ return (
props={{
joinBtnChildren: "Join Now",
showActivity: true,
className: "custom-button"
className: "custom-button",
href: "/join"
}}
/>
</CTAContent>
Expand Down
38 changes: 24 additions & 14 deletions src/components/navigation/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from "styled-components";
import { UserDropdown } from "./desktop/UserDropdown";
import { Widget } from "near-social-vm";
import { useBosLoaderStore } from "../../stores/bos-loader";
import { Link } from "react-router-dom/cjs/react-router-dom.min";

const StyledNavbar = styled.nav`
display: flex;
Expand Down Expand Up @@ -147,7 +148,8 @@ export function Navbar(props) {
return (
<div
style={{
borderBottom: "1px solid var(--Stroke-color, rgba(255, 255, 255, 0.20))"
borderBottom:
"1px solid var(--Stroke-color, rgba(255, 255, 255, 0.20))",
}}
>
<StyledNavbar className="container-xl position-relative">
Expand Down Expand Up @@ -201,16 +203,21 @@ export function Navbar(props) {
</button>
)}
{props.signedIn && (
<Widget
src="buildhub.near/widget/components.buttons.Connect"
config={{
redirectMap: redirectStore.redirectMap
}}
props={{
connectedChildren: <UserDropdown {...props} />,
showActivity: false
}}
/>
<Link to="/join">
<Widget
src="buildhub.near/widget/components.buttons.Connect"
config={{
redirectMap: redirectStore.redirectMap,
}}
props={{
connectedChildren: <UserDropdown {...props} />,
showActivity: false,
className: "custom-button",
joinBtnChildren: "Join Now",
// href: "/join",
}}
/>
</Link>
)}
</div>

Expand All @@ -229,7 +236,7 @@ export function Navbar(props) {
padding: "24px 48px",
zIndex: 5,
borderBottom:
"1px solid var(--Stroke-color, rgba(255, 255, 255, 0.20))"
"1px solid var(--Stroke-color, rgba(255, 255, 255, 0.20))",
}}
>
<MobileLink
Expand Down Expand Up @@ -274,11 +281,14 @@ export function Navbar(props) {
<Widget
src="buildhub.near/widget/components.buttons.Connect"
config={{
redirectMap: redirectStore.redirectMap
redirectMap: redirectStore.redirectMap,
}}
props={{
connectedChildren: <UserDropdown {...props} />,
showActivity: false
showActivity: false,
className: "custom-button",
joinBtnChildren: "Join Now",
href: "/join",
}}
/>
</div>
Expand Down

0 comments on commit 75feaa6

Please sign in to comment.