Skip to content

Commit

Permalink
Merge pull request #1606 from Giveth/Release-2.3.0
Browse files Browse the repository at this point in the history
Release 2.3.0
  • Loading branch information
aminlatifi authored Oct 3, 2022
2 parents a38a3ef + 04c4fd7 commit 69a5a80
Show file tree
Hide file tree
Showing 142 changed files with 8,409 additions and 2,130 deletions.
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"cSpell.words": [
"giveth",
"merkle",
"xdai",
"GIVpower",
"GIVeconomy",
"GIVfarm",
"GIVback",
"GIVstream",
]
}
6 changes: 6 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@ const moduleExports = withBundleAnalyzer({
'static.tgbwidget.com',
'images.unsplash.com',
'd2m0e1zy3fwxmp.cloudfront.net', // temporal for CHANGE default image
'static.tgb-preprod.com',
'tgb-preproduction-formio.s3.amazonaws.com',
'dashboard.tgb-preprod.com',
],
},
compiler: {
// ssr and displayName are configured by default
styledComponents: true,
// removeConsole: {
// exclude: ['error'],
// },
},
redirects: () => {
return [
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "givethdapp",
"version": "2.2.8",
"version": "2.3.0",
"private": true,
"scripts": {
"build": "next build",
Expand All @@ -19,7 +19,7 @@
"@ethersproject/contracts": "^5.5.0",
"@ethersproject/providers": "^5.5.0",
"@ethersproject/units": "^5.5.0",
"@giveth/ui-design-system": "^1.8.22",
"@giveth/ui-design-system": "^1.8.26",
"@gnosis.pm/safe-apps-web3-react": "^1.5.0",
"@reduxjs/toolkit": "^1.8.1",
"@sentry/nextjs": "^6.19.3",
Expand All @@ -43,7 +43,8 @@
"quill-emoji": "^0.2.0",
"quill-image-drop-and-paste": "^1.2.11",
"quill-image-resize-module": "^3.0.0",
"quill-magic-url": "^4.1.7",
"quill-magic-url": "^4.2.0",
"rc-slider": "^10.0.1",
"react": "^18.2.0",
"react-custom-scrollbars": "^4.2.1",
"react-datepicker": "^4.8.0",
Expand All @@ -54,7 +55,7 @@
"react-hot-toast": "^2.1.1",
"react-lottie": "^1.2.3",
"react-places-autocomplete": "^7.3.0",
"react-quill": "^2.0.0-beta.4",
"react-quill": "^2.0.0",
"react-redux": "^8.0.1",
"react-select": "^5.2.1",
"react-share": "^4.4.0",
Expand All @@ -67,7 +68,7 @@
"@next/bundle-analyzer": "^12.1.4",
"@types/apollo-upload-client": "^14.1.0",
"@types/lodash.isequal": "^4.5.5",
"@types/node": "16.11.6",
"@types/node": "17.0.29",
"@types/nprogress": "^0.2.0",
"@types/react": "^18.0.15",
"@types/react-custom-scrollbars": "^4.0.9",
Expand Down
4 changes: 2 additions & 2 deletions pages/account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styled from 'styled-components';
import { H5 } from '@giveth/ui-design-system';
import Head from 'next/head';
import { FC } from 'react';
import UserPublicProfileView from '@/components/views/userPublicProfile/UserPublicProfile.view';
import UserProfileView from '@/components/views/userProfile/UserProfile.view';
import { useAppSelector } from '@/features/hooks';

const NoUserContainer = styled.div`
Expand All @@ -17,7 +17,7 @@ const UserRoute: FC = () => {
<title>Giveth | {user?.name}</title>
</Head>
{user ? (
<UserPublicProfileView user={user} myAccount />
<UserProfileView user={user} myAccount />
) : (
<NoUserContainer>
<H5>Not logged in or user not found</H5>
Expand Down
23 changes: 23 additions & 0 deletions pages/givpower.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { useEffect } from 'react';
import GIVpowerView from '@/components/views/Power.view';
import { GeneralMetatags } from '@/components/Metatag';
import { setDarkTheme, setLightTheme } from '@/features/general/general.slice';
import { useAppDispatch } from '@/features/hooks';
import { givpowerMetatags } from '@/content/metatags';

export default function GIVpowerRoute() {
const dispatch = useAppDispatch();

useEffect(() => {
dispatch(setDarkTheme());
return () => {
dispatch(setLightTheme());
};
}, [dispatch]);
return (
<>
<GeneralMetatags info={givpowerMetatags} />
<GIVpowerView />
</>
);
}
9 changes: 7 additions & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useAppSelector } from '@/features/hooks';
import { homeMetatags } from '@/content/metatags';
import { GeneralMetatags } from '@/components/Metatag';
import { transformGraphQLErrorsToStatusCode } from '@/helpers/requests';
import { IS_BOOSTING_ENABLED } from '@/configuration';

const projectsToFetch = 12;

Expand All @@ -20,7 +21,12 @@ interface IHomeRoute {
const fetchProjects = async (userId: string | undefined = undefined) => {
const variables: any = {
limit: projectsToFetch,
orderBy: { field: gqlEnums.QUALITYSCORE, direction: EDirection.DESC },
orderBy: {
field: IS_BOOSTING_ENABLED
? gqlEnums.GIVPOWER
: gqlEnums.QUALITYSCORE,
direction: EDirection.DESC,
},
};

if (userId) {
Expand Down Expand Up @@ -60,7 +66,6 @@ export async function getServerSideProps({ res }: any) {
'Cache-Control',
'public, s-maxage=10, stale-while-revalidate=59',
);

try {
const { projects, totalCount } = await fetchProjects();
return {
Expand Down
6 changes: 0 additions & 6 deletions pages/test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Head from 'next/head';
import styled from 'styled-components';
import { GetServerSideProps } from 'next';
import { useWeb3React } from '@web3-react/core';
Expand Down Expand Up @@ -42,9 +41,6 @@ const TestRoute = () => {

return (
<>
<Head>
<Asghar />
</Head>
<TestContainer>
<button
onClick={() => {
Expand Down Expand Up @@ -85,5 +81,3 @@ export const getServerSideProps: GetServerSideProps = async context => {
const TestContainer = styled.div`
padding: 200px;
`;

const Asghar = () => <title>Asghar kopak</title>;
4 changes: 2 additions & 2 deletions pages/user/[address].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FC } from 'react';
import { client } from '@/apollo/apolloClient';
import { GET_USER_BY_ADDRESS } from '@/apollo/gql/gqlUser';
import { IUser } from '@/apollo/types/types';
import UserPublicProfileView from '@/components/views/userPublicProfile/UserPublicProfile.view';
import UserProfileView from '@/components/views/userProfile/UserProfile.view';
import { GeneralMetatags } from '@/components/Metatag';
import { transformGraphQLErrorsToStatusCode } from '@/helpers/requests';
import ErrorsIndex from '@/components/views/Errors/ErrorsIndex';
Expand Down Expand Up @@ -32,7 +32,7 @@ const UserRoute: FC<IUserRouteProps> = ({ user }) => {
url: `https://giveth.io/user/${user.walletAddress}`,
}}
/>
<UserPublicProfileView user={user} />
<UserProfileView user={user} />
</>
);
};
Expand Down
Binary file added public/images/backgrounds/GIVPowerIsComing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/backgrounds/rocket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions public/images/giv_stake.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/images/growth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/images/rocket.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion src/apollo/gql/gqlOptions.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { IS_BOOSTING_ENABLED } from '@/configuration';
import { EDirection, gqlEnums } from '../types/gqlEnums';

