Skip to content

Commit

Permalink
Merge pull request #1021 from Giveth/develop
Browse files Browse the repository at this point in the history
Release 2.0.10
  • Loading branch information
MohammadPCh authored Jun 28, 2022
2 parents 6d54dbc + 12e9964 commit 4bb51d2
Show file tree
Hide file tree
Showing 135 changed files with 1,744 additions and 1,622 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ yarn-error.log*

# Sentry
.sentryclirc

public/robots.txt
7 changes: 7 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
var pjson = require('./package.json');
const generateRobotsTxt = require('./scripts/generate-robots-txt');

const moduleExports = withBundleAnalyzer({
// Your existing module.exports
Expand All @@ -25,6 +26,12 @@ const moduleExports = withBundleAnalyzer({
// ssr and displayName are configured by default
styledComponents: true,
},
webpack: (config, { isServer, dev }) => {
if (isServer && !dev) {
generateRobotsTxt();
}
return config;
},
});

const sentryWebpackPluginOptions = {
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "givethdapp",
"version": "2.0.9",
"version": "2.0.10",
"private": true,
"scripts": {
"build": "next build",
Expand All @@ -17,7 +17,7 @@
"@ethersproject/contracts": "^5.5.0",
"@ethersproject/providers": "^5.5.0",
"@ethersproject/units": "^5.5.0",
"@giveth/ui-design-system": "^1.8.3",
"@giveth/ui-design-system": "^1.8.8",
"@gnosis.pm/safe-apps-web3-react": "^1.3.0",
"@reduxjs/toolkit": "^1.8.1",
"@sentry/nextjs": "^6.19.3",
Expand All @@ -42,12 +42,13 @@
"quill-emoji": "^0.2.0",
"quill-image-drop-and-paste": "^1.2.10",
"quill-image-resize-module": "^3.0.0",
"quill-magic-url": "^4.1.4",
"quill-magic-url": "4.1.4",
"react": "^18.0.0",
"react-custom-scrollbars": "^4.2.1",
"react-dom": "^18.0.0",
"react-dropzone": "^11.5.3",
"react-google-maps": "^9.4.5",
"react-hook-form": "^7.32.2",
"react-hot-toast": "^2.1.1",
"react-lottie": "^1.2.3",
"react-places-autocomplete": "^7.3.0",
Expand Down
27 changes: 13 additions & 14 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import NProgress from 'nprogress';

import { useRouter } from 'next/router';
import { Provider } from 'react-redux';
import { GeneralProvider } from '@/context/general.context';
import { useApollo } from '@/apollo/apolloClient';
import { HeaderWrapper } from '@/components/Header/HeaderWrapper';
import { FooterWrapper } from '@/components/Footer/FooterWrapper';
Expand All @@ -19,6 +18,7 @@ import SubgraphController from '@/components/controller/subgraph.ctrl';
import UserController from '@/components/controller/user.ctrl';
import ModalController from '@/components/controller/modal.ctrl';
import PriceController from '@/components/controller/price.ctrl';
import GeneralController from '@/components/controller/general.ctrl';
import type { AppProps } from 'next/app';

function getLibrary(provider: ExternalProvider) {
Expand Down Expand Up @@ -58,19 +58,18 @@ function MyApp({ Component, pageProps }: AppProps) {
/>
</Head>
<Provider store={store}>
<GeneralProvider>
<ApolloProvider client={apolloClient}>
<Web3ReactProvider getLibrary={getLibrary}>
<PriceController />
<SubgraphController />
<UserController />
<HeaderWrapper />
<Component {...pageProps} />
<FooterWrapper />
<ModalController />
</Web3ReactProvider>
</ApolloProvider>
</GeneralProvider>
<ApolloProvider client={apolloClient}>
<Web3ReactProvider getLibrary={getLibrary}>
<GeneralController />
<PriceController />
<SubgraphController />
<UserController />
<HeaderWrapper />
<Component {...pageProps} />
<FooterWrapper />
<ModalController />
</Web3ReactProvider>
</ApolloProvider>
</Provider>
<Toaster containerStyle={{ top: '80px' }} />
</>
Expand Down
5 changes: 1 addition & 4 deletions pages/about.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import Head from 'next/head';
import AboutIndex from '@/components/views/about/AboutIndex';
import { aboutMetatags } from '@/content/metatags';
import { GeneralMetatags } from '@/components/Metatag';

const AboutRoute = () => {
return (
<>
<Head>
<GeneralMetatags info={aboutMetatags} />
</Head>
<GeneralMetatags info={aboutMetatags} />
<AboutIndex />
</>
);
Expand Down
26 changes: 15 additions & 11 deletions pages/claim.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
import Head from 'next/head';
import { useEffect } from 'react';

import ClaimView from '@/components/views/claim/Claim.view';
import { ClaimProvider } from '@/context/claim.context';
import { ETheme, useGeneral } from '@/context/general.context';
import { useAppDispatch } from '@/features/hooks';
import {
setDarkTheme,
setLightTheme,
setShowHeader,
} from '@/features/general/general.slice';
import { claimMetatags } from '@/content/metatags';
import { GeneralMetatags } from '@/components/Metatag';

export default function GIVdropRoute() {
const { setShowHeader, setTheme } = useGeneral();
const dispatch = useAppDispatch();

useEffect(() => {
setShowHeader(false);
setTheme(ETheme.Dark);
dispatch(setShowHeader(false));
dispatch(setDarkTheme());
return () => {
setShowHeader(true);
setTheme(ETheme.Light);
dispatch(setShowHeader(true));
dispatch(setLightTheme());
};
}, [setShowHeader, setTheme]);
}, [dispatch]);

return (
<>
<Head>
<title>GIVdrop</title>
</Head>
<GeneralMetatags info={claimMetatags} />
<ClaimProvider>
<ClaimView />
</ClaimProvider>
Expand Down
7 changes: 3 additions & 4 deletions pages/create.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import Head from 'next/head';
import { GeneralMetatags } from '@/components/Metatag';
import CreateView from '@/components/views/create/CreateIndex';
import { createProjectMetatags } from '@/content/metatags';

const CreateRoute = () => {
return (
<>
<Head>
<title>Create a Project | Giveth</title>
</Head>
<GeneralMetatags info={createProjectMetatags} />
<CreateView />
</>
);
Expand Down
6 changes: 3 additions & 3 deletions pages/donate/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const DonateRoute = (props: IProjectBySlug) => {
};

export async function getServerSideProps(props: { query: { slug: string } }) {
const { query } = props;
const slug = decodeURI(query.slug).replace(/\s/g, '');
try {
const { query } = props;
const slug = decodeURI(query.slug).replace(/\s/g, '');
const { data } = await client.query({
query: FETCH_PROJECT_BY_SLUG,
variables: { slug },
Expand All @@ -49,7 +49,7 @@ export async function getServerSideProps(props: { query: { slug: string } }) {
});
return {
redirect: {
destination: '/',
destination: '/maintenance',
permanent: false,
},
};
Expand Down
7 changes: 3 additions & 4 deletions pages/faq.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import Head from 'next/head';
import { GeneralMetatags } from '@/components/Metatag';
import FAQIndex from '@/components/views/FAQIndex';
import { faqMetatags } from '@/content/metatags';

const FAQRoute = () => {
return (
<div style={{ position: 'relative' }}>
<Head>
<title>FAQ | Giveth</title>
</Head>
<GeneralMetatags info={faqMetatags} />
<FAQIndex />
</div>
);
Expand Down
16 changes: 7 additions & 9 deletions pages/givbacks.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
import Head from 'next/head';
import { useEffect } from 'react';

import GIVbackView from '@/components/views/Back.view';
import { useGeneral, ETheme } from '@/context/general.context';
import { givbacksMetatags } from '@/content/metatags';
import { GeneralMetatags } from '@/components/Metatag';
import { useAppDispatch } from '@/features/hooks';
import { setDarkTheme, setLightTheme } from '@/features/general/general.slice';

export default function GIVbacksRoute() {
const { setTheme } = useGeneral();
const dispatch = useAppDispatch();

useEffect(() => {
setTheme(ETheme.Dark);
dispatch(setDarkTheme());
return () => {
setTheme(ETheme.Light);
dispatch(setLightTheme());
};
}, [setTheme]);
}, [dispatch]);
return (
<>
<Head>
<GeneralMetatags info={givbacksMetatags} />
</Head>
<GeneralMetatags info={givbacksMetatags} />
<GIVbackView />
</>
);
Expand Down
16 changes: 7 additions & 9 deletions pages/giveconomy.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
import Head from 'next/head';
import { useEffect } from 'react';

import HomeView from '@/components/views/Home.view';
import { ETheme, useGeneral } from '@/context/general.context';
import { giveconomyMetatags } from '@/content/metatags';
import { GeneralMetatags } from '@/components/Metatag';
import { setDarkTheme, setLightTheme } from '@/features/general/general.slice';
import { useAppDispatch } from '@/features/hooks';

export default function GIVeconomyRoute() {
const { setTheme } = useGeneral();
const dispatch = useAppDispatch();

useEffect(() => {
setTheme(ETheme.Dark);
dispatch(setDarkTheme());
return () => {
setTheme(ETheme.Light);
dispatch(setLightTheme());
};
}, [setTheme]);
}, [dispatch]);

return (
<>
<Head>
<GeneralMetatags info={giveconomyMetatags} />
</Head>
<GeneralMetatags info={giveconomyMetatags} />
<HomeView />
</>
);
Expand Down
16 changes: 7 additions & 9 deletions pages/givfarm.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
import Head from 'next/head';
import { useEffect } from 'react';

import GIVfarmView from '@/components/views/Farm.view';
import { useGeneral, ETheme } from '@/context/general.context';
import { givfarmMetatags } from '@/content/metatags';
import { GeneralMetatags } from '@/components/Metatag';
import { setDarkTheme, setLightTheme } from '@/features/general/general.slice';
import { useAppDispatch } from '@/features/hooks';

export default function GIVfarmRoute() {
const { setTheme } = useGeneral();
const dispatch = useAppDispatch();

useEffect(() => {
setTheme(ETheme.Dark);
dispatch(setDarkTheme());
return () => {
setTheme(ETheme.Light);
dispatch(setLightTheme());
};
}, [setTheme]);
}, [dispatch]);
return (
<>
<Head>
<GeneralMetatags info={givfarmMetatags} />
</Head>
<GeneralMetatags info={givfarmMetatags} />
<GIVfarmView />
</>
);
Expand Down
16 changes: 7 additions & 9 deletions pages/givgarden.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
import Head from 'next/head';
import { useEffect } from 'react';

import GIVgardenView from '@/components/views/Garden.view';
import { useGeneral, ETheme } from '@/context/general.context';
import { givgardenMetatags } from '@/content/metatags';
import { GeneralMetatags } from '@/components/Metatag';
import { setDarkTheme, setLightTheme } from '@/features/general/general.slice';
import { useAppDispatch } from '@/features/hooks';

export default function GIVgardenRoute() {
const { setTheme } = useGeneral();
const dispatch = useAppDispatch();

useEffect(() => {
setTheme(ETheme.Dark);
dispatch(setDarkTheme());
return () => {
setTheme(ETheme.Light);
dispatch(setLightTheme());
};
}, [setTheme]);
}, [dispatch]);
return (
<>
<Head>
<GeneralMetatags info={givgardenMetatags} />
</Head>
<GeneralMetatags info={givgardenMetatags} />
<GIVgardenView />
</>
);
Expand Down
16 changes: 7 additions & 9 deletions pages/givstream.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
import Head from 'next/head';
import { useEffect } from 'react';

import GIVstreamView from '@/components/views/Stream.view';
import { useGeneral, ETheme } from '@/context/general.context';
import { givstreamMetatags } from '@/content/metatags';
import { GeneralMetatags } from '@/components/Metatag';
import { setDarkTheme, setLightTheme } from '@/features/general/general.slice';
import { useAppDispatch } from '@/features/hooks';

export default function GIVstreamRoute() {
const { setTheme } = useGeneral();
const dispatch = useAppDispatch();

useEffect(() => {
setTheme(ETheme.Dark);
dispatch(setDarkTheme());
return () => {
setTheme(ETheme.Light);
dispatch(setLightTheme());
};
}, [setTheme]);
}, [dispatch]);
return (
<>
<Head>
<GeneralMetatags info={givstreamMetatags} />
</Head>
<GeneralMetatags info={givstreamMetatags} />
<GIVstreamView />
</>
);
Expand Down
Loading

1 comment on commit 4bb51d2

@vercel
Copy link

@vercel vercel bot commented on 4bb51d2 Jun 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

giveth-dapps-v2 – ./

giveth-dapps-v2-givethio.vercel.app
giveth.io
www.giveth.io
giveth-dapps-v2-git-main-givethio.vercel.app

Please sign in to comment.