Skip to content

Commit

Permalink
Merge pull request #2444 from Giveth/develop
Browse files Browse the repository at this point in the history
Taketh April fool's Release
  • Loading branch information
mateodaza authored Mar 31, 2023
2 parents 0a31cae + 7deb765 commit ca8cf13
Show file tree
Hide file tree
Showing 45 changed files with 2,003 additions and 126 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cSpell.words": [
"Boostings",
"CELO",
"GIVback",
"GIVBACKS",
"GIVeconomy",
Expand Down
1,243 changes: 1,243 additions & 0 deletions lang/ca.json

Large diffs are not rendered by default.

13 changes: 5 additions & 8 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -549,14 +549,8 @@
"label.select_an_image_from_our_gallery": "Select an image from our gallery.",
"label.remove": "Remove",
"label.receiving_address": "Receiving address",
"label.mainnet_address": "Mainnet address",
"label.gnosis_chain_address": "Gnosis Chain address",
"label.polygon_mainnet_address": "Polygon Mainnet address",
"label.optimism_mainnet_address": "Optimism Mainnet address",
"label.receiving_address_on_mainnet": "Receiving address on Mainnet",
"label.receiving_address_on_gnosis": "Receiving address on Gnosis Chain",
"label.receiving_address_on_polygon": "Receiving address on Polygon Mainnet",
"label.receiving_address_on_optimism": "Receiving address on Optimism Mainnet",
"label.address": "{chainName} address",
"label.receiving_address_on": "Receiving address on {chainName}",
"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.",
Expand Down Expand Up @@ -953,6 +947,7 @@
"section.subscribe_to_our_newsletter": "Subscribe to our newsletter and get all updates straight to your mailbox!",
"section.get_the_latest_updates": "Get the latest updates",
"label.choose_language": "Choose Language",
"lang.ca": "Catalan",
"lang.es": "Spanish",
"lang.en": "English",
"label.number_of_givers": "# of givers",
Expand Down Expand Up @@ -1121,6 +1116,8 @@
"ngo_desc": "Support non profit projects by giving directly.",
"technology": "Technology",
"technology_desc": "Support technology projects with a focus on tech, research and desci.",
"all_projects": "All Projects",
"all_projects_desc": "Support changemakers from around the world",
"label.just_launched": "Just Launched",
"label.all_projects": "All Projects",
"all": "All",
Expand Down
13 changes: 5 additions & 8 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -547,14 +547,8 @@
"label.select_an_image_from_our_gallery": "Escoge una imagen de nuestra galería.",
"label.remove": "Eliminar",
"label.receiving_address": "Dirección receptora",
"label.mainnet_address": "Dirección en Mainnet",
"label.gnosis_chain_address": "Dirección en Gnosis Chain",
"label.polygon_mainnet_address": "Dirección de Polygon Mainnet",
"label.optimism_mainnet_address": "Dirección de Optimism Mainnet",
"label.receiving_address_on_mainnet": "Dirección receptora en Mainnet",
"label.receiving_address_on_gnosis": "Dirección receptora en Gnosis Chain",
"label.receiving_address_on_polygon": "Dirección de recepción en Polygon Mainnet",
"label.receiving_address_on_optimism": "Dirección de recepción en Polygon Optimism",
"label.address": "Dirección de {chainName}",
"label.receiving_address_on": "Dirección receptora en {chainName}",
"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 para otro proyecto. Por favor ingrese una dirección que no este actualmente asociada a ningún otro proyecto.",
Expand Down Expand Up @@ -882,6 +876,7 @@
"label.you_dont_have_any_givpower": "¡No tienes GIVpower!",
"label.stake_and_lock_your_giv_to_get_givpower": "Haz stake y bloquea tu GIV para obtener GIVpower.",
"page.faq.what_is_the_givfarm.content": "es el programa de 'Liquidity Mining' donde Giveth permite a los titulares de GIV proporcionar liquidez y hacer stake de tokens para obtener recompensas GIV. Para obtener más información, consulte el",
"lang.ca": "Catalán",
"lang.en": "Inglés",
"lang.es": "Español",
"page.faq.is_giveth_recognized_as_an_official_charity.content.two": ", la DAO Giveth y la estructura organizacional basada en la comunidad están representadas como una organización sin ánimo de lucro 501c3 en los Estados Unidos. Somos un proyecto dirigido por la comunidad y no obtendremos ningún beneficio directo de la plataforma. Garantizamos que todos los fondos se reciclarán de nuevo en la comunidad que está asegurando que la plataforma Giveth se adopte ampliamente.",
Expand Down Expand Up @@ -1192,6 +1187,8 @@
"finance_desc": "Apoyo a proyectos financieros centrados en la refinanciación y la captación de fondos.",
"health-and-wellness_desc": "Apoyar proyectos de salud y bienestar centrados en la atención sanitaria, la salud mental, la nutrición y la salud infantil.",
"technology_desc": "Apoyo a proyectos tecnológicos centrados en la tecnología, la investigación y el diseño.",
"all_projects": "Todos los proyectos",
"all_projects_desc": "Apoya agentes de cambio de todo el mundo",
"label.sorry_this_projet_doesnt_support_your_current_net": "Lo sentimos, este proyecto no admite tu red actual.",
"label.please_switch_your_network": "Por favor cambia de red.",
"label.go_back_to_project_details": "Vuelve a Detalles del Proyecto",
Expand Down
3 changes: 2 additions & 1 deletion lang/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ca from './ca.json';
import en from './en.json';
import es from './es.json';

