Skip to content

Commit

Permalink
Merge pull request #2603 from Giveth/release-2.15.2
Browse files Browse the repository at this point in the history
Release 2.15.2
  • Loading branch information
MohammadPCh authored May 3, 2023
2 parents 3784211 + 73de064 commit 666e40b
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 67 deletions.
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.15.1",
"version": "2.15.2",
"private": true,
"scripts": {
"build": "next build",
Expand Down
Binary file added public/images/tokens/op.png
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/tokens/snx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/tokens/wbtc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/tokens/weth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/components/NetworkLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { IconEthereum } from '@/components/Icons/Eth';
import { IconGnosisChain } from '@/components/Icons/GnosisChain';
import { IconPolygon } from '@/components/Icons/Polygon';
import { IconCelo } from './Icons/Celo';
import { IconOptimism } from './Icons/Optimism';

const NetworkLogo = (props: { chainId?: number; logoSize?: number }) => {
const { chainId, logoSize } = props;
Expand All @@ -13,8 +14,8 @@ const NetworkLogo = (props: { chainId?: number; logoSize?: number }) => {
return <IconGnosisChain size={logoSize} />;
} else if (chainId === config.POLYGON_NETWORK_NUMBER) {
return <IconPolygon size={logoSize} />;
//TODO: Uncomment Optimism } else if (chainId === config.OPTIMISM_NETWORK_NUMBER) {
// return <IconOptimism 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
8 changes: 4 additions & 4 deletions src/components/modals/DonateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const DonateModal: FC<IDonateModalProps> = props => {
const isMainnet = chainId === config.MAINNET_NETWORK_NUMBER;
const isGnosis = chainId === config.XDAI_NETWORK_NUMBER;
const isPolygon = chainId === config.POLYGON_NETWORK_NUMBER;
//TODO: Uncomment Optimism const isOptimism = chainId === config.OPTIMISM_NETWORK_NUMBER;
const isOptimism = chainId === config.OPTIMISM_NETWORK_NUMBER;
const isCelo = chainId === config.CELO_NETWORK_NUMBER;

const [donating, setDonating] = useState(false);
Expand Down Expand Up @@ -204,9 +204,9 @@ const DonateModal: FC<IDonateModalProps> = props => {
? config.XDAI_NETWORK_NUMBER
: isCelo
? config.CELO_NETWORK_NUMBER
: config.POLYGON_NETWORK_NUMBER;
//TODO: Uncomment Optimism ? config.POLYGON_NETWORK_NUMBER
// : config.OPTIMISM_NETWORK_NUMBER;
: isPolygon
? config.POLYGON_NETWORK_NUMBER
: config.OPTIMISM_NETWORK_NUMBER;
const fetchedPrice = await fetchPrice(
coingeckoChainId,
tokenAddress,
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/DonateWrongNetwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const networks = [
config.XDAI_CONFIG,
config.POLYGON_CONFIG,
config.CELO_CONFIG,
//TODO: Uncomment Optimism config.OPTIMISM_CONFIG,
config.OPTIMISM_CONFIG,
];

export const DonateWrongNetwork: FC<IDonateWrongNetwork> = props => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export const ManageProjectAddressesModal: FC<IManageProjectAddressesModal> = ({
WalletAddr[config.CELO_NETWORK_NUMBER] = {
networkId: config.CELO_NETWORK_NUMBER,
};
//TODO: Uncomment Optimism WalletAddr[config.OPTIMISM_NETWORK_NUMBER] = {
// networkId: config.OPTIMISM_NETWORK_NUMBER,
// };
WalletAddr[config.OPTIMISM_NETWORK_NUMBER] = {
networkId: config.OPTIMISM_NETWORK_NUMBER,
};
const { addresses } = project;
if (!addresses) return;
for (let i = 0; i < addresses.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/SwitchNetwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const networks = [
config.XDAI_CONFIG,
config.POLYGON_CONFIG,
config.CELO_CONFIG,
//TODO: Uncomment Optimism config.OPTIMISM_CONFIG,
config.OPTIMISM_CONFIG,
];

const SwitchNetwork: FC<IModal> = ({ setShowModal }) => {
Expand Down
68 changes: 34 additions & 34 deletions src/components/views/create/CreateProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const {
XDAI_NETWORK_NUMBER,
POLYGON_NETWORK_NUMBER,
CELO_NETWORK_NUMBER,
//TODO: Uncomment Optimism OPTIMISM_NETWORK_NUMBER,
OPTIMISM_NETWORK_NUMBER,
} = config;
interface ICreateProjectProps {
project?: IProjectEdition;
Expand All @@ -76,7 +76,7 @@ export enum EInputs {
gnosisAddress = 'gnosisAddress',
polygonAddress = 'polygonAddress',
celoAddress = 'celoAddress',
//TODO: Uncomment Optimism optimismAddress = 'optimismAddress',
optimismAddress = 'optimismAddress',
}

export type TInputs = {
Expand All @@ -90,7 +90,7 @@ export type TInputs = {
[EInputs.gnosisAddress]: string;
[EInputs.polygonAddress]: string;
[EInputs.celoAddress]: string;
//TODO: Uncomment Optimism [EInputs.optimismAddress]: string;
[EInputs.optimismAddress]: string;
};

const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
Expand Down Expand Up @@ -118,15 +118,15 @@ const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
const prevCeloAddress = addresses?.find(
a => a.isRecipient && a.networkId === CELO_NETWORK_NUMBER,
)?.address;
//TODO: Uncomment Optimism const prevOptimismAddress = addresses?.find(
// a => a.isRecipient && a.networkId === OPTIMISM_NETWORK_NUMBER,
// )?.address;
const prevOptimismAddress = addresses?.find(
a => a.isRecipient && a.networkId === OPTIMISM_NETWORK_NUMBER,
)?.address;
const isSamePrevAddresses = compareAddressesArray([
prevMainAddress,
prevGnosisAddress,
prevPolygonAddress,
prevCeloAddress,
//TODO: Uncomment Optimism prevOptimismAddress,
prevOptimismAddress,
]);
const userAddresses: string[] = [];
if (isSamePrevAddresses) userAddresses.push(prevMainAddress!);
Expand All @@ -135,7 +135,7 @@ const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
if (prevGnosisAddress) userAddresses.push(prevGnosisAddress);
if (prevPolygonAddress) userAddresses.push(prevPolygonAddress);
if (prevCeloAddress) userAddresses.push(prevCeloAddress);
//TODO: Uncomment Optimism if (prevOptimismAddress) userAddresses.push(prevOptimismAddress);
if (prevOptimismAddress) userAddresses.push(prevOptimismAddress);
}

const formMethods = useForm<TInputs>({
Expand All @@ -151,7 +151,7 @@ const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
[EInputs.gnosisAddress]: prevGnosisAddress || '',
[EInputs.polygonAddress]: prevPolygonAddress || '',
[EInputs.celoAddress]: prevCeloAddress || '',
//TODO: Uncomment Optimism [EInputs.optimismAddress]: prevOptimismAddress || '',
[EInputs.optimismAddress]: prevOptimismAddress || '',
},
});

Expand All @@ -170,9 +170,9 @@ const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
const [celoAddressActive, setCeloAddressActive] = useState(
isEditMode ? !!prevCeloAddress : true,
);
//TODO: Uncomment Optimism const [optimismAddressActive, setOptimismAddressActive] = useState(
// isEditMode ? !!prevOptimismAddress : true,
// );
const [optimismAddressActive, setOptimismAddressActive] = useState(
isEditMode ? !!prevOptimismAddress : true,
);
const [isSameAddress, setIsSameAddress] = useState(
isEditMode ? isSamePrevAddresses : true,
);
Expand All @@ -190,7 +190,7 @@ const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
gnosisAddress,
polygonAddress,
celoAddress,
//TODO: Uncomment Optimism optimismAddress,
optimismAddress,
name,
description,
categories,
Expand Down Expand Up @@ -221,10 +221,10 @@ const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
address: checksumAddress,
networkId: CELO_NETWORK_NUMBER,
},
//TODO: Uncomment Optimism {
// address: checksumAddress,
// networkId: OPTIMISM_NETWORK_NUMBER,
// },
{
address: checksumAddress,
networkId: OPTIMISM_NETWORK_NUMBER,
},
);
} else {
if (mainnetAddressActive) {
Expand Down Expand Up @@ -258,13 +258,13 @@ const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
networkId: CELO_NETWORK_NUMBER,
});
}
//TODO: Uncomment Optimism if (optimismAddressActive) {
// const checksumAddress = utils.getAddress(optimismAddress);
// addresses.push({
// address: checksumAddress,
// networkId: OPTIMISM_NETWORK_NUMBER,
// });
// }
if (optimismAddressActive) {
const checksumAddress = utils.getAddress(optimismAddress);
addresses.push({
address: checksumAddress,
networkId: OPTIMISM_NETWORK_NUMBER,
});
}
}

const projectData: IProjectCreation = {
Expand Down Expand Up @@ -389,8 +389,8 @@ const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
!e &&
!gnosisAddressActive &&
!polygonAddressActive &&
!celoAddressActive
//TODO: Uncomment Optimism !optimismAddressActive
!celoAddressActive &&
!optimismAddressActive
)
return showToastError(
formatMessage({
Expand All @@ -412,8 +412,8 @@ const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
!e &&
!mainnetAddressActive &&
!polygonAddressActive &&
!celoAddressActive
//TODO: Uncomment Optimism !optimismAddressActive
!celoAddressActive &&
!optimismAddressActive
)
return showToastError(
formatMessage({
Expand All @@ -435,8 +435,8 @@ const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
!e &&
!mainnetAddressActive &&
!gnosisAddressActive &&
!celoAddressActive
//TODO: Uncomment Optimism !optimismAddressActive
!celoAddressActive &&
!optimismAddressActive
)
return showToastError(
formatMessage({
Expand All @@ -458,8 +458,8 @@ const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
!e &&
!mainnetAddressActive &&
!gnosisAddressActive &&
!polygonAddressActive
//TODO: Uncomment Optimism !optimismAddressActive
!polygonAddressActive &&
!optimismAddressActive
)
return showToastError(
formatMessage({
Expand All @@ -470,7 +470,7 @@ const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
setCeloAddressActive(e);
}}
/>
{/*TODO: Uncomment Optimism <WalletAddressInput
<WalletAddressInput
networkId={OPTIMISM_NETWORK_NUMBER}
sameAddress={isSameAddress}
isActive={optimismAddressActive}
Expand All @@ -492,7 +492,7 @@ const CreateProject: FC<ICreateProjectProps> = ({ project }) => {
if (!e) unregister(EInputs.optimismAddress);
setOptimismAddressActive(e);
}}
/> */}
/>
<PublishTitle>
{isEditMode
? formatMessage({
Expand Down
26 changes: 13 additions & 13 deletions src/components/views/create/WalletAddressInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ const WalletAddressInput: FC<IProps> = ({
const isGnosis = networkId === config.XDAI_NETWORK_NUMBER;
const isPolygon = networkId === config.POLYGON_NETWORK_NUMBER;
const isCelo = networkId === config.CELO_NETWORK_NUMBER;
//TODO: Uncomment Optimism const isOptimism = networkId === config.OPTIMISM_NETWORK_NUMBER;
const isOptimism = networkId === config.OPTIMISM_NETWORK_NUMBER;
const inputName = isGnosis
? EInputs.gnosisAddress
: isPolygon
? EInputs.polygonAddress
: isCelo
? EInputs.celoAddress
: //TODO: Uncomment Optimism : isOptimism
// ? EInputs.optimismAddress
EInputs.mainAddress;
: isOptimism
? EInputs.optimismAddress
: EInputs.mainAddress;
const value = getValues(inputName);
const isDefaultAddress = compareAddresses(value, user?.walletAddress);
const error = errors[inputName];
Expand Down Expand Up @@ -108,9 +108,9 @@ const WalletAddressInput: FC<IProps> = ({
? 'Polygon Mainnet'
: isCelo
? 'Celo Mainnet'
: //TODO: Uncomment Optimism : isOptimism
// ? 'Optimism'
'Mainnet'
: isOptimism
? 'Optimism'
: 'Mainnet'
}.`;
}

Expand Down Expand Up @@ -200,17 +200,17 @@ const WalletAddressInput: FC<IProps> = ({
<GnosisIcon />
<PolygonIcon />
<CeloIcon />
{/*TODO: Uncomment Optimism <OptimismIcon /> */}
<OptimismIcon />
</>
) : isGnosis ? (
<GnosisIcon />
) : isPolygon ? (
<PolygonIcon />
) : isCelo ? (
<CeloIcon />
) : isOptimism ? (
<OptimismIcon />
) : (
//TODO: Uncomment Optimism ) : isOptimism ? (
// <OptimismIcon />
<MainnetIcon />
)}
</Flex>
Expand All @@ -230,9 +230,9 @@ const WalletAddressInput: FC<IProps> = ({
? 'Polygon Mainnet'
: isCelo
? 'Celo Mainnet'
: //TODO: Uncomment Optimism : isOptimism
// ? 'Optimism Mainnet'
'Mainnet',
: isOptimism
? 'Optimism Mainnet'
: 'Mainnet',
},
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ const networkOptions = [
label: 'Celo Mainnet',
id: config.CELO_NETWORK_NUMBER,
},
// TODO: Uncomment Optimism {
// value: config.OPTIMISM_NETWORK_NUMBER,
// label: 'Optimism',
// id: config.OPTIMISM_NETWORK_NUMBER,
// },
{
value: config.OPTIMISM_NETWORK_NUMBER,
label: 'Optimism',
id: config.OPTIMISM_NETWORK_NUMBER,
},
];

export interface IAddressForm {
Expand Down
6 changes: 3 additions & 3 deletions src/services/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export const fetchPrice = async (chainId: number, tokenAddress?: string) => {
case config.CELO_NETWORK_NUMBER:
chain = 'celo';
break;
//TODO: Uncomment Optimism case config.OPTIMISM_NETWORK_NUMBER:
// chain = 'optimistic-ethereum';
// break;
case config.OPTIMISM_NETWORK_NUMBER:
chain = 'optimistic-ethereum';
break;
case config.POLYGON_NETWORK_NUMBER:
chain = 'polygon-pos';
break;
Expand Down

1 comment on commit 666e40b

@vercel
Copy link

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

Please sign in to comment.