export const OPTIONS_HOME_PROJECTS = {
variables: {
limit: 15,
skip: 0,
orderBy: { field: gqlEnums.QUALITYSCORE, direction: EDirection.DESC },
orderBy: {
field: IS_BOOSTING_ENABLED
? gqlEnums.GIVPOWER
: gqlEnums.QUALITYSCORE,
direction: EDirection.DESC,
},
},
notifyOnNetworkStatusChange: true,
};
109 changes: 109 additions & 0 deletions src/apollo/gql/gqlPowerBoosting.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import { gql } from '@apollo/client';

export const SAVE_POWER_BOOSTING = gql`
mutation setSinglePowerBoostingMutation(
$projectId: Int!
$percentage: Float!
) {
setSinglePowerBoosting(projectId: $projectId, percentage: $percentage) {
id
user {
id
}
project {
id
title
slug
}
percentage
}
}
`;

export const SAVE_MULTIPLE_POWER_BOOSTING = gql`
mutation setMultiplePowerBoostingMutation(
$projectIds: [Int!]!
$percentages: [Float!]!
) {
setMultiplePowerBoosting(
projectIds: $projectIds
percentages: $percentages
) {
id
user {
id
}
project {
id
title
slug
}
percentage
}
}
`;

export const FETCH_POWER_BOOSTING_INFO = gql`
query getPowerBoostingsQuery(
$take: Int
$skip: Int
$orderBy: PowerBoostingOrderBy
$projectId: Int
$userId: Int
) {
getPowerBoosting(
take: $take
skip: $skip
orderBy: $orderBy
projectId: $projectId
userId: $userId
) {
powerBoostings {
id
user {
id
email
}
project {
id
title
slug
}
percentage
}
}
}
`;

export const FETCH_PROJECT_BOOSTINGS = gql`
query userProjectPowers(
$take: Int
$skip: Int
$orderBy: UserPowerOrderBy
$projectId: Int
) {
userProjectPowers(
take: $take
skip: $skip
orderBy: $orderBy
projectId: $projectId
) {
totalCount
userProjectPowers {
id
userId
projectId
percentage
userPower
boostedPower
rank
user {
id
firstName
lastName
name
}
}
}
}
`;
Loading

1 comment on commit 69a5a80

@vercel
Copy link

@vercel vercel bot commented on 69a5a80 Oct 3, 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.io
giveth-dapps-v2-givethio.vercel.app
giveth-dapps-v2-git-main-givethio.vercel.app
www.giveth.io

Please sign in to comment.