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

feat: update route to founders page #982

Merged
merged 6 commits into from
Feb 22, 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
5 changes: 5 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ const nextConfig = {
source: '/papers/nightshade',
destination: '/files/nightshade.pdf',
permanent: true,
},
{
source: '/horizon',
destination: '/founders',
permanent: true,
}
];
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/navigation/navigation-categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const navigationCategories = [
},
{
title: 'Founders',
url: '/horizon',
url: '/founders',
icon: 'ph-lightbulb ph-bold',
},
{
Expand Down
3 changes: 3 additions & 0 deletions src/data/bos-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type NetworkComponents = {
termsPage: string;
privacyPage: string;
papersPage: string;
foundersPage: string;
};
relayerDemo: string;
notificationButton: string;
Expand Down Expand Up @@ -102,6 +103,7 @@ export const componentsByNetworkId = ((): Record<NetworkId, NetworkComponents |
termsPage: `${testnetTLA}/widget/NearOrg.TermsPage`,
privacyPage: `${testnetTLA}/widget/NearOrg.PrivacyPage`,
papersPage: `${testnetTLA}/widget/NearOrg.PapersPage`,
foundersPage: `${testnetTLA}/widget/NearOrg.FoundersPage`,
},
relayerDemo: 'one.testnet/widget/RelayerMessageDemo',
notificationButton: `${testnetTLA}/widget/NotificationButton`,
Expand Down Expand Up @@ -160,6 +162,7 @@ export const componentsByNetworkId = ((): Record<NetworkId, NetworkComponents |
termsPage: 'near/widget/NearOrg.TermsPage',
privacyPage: 'near/widget/NearOrg.PrivacyPage',
papersPage: 'near/widget/NearOrg.PapersPage',
foundersPage: 'near/widget/NearOrg.FoundersPage',
},
relayerDemo: 'relayer-demo.near/widget/RelayerMessageDemo',
notificationButton: 'near/widget/NotificationButton',
Expand Down
26 changes: 26 additions & 0 deletions src/pages/founders.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { ComponentWrapperPage } from '@/components/near-org/ComponentWrapperPage';
import { useBosComponents } from '@/hooks/useBosComponents';
import { useDefaultLayout } from '@/hooks/useLayout';
import type { NextPageWithLayout } from '@/utils/types';

import { zendeskActivate } from '@/utils/zendesk';

const FoundersPage: NextPageWithLayout = () => {
const components = useBosComponents();
return (
<ComponentWrapperPage
src={components.nearOrg.foundersPage}
meta={{
title: 'NEAR | FounderHub',
description: 'FounderHub is a one-stop shop for Founders building with the near ecosystem.',
}}
componentProps={{
zendeskActivate,
}}
/>
);
};

FoundersPage.getLayout = useDefaultLayout;

export default FoundersPage;
3 changes: 3 additions & 0 deletions src/utils/zendesk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ export const styleZendesk = () => {
zwIcon.style.paddingRight = '0';
zwLabel.remove();
};

export const zendeskActivate = () =>
typeof window !== 'undefined' ? (window.zE as { activate?: () => void })?.activate?.() || null : null;
Loading