Skip to content

Commit

Permalink
Merge pull request #2013 from Giveth/release-2.7.0
Browse files Browse the repository at this point in the history
Release 2.7.0
  • Loading branch information
MohammadPCh authored Jan 9, 2023
2 parents c29ecd7 + e9363f5 commit bf85cea
Show file tree
Hide file tree
Showing 55 changed files with 758 additions and 612 deletions.
8 changes: 4 additions & 4 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,19 @@
"component.button.load_more": "Load More",
"label.donate": "Donate",
"label.verified": "Verified",
"label.givback_eligible": "GIVback Eligible",
"label.givbacks": "GIVbacks",
"label.last_updated": "Last Updated",
"label.project_by": "PROJECT BY",
"label.just_now": "Just now",
"label.about": "About",
"label.updates": "Updates",
"label.donations": "Donations",
"label.givpower": "GIVpower",
"component.givback_elibible.desc": "When you donate to verified projects you qualify to receive GIV tokens. Through GIVbacks, GIV empowers donors with governance rights via the GIVgarden.",
"component.givback_eligible.desc": "When you donate to verified projects you qualify to receive GIV tokens. Through GIVbacks, GIV empowers donors with governance rights via the GIVgarden.",
"component.givback_toast.desc": "You get GIVbacks by donating to this project.",
"label.report_an_issue": "Report an issue",
"label.view_similar_projects": "View similar projects",
"component.button.activate_project": "ACTIVATE PROYECTO",
"component.button.activate_project": "ACTIVATE PROJECT",
"component.button.de": "DE",
"label.publish_project": "PUBLISH PROJECT",
"label.edit": "Edit",
Expand Down Expand Up @@ -554,7 +554,7 @@
"label.my_wallet_address": "My Wallet Address",
"label.resolved_as": "Resolves as ",
"label.this_address_is_already_used": "This address is already used for another project. Please enter an address which is not currently associated with any other project.",
"label.please_do_not_enter_exchange_addresses_for_gnosis_chain": "Please DO NOT enter exchange addresses for Gnosis Chain.",
"label.please_do_not_enter_exchange_deposit": "Please DO NOT enter an exchange deposit address, use a key you control in a wallet like Metamask, or your funds maybe lost",
"label.ill_receive_funds_on_this_address": "I’ll receive fund on this address",
"label.is_already_being_used_for_a_project": "is already being used for a project",
"label.this_is_the_default_address_associated_with_your_account": "This is the default wallet address associated with your account. You can choose a different receiving address.",
Expand Down
6 changes: 3 additions & 3 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@
"component.button.load_more": "Cargar Más",
"label.donate": "Donar",
"label.verified": "Verificado",
"label.givback_eligible": "Elegible a GIVbacks",
"label.givbacks": "GIVbacks",
"label.last_updated": "Ultima Actualización",
"label.project_by": "PROYECTO DE",
"label.just_now": "Justo ahora",
"label.about": "Acerca",
"label.updates": "Actualizaciones",
"label.donations": "Donaciones",
"label.givpower": "GIVpower",
"component.givback_elibible.desc": "Cuando donas a proyectos verificados calificas para recibir GIV tokens. Por medio de GIVbacks, GIV empodera donantes con derechos de governanza a traves del GIVgarden.",
"component.givback_eligible.desc": "Cuando donas a proyectos verificados calificas para recibir GIV tokens. Por medio de GIVbacks, GIV empodera donantes con derechos de governanza a traves del GIVgarden.",
"component.givback_toast.desc": "Obtienes GIVbacks al donar a este proyecto.",
"label.report_an_issue": "Reporta un problema",
"label.view_similar_projects": "Mira proyectos similares",
Expand Down Expand Up @@ -554,7 +554,7 @@
"label.my_wallet_address": "Mi dirección de la billetera",
"label.resolved_as": "Resuelto como ",
"label.this_address_is_already_used": "Esta dirección ya esta en uso",
"label.please_do_not_enter_exchange_addresses_for_gnosis_chain": "Por favor NO INGRESAR direcciones de exchanges para Gnosis Chain",
"label.please_do_not_enter_exchange_deposit": "",
"label.ill_receive_funds_on_this_address": "Recibiré fondos en esta dirección",
"label.is_already_being_used_for_a_project": "esta siendo usada por otro proyecto.",
"label.this_is_the_default_address_associated_with_your_account": "Esta es la dirección de tu cuenta por defecto. Puedes usar una dirección diferente.",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "givethdapp",
"version": "2.6.7",
"version": "2.7.0",
"private": true,
"scripts": {
"build": "next build",
Expand Down Expand Up @@ -111,7 +111,7 @@
"jest-environment-jsdom": "^28.1.2",
"jest-extended": "^3.0.2",
"jest-watch-typeahead": "^2.0.0",
"msw": "^0.44.2",
"msw": "^0.49.2",
"prettier": "^2.4.1",
"test-data-bot": "^0.8.0",
"ts-jest": "^28.0.5",
Expand Down
1 change: 0 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ declare global {

const DEFAULT_WRITE_KEY = 'MHK95b7o6FRNHt0ZZJU9bNGUT5MNCEyB';

type IntlMessageKeys = keyof typeof en;
const messages = {
en,
es,
Expand Down
23 changes: 12 additions & 11 deletions pages/donate/[slug].tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { FC } from 'react';
import Head from 'next/head';
import dynamic from 'next/dynamic';
import { captureException } from '@sentry/nextjs';
import dynamic from 'next/dynamic';

import { IDonationProject } from '@/apollo/types/types';
import {
Expand All @@ -12,25 +12,26 @@ import { client } from '@/apollo/apolloClient';
import { ProjectMeta } from '@/components/Metatag';
import { transformGraphQLErrorsToStatusCode } from '@/helpers/requests';
import config from '@/configuration';
import { DonateProvider } from '@/context/donate.context';

export interface IDonateRouteProps {
project: IDonationProject;
}

const DonateIndex = dynamic(
() => import('@/components/views/donate/DonateIndex'),
{ ssr: false },
);

export interface IDonateRouteProps {
project: IDonationProject;
}

const DonateRoute: FC<IDonateRouteProps> = props => {
const DonateRoute: FC<IDonateRouteProps> = ({ project }) => {
return (
<>
<DonateProvider project={project}>
<Head>
<title>{props.project.title} | Giveth</title>
<ProjectMeta project={props.project} preTitle='Donate to' />
<title>{project.title} | Giveth</title>
<ProjectMeta project={project} preTitle='Donate to' />
</Head>
<DonateIndex {...props} />
</>
<DonateIndex />
</DonateProvider>
);
};

Expand Down
4 changes: 2 additions & 2 deletions pages/project/[projectIdSlug]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { ProjectProvider } from '@/context/project.context';

const ProjectRoute: FC<IProjectBySlug> = ({ project }) => {
return (
<ProjectProvider>
<ProjectIndex project={project} />
<ProjectProvider project={project}>
<ProjectIndex />
</ProjectProvider>
);
};
Expand Down
19 changes: 19 additions & 0 deletions pages/test1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import styled from 'styled-components';
import { GetServerSideProps } from 'next';
import { useWeb3React } from '@web3-react/core';
import { IconHelpFilled16 } from '@giveth/ui-design-system';
import { useRef, useState } from 'react';
import { gToast, ToastType } from '@/components/toasts';
import { useAppDispatch } from '@/features/hooks';
import { fetchXDaiInfoAsync } from '@/features/subgraph/subgraph.thunks';
Expand All @@ -15,12 +16,18 @@ const TestRoute = () => {
// );
const { account } = useWeb3React();
const dispatch = useAppDispatch();
const functionRef = useRef<Function>();
const [state, setState] = useState(0);

// const { data, isLoading, error, refetch } = useGetSubgraphValuesQuery({
// chain: chainId,
// userAddress: account,
// });

functionRef.current = () => {
console.log(state);
};

const notify = () =>
gToast('Testeeee', {
type: ToastType.SUCCESS,
Expand Down Expand Up @@ -79,6 +86,18 @@ const TestRoute = () => {
>
Throw error
</button>
<button
type='button'
onClick={() => functionRef.current && functionRef.current()}
>
check
</button>
<button
type='button'
onClick={() => setState(state => state + 1)}
>
increase
</button>
<div>
--------------------------------------------
<IconWithTooltip
Expand Down
1 change: 1 addition & 0 deletions pages/user/[address].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const getServerSideProps: GetServerSideProps = async context => {
variables: {
address: address,
},
fetchPolicy: 'no-cache',
});
const user = userData?.userByAddress;
return {
Expand Down
2 changes: 1 addition & 1 deletion src/apollo/gql/gqlProjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ export const ACTIVATE_PROJECT = gql`
}
`;

export const TITLE_IS_VALID = gql`
export const TITLE_IS_VALID = `
query IsValidTitleForProject($title: String!, $projectId: Float) {
isValidTitleForProject(title: $title, projectId: $projectId)
}
Expand Down
10 changes: 2 additions & 8 deletions src/components/GIVpowerRank.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import { IProjectPower } from '@/apollo/types/types';
import { Flex } from './styled-components/Flex';
import { mediaQueries } from '@/lib/constants/constants';
import { useProjectContext } from '@/context/project.context';
import { getNowUnixMS } from '@/helpers/time';
import { isProduction } from '@/configuration';

interface IGIVpowerRank {
projectPower?: IProjectPower;
Expand Down Expand Up @@ -72,15 +70,11 @@ export const NextRank: FC<IGIVpowerRank> = ({
};

export const CurrentRank: FC<IGIVpowerRank> = ({ projectPower }) => {
//TODO: remove this after 27 dec 2022
const isGIVPowerFirstRound = isProduction && getNowUnixMS() < 1672156800000;
return (
<RankContainer alignItems='baseline' gap='4px'>
{(isGIVPowerFirstRound || projectPower?.totalPower === 0) && (
<IconRocketInSpace32 />
)}
{projectPower?.totalPower === 0 && <IconRocketInSpace32 />}
<H3 weight={700}>
{isGIVPowerFirstRound || projectPower?.totalPower === 0
{projectPower?.totalPower === 0
? '--'
: `#${projectPower?.powerRank}`}
</H3>
Expand Down
10 changes: 7 additions & 3 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ import { ETheme } from '@/features/general/general.slice';
import {
setShowWalletModal,
setShowWelcomeModal,
setShowSignWithWallet,
setShowCompleteProfile,
} from '@/features/modal/modal.slice';
import { slugToProjectView } from '@/lib/routeCreators';
import { SubgraphDataHelper } from '@/lib/subgraph/subgraphDataHelper';
import { IconGIV } from '../Icons/GIV';
import { useModalCallback } from '@/hooks/useModalCallback';

export interface IHeader {
theme?: ETheme;
Expand Down Expand Up @@ -151,11 +151,15 @@ const Header: FC<IHeader> = () => {
}
};

const { modalCallback: signInThenCreate } = useModalCallback(() =>
router.push(Routes.CreateProject),
);

const handleCreateButton = () => {
if (!isEnabled) {
dispatch(setShowWelcomeModal(true));
} else if (!isSignedIn) {
dispatch(setShowSignWithWallet(true));
signInThenCreate();
} else if (isUserRegistered(userData)) {
router.push(Routes.CreateProject);
} else {
Expand Down Expand Up @@ -195,7 +199,7 @@ const Header: FC<IHeader> = () => {
width='48'
height='48'
alt='Giveth logo'
src={`/images/logo/logo1.png`}
src='/images/logo/logo1.png'
/>
</Logo>
</Link>
Expand Down
5 changes: 1 addition & 4 deletions src/components/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ import type {
UseFormRegister,
} from 'react-hook-form';

export interface IFormValidations {
[key: string]: EInputValidation;
}

export enum InputSize {
SMALL,
MEDIUM,
Expand All @@ -48,6 +44,7 @@ interface IInputLabelProps {
required?: boolean;
disabled?: boolean;
}

interface IInput extends InputHTMLAttributes<HTMLInputElement> {
label?: string;
caption?: string;
Expand Down
5 changes: 4 additions & 1 deletion src/components/controller/modal.ctrl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ const ModalController = () => {
}
}, [active, showWelcomeModal]);

//I think we need to handle it in better way
useEffect(() => {
if (isSignedIn && showSignWithWallet) {
dispatch(setShowSignWithWallet(false));
setTimeout(() => {
dispatch(setShowSignWithWallet(false));
}, 300);
}
}, [isSignedIn]);

Expand Down
21 changes: 12 additions & 9 deletions src/components/controller/user.ctrl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import {
} from '@/features/user/user.slice';
import { isSSRMode } from '@/lib/helpers';
import StorageLabel from '@/lib/localStorage';
import { fetchUserByAddress, signOut } from '@/features/user/user.thunks';
import { fetchUserByAddress } from '@/features/user/user.thunks';
import { walletsArray } from '@/lib/wallet/walletTypes';
import { getTokens } from '@/helpers/user';

const UserController = () => {
const { account, library, chainId, activate } = useWeb3React();
Expand Down Expand Up @@ -52,22 +53,24 @@ const UserController = () => {
// Case when wallet is locked
dispatch(setIsEnabled(false));
}
// Sign out if wallet is changed
dispatch(signOut());
}
if (account) {
const tokens = getTokens();
const _account = account.toLowerCase();
if (tokens[_account]) {
dispatch(setToken(tokens[_account]));
localStorage.setItem(StorageLabel.USER, _account);
localStorage.setItem(StorageLabel.TOKEN, tokens[_account]);
} else {
localStorage.removeItem(StorageLabel.TOKEN);
localStorage.removeItem(StorageLabel.USER);
}
isMounted.current = true;
dispatch(fetchUserByAddress(account));
dispatch(setIsEnabled(true));
}
}, [account]);

useEffect(() => {
if (token) {
dispatch(setToken(token));
}
}, [token]);

useEffect(() => {
if (account && library) {
library?.on('block', () => {
Expand Down
Loading

1 comment on commit bf85cea

@vercel
Copy link

@vercel vercel bot commented on bf85cea Jan 9, 2023

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.