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(ga setup): add pag titles, add error boundary #1049

Merged
merged 1 commit into from
May 9, 2022
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
4 changes: 4 additions & 0 deletions astro_2.0/features/CreateDao/CreateDao.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useEffect, useState, VFC } from 'react';
import { StateMachineProvider, createStore } from 'little-state-machine';
import { useRouter } from 'next/router';
import Head from 'next/head';

import { STEPS } from 'astro_2.0/features/CreateDao/constants';

Expand Down Expand Up @@ -88,6 +89,9 @@ export const CreateDao: VFC<CreateDaoProps> = ({ defaultFlag }) => {

return (
<StateMachineProvider>
<Head>
<title>Create DAO</title>
</Head>
<StepWrapper>{renderContent()}</StepWrapper>
</StateMachineProvider>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { FC } from 'react';

import Head from 'next/head';
import { Tabs } from 'components/Tabs';
import { useSearchResults } from 'features/search/search-results/SearchResults';
import { DaosTabView } from 'features/search/search-results/components/daos-tab-view';
Expand Down Expand Up @@ -34,6 +35,9 @@ export const SearchResultsRenderer: FC = () => {

return (
<div className={styles.root}>
<Head>
<title>Search results</title>
</Head>
<div className={styles.header}>
<span className={styles.secondaryLabel}>results for</span>
<span>&nbsp;&lsquo;{searchResults?.query}&rsquo;</span>
Expand Down
5 changes: 4 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { WrappedWalletContext } from 'context/WalletContext';
import { CookieService } from 'services/CookieService';
import { DAO_COOKIE, DEFAULT_OPTIONS } from 'constants/cookies';
import { AppMonitoring } from 'astro_2.0/features/AppMonitoring/AppMonitoring';
import ErrorBoundary from 'astro_2.0/components/ErrorBoundary';

function App({ Component, pageProps }: AppProps): JSX.Element | null {
const router = useRouter();
Expand All @@ -44,7 +45,9 @@ function App({ Component, pageProps }: AppProps): JSX.Element | null {
</Head>

<PageLayout>
<Component {...pageProps} />
<ErrorBoundary>
<Component {...pageProps} />
</ErrorBoundary>
</PageLayout>

<MobileNav />
Expand Down
4 changes: 4 additions & 0 deletions pages/all/daos/AllDaosPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import InfiniteScroll from 'react-infinite-scroll-component';
import { useRouter } from 'next/router';
import { TFunction, useTranslation } from 'next-i18next';
import { useAsyncFn } from 'react-use';
import Head from 'next/head';

import { DaoFeedItem } from 'types/dao';

Expand Down Expand Up @@ -144,6 +145,9 @@ const AllDaosPage: FC<BrowseAllDaosProps> = ({

return (
<DaosList label="allDaos">
<Head>
<title>All Daos</title>
</Head>
<div className={styles.filter}>
<Dropdown
options={sortOptions}
Expand Down
8 changes: 7 additions & 1 deletion pages/all/feed/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ import { LIST_LIMIT_DEFAULT } from 'services/sputnik/constants';
import { Feed } from 'astro_2.0/features/Feed';
import { CookieService } from 'services/CookieService';
import { ACCOUNT_COOKIE } from 'constants/cookies';
import Head from 'next/head';

const MyFeedPage = (props: React.ComponentProps<typeof Feed>): JSX.Element => (
<Feed {...props} title="Global Feed" />
<>
<Head>
<title>Global feed</title>
</Head>
<Feed {...props} title="Global Feed" />
</>
);

export const getServerSideProps: GetServerSideProps<React.ComponentProps<
Expand Down
4 changes: 4 additions & 0 deletions pages/dao/[dao]/dao/DaoPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { NextPage } from 'next';
import React, { useMemo } from 'react';
import Head from 'next/head';

import { PaginationResponse } from 'types/api';
import { Proposal } from 'types/proposal';
Expand Down Expand Up @@ -29,6 +30,9 @@ const DAOHome: NextPage<DaoHomeProps> = ({ daoContext }) => {

return (
<>
<Head>
<title>DAO Main Page</title>
</Head>
<NestedDaoPageWrapper
daoContext={daoContext}
breadcrumbs={breadcrumbs}
Expand Down
4 changes: 4 additions & 0 deletions pages/dao/[dao]/governance/settings/SettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DaoContext } from 'types/context';
import { NestedDaoPageWrapper } from 'astro_2.0/features/pages/nestedDaoPagesContent/NestedDaoPageWrapper';
import { useGetBreadcrumbsConfig } from 'hooks/useGetBreadcrumbsConfig';
import { SettingsPageContent } from 'astro_2.0/features/pages/nestedDaoPagesContent/SettingsPageContent';
import Head from 'next/head';

export interface SettingsPageProps {
daoContext: DaoContext;
Expand All @@ -32,6 +33,9 @@ const SettingsPage: NextPage<SettingsPageProps> = ({ daoContext }) => {
breadcrumbs={breadcrumbs}
defaultProposalType={ProposalVariant.ProposeChangeDaoName}
>
<Head>
<title>DAO Settings</title>
</Head>
<SettingsPageContent daoContext={daoContext} />
</NestedDaoPageWrapper>
);
Expand Down
4 changes: 4 additions & 0 deletions pages/dao/[dao]/governance/settings/config/DaoConfigPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DaoContext } from 'types/context';
import { NestedDaoPageWrapper } from 'astro_2.0/features/pages/nestedDaoPagesContent/NestedDaoPageWrapper';
import { useGetBreadcrumbsConfig } from 'hooks/useGetBreadcrumbsConfig';
import { DaoConfigPageContent } from 'astro_2.0/features/pages/nestedDaoPagesContent/DaoConfigPageContent';
import Head from 'next/head';

export interface DaoConfigPageProps {
daoContext: DaoContext;
Expand All @@ -33,6 +34,9 @@ const DaoConfigPage: NextPage<DaoConfigPageProps> = ({ daoContext }) => {
breadcrumbs={breadcrumbs}
defaultProposalType={ProposalVariant.ProposeChangeDaoName}
>
<Head>
<title>DAO Config</title>
</Head>
<DaoConfigPageContent daoContext={daoContext} />
</NestedDaoPageWrapper>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { NestedDaoPageWrapper } from 'astro_2.0/features/pages/nestedDaoPagesCon
import { useGetBreadcrumbsConfig } from 'hooks/useGetBreadcrumbsConfig';
import { CustomFunctionCallTemplatesPageContent } from 'astro_2.0/features/pages/nestedDaoPagesContent/CustomFunctionCallTemplatesPageContent';
import { DaoFeedItem } from 'types/dao';
import Head from 'next/head';

interface Props {
daoContext: DaoContext;
Expand Down Expand Up @@ -35,6 +36,9 @@ const CustomTemplatesPage: NextPage<Props> = ({ daoContext, accountDaos }) => {
breadcrumbs={breadcrumbs}
defaultProposalType={ProposalVariant.ProposeChangeDaoName}
>
<Head>
<title>DAO Custom FC Templates</title>
</Head>
<CustomFunctionCallTemplatesPageContent
daoContext={daoContext}
accountDaos={accountDaos}
Expand Down
4 changes: 4 additions & 0 deletions pages/dao/[dao]/governance/settings/policy/DaoPolicyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DaoContext } from 'types/context';
import { NestedDaoPageWrapper } from 'astro_2.0/features/pages/nestedDaoPagesContent/NestedDaoPageWrapper';
import { useGetBreadcrumbsConfig } from 'hooks/useGetBreadcrumbsConfig';
import { DaoPolicyPageContent } from 'astro_2.0/features/pages/nestedDaoPagesContent/DaoPolicyPageContent';
import Head from 'next/head';

export interface DaoPolicyPageProps {
daoContext: DaoContext;
Expand All @@ -33,6 +34,9 @@ const DaoPolicyPage: NextPage<DaoPolicyPageProps> = ({ daoContext }) => {
breadcrumbs={breadcrumbs}
defaultProposalType={ProposalVariant.ProposeChangeVotingPolicy}
>
<Head>
<title>DAO Policy</title>
</Head>
<DaoPolicyPageContent daoContext={daoContext} />
</NestedDaoPageWrapper>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DaoContext } from 'types/context';
import { NestedDaoPageWrapper } from 'astro_2.0/features/pages/nestedDaoPagesContent/NestedDaoPageWrapper';
import { useGetBreadcrumbsConfig } from 'hooks/useGetBreadcrumbsConfig';
import { DaoVersionPageContent } from 'astro_2.0/features/pages/nestedDaoPagesContent/DaoVersionPageContent';
import Head from 'next/head';

export interface DaoVersionUpdatePageProps {
daoContext: DaoContext;
Expand Down Expand Up @@ -35,6 +36,9 @@ const DaoVersionUpdatePage: NextPage<DaoVersionUpdatePageProps> = ({
breadcrumbs={breadcrumbs}
defaultProposalType={ProposalVariant.ProposeChangeVotingPolicy}
>
<Head>
<title>DAO Version</title>
</Head>
<DaoVersionPageContent daoContext={daoContext} />
</NestedDaoPageWrapper>
);
Expand Down
4 changes: 4 additions & 0 deletions pages/dao/[dao]/groups/[group]/GroupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useGetBreadcrumbsConfig } from 'hooks/useGetBreadcrumbsConfig';

import { GroupsPageContent } from 'astro_2.0/features/pages/nestedDaoPagesContent/GroupsPageContent';
import { NestedDaoPageWrapper } from 'astro_2.0/features/pages/nestedDaoPagesContent/NestedDaoPageWrapper';
import Head from 'next/head';

export interface GroupPageProps {
daoContext: DaoContext;
Expand Down Expand Up @@ -50,6 +51,9 @@ const GroupPage: VFC<GroupPageProps> = ({ daoContext, membersStats }) => {
breadcrumbs={breadcrumbs}
defaultProposalType={ProposalVariant.ProposeCreateGroup}
>
<Head>
<title>DAO Groups Page</title>
</Head>
<GroupsPageContent
daoContext={daoContext}
membersStats={membersStats}
Expand Down
4 changes: 4 additions & 0 deletions pages/dao/[dao]/proposals/ProposalsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { FeedProposals } from 'astro_2.0/features/FeedProposals';
import { NestedDaoPageWrapper } from 'astro_2.0/features/pages/nestedDaoPagesContent/NestedDaoPageWrapper';
import { useGetBreadcrumbsConfig } from 'hooks/useGetBreadcrumbsConfig';
import { useBlockchainWarning } from 'hooks/useBlockchainWarning';
import Head from 'next/head';

interface ProposalsPageProps {
daoContext: DaoContext;
Expand Down Expand Up @@ -39,6 +40,9 @@ const ProposalsPage: VFC<ProposalsPageProps> = props => {

return (
<NestedDaoPageWrapper daoContext={daoContext} breadcrumbs={breadcrumbs}>
<Head>
<title>DAO Proposals</title>
</Head>
<FeedProposals
dao={dao}
key={dao.id}
Expand Down
2 changes: 1 addition & 1 deletion pages/dao/[dao]/proposals/[proposal]/ProposalPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const ProposalPage: NextPage<ProposalPageProps> = ({
return (
<>
<Head>
<title>Astro</title>
<title>DAO Proposal</title>
<meta property="og:url" content={router.asPath} />
<meta property="og:type" content="website" />
<meta property="og:title" content="Astro" />
Expand Down
2 changes: 1 addition & 1 deletion pages/dao/[dao]/tasks/bounties/[bounty]/BountyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const BountyPage: NextPage<BountyPageProps> = ({
return (
<>
<Head>
<title>Astro</title>
<title>Bounty</title>
<meta property="og:url" content={router.asPath} />
<meta property="og:type" content="website" />
<meta property="og:title" content="Astro" />
Expand Down
4 changes: 4 additions & 0 deletions pages/dao/[dao]/tasks/bounties/feed/BountiesFeedPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useGetBreadcrumbsConfig } from 'hooks/useGetBreadcrumbsConfig';
import { BountiesPageContent } from 'astro_2.0/features/pages/nestedDaoPagesContent/BountiesPageContent';
import { BountiesFeed } from 'astro_2.0/features/Bounties/components/BountiesFeed';
import { PaginationResponse } from 'types/api';
import Head from 'next/head';

export interface BountiesFeedPageProps {
daoContext: DaoContext;
Expand Down Expand Up @@ -40,6 +41,9 @@ const BountiesFeedPage: VFC<BountiesFeedPageProps> = ({
breadcrumbs={breadcrumbs}
defaultProposalType={ProposalVariant.ProposeCreateBounty}
>
<Head>
<title>Bounties feed</title>
</Head>
<BountiesPageContent daoContext={daoContext}>
<BountiesFeed initialData={bountiesContext} />
</BountiesPageContent>
Expand Down
4 changes: 4 additions & 0 deletions pages/dao/[dao]/tasks/bounties/list/BountiesListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useGetBreadcrumbsConfig } from 'hooks/useGetBreadcrumbsConfig';

import { BountiesPageContent } from 'astro_2.0/features/pages/nestedDaoPagesContent/BountiesPageContent';
import { BountiesListView } from 'astro_2.0/features/Bounties/components/BountiesListView';
import Head from 'next/head';

export interface BountiesListPageProps {
daoContext: DaoContext;
Expand Down Expand Up @@ -39,6 +40,9 @@ const BountiesListPage: VFC<BountiesListPageProps> = ({
breadcrumbs={breadcrumbs}
defaultProposalType={ProposalVariant.ProposeCreateBounty}
>
<Head>
<title>Bounties list</title>
</Head>
<BountiesPageContent daoContext={daoContext}>
<BountiesListView bountiesContext={bountiesContext} />
</BountiesPageContent>
Expand Down
4 changes: 4 additions & 0 deletions pages/dao/[dao]/tasks/plugins/PluginsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import styles from 'pages/dao/[dao]/tasks/plugins/plugins.module.scss';
import { PLUGIN_INITIAL_DATA, PLUGINS_DATA } from 'mocks/pluginsPageData';
import { WalletType } from 'types/config';
import { useWalletContext } from 'context/WalletContext';
import Head from 'next/head';

interface PluginPageProps {
plugins: PluginCardProps[];
Expand Down Expand Up @@ -75,6 +76,9 @@ const PluginsPage: FC<PluginPageProps> = ({ plugins = PLUGINS_DATA }) => {
return (
<div className={styles.root}>
<div className={styles.header}>
<Head>
<title>Plugins</title>
</Head>
<h1>Plugins</h1>
<Button variant="black" size="small" onClick={handleCreateClick}>
Run a plugin
Expand Down
4 changes: 4 additions & 0 deletions pages/dao/[dao]/tasks/polls/PollsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { FC, useMemo } from 'react';
import Head from 'next/head';

// Types
import { PaginationResponse } from 'types/api';
Expand Down Expand Up @@ -49,6 +50,9 @@ const PollsPage: FC<PollsPageProps> = ({
breadcrumbs={breadcrumbs}
defaultProposalType={ProposalVariant.ProposeCreateBounty}
>
<Head>
<title>Polls</title>
</Head>
<Feed
title={<h1 className={styles.header}>Polls</h1>}
dao={daoContext.dao}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { useMemo, VFC } from 'react';
import React, { useMemo, VFC } from 'react';

import { DaoContext } from 'types/context';

import { useGetBreadcrumbsConfig } from 'hooks/useGetBreadcrumbsConfig';

import { NestedDaoPageWrapper } from 'astro_2.0/features/pages/nestedDaoPagesContent/NestedDaoPageWrapper';
import { CreateGovernanceTokenPageContent } from 'astro_2.0/features/pages/nestedDaoPagesContent/CreateGovernanceTokenPageContent';
import Head from 'next/head';

export interface GovernanceTokenProps {
daoContext: DaoContext;
Expand All @@ -30,6 +31,9 @@ const CreateGovernanceToken: VFC<GovernanceTokenProps> = props => {

return (
<NestedDaoPageWrapper daoContext={daoContext} breadcrumbs={breadcrumbs}>
<Head>
<title>Create governance token</title>
</Head>
<CreateGovernanceTokenPageContent daoContext={daoContext} />
</NestedDaoPageWrapper>
);
Expand Down
4 changes: 4 additions & 0 deletions pages/dao/[dao]/treasury/nfts/NFTs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { NextPage } from 'next';
import { useRouter } from 'next/router';
import uniqBy from 'lodash/uniqBy';
import isEmpty from 'lodash/isEmpty';
import Head from 'next/head';

import { NFTCard } from 'astro_2.0/features/pages/nft/NtfCard';

Expand Down Expand Up @@ -86,6 +87,9 @@ const NFTs: NextPage<NFTsPageProps> = ({ daoContext }) => {
breadcrumbs={breadcrumbs}
defaultProposalType={ProposalVariant.ProposeCustomFunctionCall}
>
<Head>
<title>NFTs</title>
</Head>
{nfts.length === 0 ? (
<NoResultsView title="No NFTs available" />
) : (
Expand Down
4 changes: 4 additions & 0 deletions pages/dao/[dao]/treasury/tokens/TokensPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import classNames from 'classnames';
import { useTranslation } from 'next-i18next';
import { useFlags } from 'launchdarkly-react-client-sdk';
import React, { useCallback, useMemo, useState } from 'react';
import Head from 'next/head';

import { CREATE_GOV_TOKEN_PAGE_URL } from 'constants/routing';

Expand Down Expand Up @@ -123,6 +124,9 @@ const TokensPage: NextPage<TokensPageProps> = ({

return (
<>
<Head>
<title>Treasury</title>
</Head>
<div className={styles.chart}>
{viewToken !== 'NEAR' && !!chartData.length && !loading && (
<AreaChart
Expand Down
4 changes: 4 additions & 0 deletions pages/discover/DiscoverPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { NextPage } from 'next';
import React, { useCallback, useEffect } from 'react';
import { useTranslation } from 'next-i18next';
import { useRouter } from 'next/router';
import Head from 'next/head';

import { Button } from 'components/button/Button';
import { SearchInput } from 'astro_2.0/components/SearchInput';
Expand Down Expand Up @@ -95,6 +96,9 @@ const DiscoverPage: NextPage = () => {

return (
<DaoStatsDataProvider>
<Head>
<title>Discovery</title>
</Head>
<div className={styles.root}>
<div className={styles.header}>
<div className={styles.row}>
Expand Down
Loading