export { en, es };
export { ca, en, es };
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const moduleExports = withBundleAnalyzer({
return config;
},
i18n: {
locales: ['en', 'es'],
locales: ['ca', 'en', 'es'],
defaultLocale: 'en',
localeDetection: false,
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "givethdapp",
"version": "2.13.1",
"version": "2.14.1",
"private": true,
"scripts": {
"build": "next build",
Expand Down
70 changes: 41 additions & 29 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import NProgress from 'nprogress';
import * as snippet from '@segment/snippet';
import { useRouter } from 'next/router';
import { Provider } from 'react-redux';

import Script from 'next/script';

import { useApollo } from '@/apollo/apolloClient';
import { HeaderWrapper } from '@/components/Header/HeaderWrapper';
import { FooterWrapper } from '@/components/Footer/FooterWrapper';

import '../styles/globals.css';
import { en, es } from '../lang';
import { ca, en, es } from '../lang';
import { store } from '@/features/store';
import SubgraphController from '@/components/controller/subgraph.ctrl';
import UserController from '@/components/controller/user.ctrl';
Expand All @@ -26,10 +26,11 @@ import GeneralController from '@/components/controller/general.ctrl';
import ErrorsIndex from '@/components/views/Errors/ErrorsIndex';
import StorageLabel from '@/lib/localStorage';
import NotificationController from '@/components/controller/notification.ctrl';

import { isGIVeconomyRoute } from '@/lib/helpers';
import GIVeconomyTab from '@/components/GIVeconomyTab';
import MaintenanceIndex from '@/components/views/Errors/MaintenanceIndex';
import type { AppProps } from 'next/app';
import '../styles/globals.css';

declare global {
interface Window {
Expand All @@ -40,6 +41,7 @@ declare global {
const DEFAULT_WRITE_KEY = 'MHK95b7o6FRNHt0ZZJU9bNGUT5MNCEyB';

export const IntlMessages = {
ca,
en,
es,
};
Expand Down Expand Up @@ -68,6 +70,7 @@ function MyApp({ Component, pageProps }: AppProps) {
const router = useRouter();
const locale = router ? router.locale : 'en';
const apolloClient = useApollo(pageProps);
const isMaintenanceMode = process.env.NEXT_PUBLIC_IS_MAINTENANCE === 'true';

useEffect(() => {
const handleStart = (url: string) => {
Expand Down Expand Up @@ -113,34 +116,43 @@ function MyApp({ Component, pageProps }: AppProps) {
>
<ApolloProvider client={apolloClient}>
<Web3ReactProvider getLibrary={getLibrary}>
<NotificationController />
<GeneralController />
<PriceController />
<SubgraphController />
<UserController />
<HeaderWrapper />
{isGIVeconomyRoute(router.route) && (
<GIVeconomyTab />
)}
{(pageProps as any).errorStatus ? (
<ErrorsIndex
statusCode={(pageProps as any).errorStatus}
/>
{isMaintenanceMode ? (
<MaintenanceIndex />
) : (
<Component {...pageProps} />
)}
{process.env.NEXT_PUBLIC_ENV === 'production' && (
<Script
id='segment-script'
strategy='afterInteractive'
dangerouslySetInnerHTML={{
__html: renderSnippet(),
}}
/>
<>
<NotificationController />
<GeneralController />
<PriceController />
<SubgraphController />
<UserController />
<HeaderWrapper />
{isGIVeconomyRoute(router.route) && (
<GIVeconomyTab />
)}
{(pageProps as any).errorStatus ? (
<ErrorsIndex
statusCode={
(pageProps as any).errorStatus
}
/>
) : (
<Component {...pageProps} />
)}
{process.env.NEXT_PUBLIC_ENV ===
'production' && (
<Script
id='segment-script'
strategy='afterInteractive'
dangerouslySetInnerHTML={{
__html: renderSnippet(),
}}
/>
)}

<FooterWrapper />
<ModalController />
</>
)}

<FooterWrapper />
<ModalController />
</Web3ReactProvider>
</ApolloProvider>
</IntlProvider>
Expand Down
17 changes: 17 additions & 0 deletions pages/landings/taketh.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { FC } from 'react';
import Head from 'next/head';
import { IEthDenverProps } from './ethdenver';
import Taketh from '@/components/views/landings/taketh';

const TakethRoute: FC<IEthDenverProps> = () => {
return (
<>
<Head>
<title>Taketh</title>
</Head>
<Taketh />
</>
);
};

export default TakethRoute;
18 changes: 18 additions & 0 deletions public/images/currencies/celo/16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/images/flags/ca.svg
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/taketh-banner.jpg
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/taketh-hand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/components/Icons/Celo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React, { FC } from 'react';
import Image from 'next/image';
import { ICurrencyIconProps } from './type';

export const IconCelo: FC<ICurrencyIconProps> = ({ size = 16 }) => {
return (
<Image
src={`/images/currencies/celo/16.svg`}
alt='Celo'
width={size}
height={size}
loading='lazy'
/>
);
};
3 changes: 3 additions & 0 deletions src/components/NetworkLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { IconGnosisChain } from '@/components/Icons/GnosisChain';
import { IconPolygon } from '@/components/Icons/Polygon';
import config from '@/configuration';
import { IconOptimism } from './Icons/Optimism';
import { IconCelo } from './Icons/Celo';

const NetworkLogo = (props: { chainId?: number; logoSize?: number }) => {
const { chainId, logoSize } = props;
Expand All @@ -15,6 +16,8 @@ const NetworkLogo = (props: { chainId?: number; logoSize?: number }) => {
return <IconPolygon size={logoSize} />;
} else if (chainId === config.OPTIMISM_NETWORK_NUMBER) {
return <IconOptimism size={logoSize} />;
} else if (chainId === config.CELO_NETWORK_NUMBER) {
return <IconCelo size={logoSize} />;
} else return null;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { BN, formatEthHelper, formatWeiHelper } from '@/helpers/number';
import {
PoolStakingConfig,
RegenPoolStakingConfig,
SimpleNetworkConfig,
SimplePoolStakingConfig,
StakingType,
} from '@/types/config';
Expand Down Expand Up @@ -117,7 +118,9 @@ export const StakingPoolInfoAndActions: FC<IStakingPoolInfoAndActionsProps> = ({
provideLiquidityLink,
} = poolStakingConfig;
const regenStreamConfig = regenStreamType
? config.NETWORKS_CONFIG[poolNetwork].regenStreams.find(
? (
config.NETWORKS_CONFIG[poolNetwork] as SimpleNetworkConfig
).regenStreams.find(
regenStream => regenStream.type === regenStreamType,
)
: undefined;
Expand Down
1 change: 0 additions & 1 deletion src/components/controller/general.ctrl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const GeneralController = () => {
}
}
}, [router, account, isWalletActive, chainId]);
console.log('theme', theme);
return <GlobalStyle theme={theme} />;
};

Expand Down
7 changes: 5 additions & 2 deletions src/components/modals/DonateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const DonateModal: FC<IDonateModalProps> = props => {
const isGnosis = chainId === config.XDAI_NETWORK_NUMBER;
const isPolygon = chainId === config.POLYGON_NETWORK_NUMBER;
const isOptimism = chainId === config.OPTIMISM_NETWORK_NUMBER;
const isCelo = chainId === config.CELO_NETWORK_NUMBER;

const [donating, setDonating] = useState(false);
const [firstDonationSaved, setFirstDonationSaved] = useState(false);
Expand Down Expand Up @@ -193,8 +194,8 @@ const DonateModal: FC<IDonateModalProps> = props => {
let tokenAddress = token.address;
// Coingecko doesn't have these tokens in Gnosis Chain, so fetching price from ethereum
if (
// TODO:Optimism (isGnosis || isPolygon || isOptimism) &&
(isGnosis || isPolygon) &&
// TODO:Optimism (isGnosis || isPolygon || isCelo || isOptimism) &&
(isGnosis || isPolygon || isCelo) &&
token.mainnetAddress
) {
tokenAddress = token.mainnetAddress || '';
Expand All @@ -204,6 +205,8 @@ const DonateModal: FC<IDonateModalProps> = props => {
? config.MAINNET_NETWORK_NUMBER
: isGnosis
? config.XDAI_NETWORK_NUMBER
: isCelo
? config.CELO_NETWORK_NUMBER
: config.POLYGON_NETWORK_NUMBER;
// TODO:Optimism : isPolygon
// ? config.POLYGON_NETWORK_NUMBER
Expand Down
1 change: 1 addition & 0 deletions src/components/modals/DonateWrongNetwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const networks = [
config.MAINNET_CONFIG,
config.XDAI_CONFIG,
config.POLYGON_CONFIG,
// config.CELO_CONFIG,
// TODO:Optimism config.OPTIMISM_CONFIG,
];

Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/LanguageModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Modal } from './Modal';
import { IModal } from '@/types/common';
import { useModalAnimation } from '@/hooks/useModalAnimation';

const availableLanguages = ['en', 'es'];
const availableLanguages = ['ca', 'en', 'es'];

export const LanguageModal: FC<IModal> = ({ setShowModal }) => {
const router = useRouter();
Expand Down
1 change: 1 addition & 0 deletions src/components/modals/SwitchNetwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const networks = [
config.MAINNET_CONFIG,
config.XDAI_CONFIG,
config.POLYGON_CONFIG,
// config.CELO_CONFIG,
// TODO:Optimism config.OPTIMISM_CONFIG,
];

Expand Down
Loading

1 comment on commit ca8cf13

@vercel
Copy link

@vercel vercel bot commented on ca8cf13 Mar 31, 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-dapps-v2-git-main-givethio.vercel.app
www.giveth.io
giveth.io

Please sign in to comment.