Skip to content

Commit

Permalink
update chain options and fix instances of Cooperativ
Browse files Browse the repository at this point in the history
  • Loading branch information
jchaselubitz committed Nov 4, 2024
1 parent 0683f62 commit 7f073f2
Show file tree
Hide file tree
Showing 20 changed files with 218 additions and 93 deletions.
10 changes: 7 additions & 3 deletions dgraph/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,7 @@ enum CurrencyCode {
BTC
ETH
ADA
MATIC
POL
USDC
ALGO_USDC
PoS_USDC
Expand All @@ -1440,8 +1440,12 @@ enum CurrencyCode {
USDC_LOCAL_TEST_
DAI_LOCAL_TEST_
ALGO_USDC_TEST_
USDC_MATIC_TEST_
DAI_MATIC_TEST_
USDC_POL_TEST_
DAI_POL_TEST_
BASE_USDC
BASE_DAI
BASE_USDC_TEST_
BASE_DAI_TEST_
REAL_SHARE
}

Expand Down
2 changes: 1 addition & 1 deletion hooks/useOfferingDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
getCurrentOrderPrice,
getOrderArrayFromContract,
} from '@src/utils/helpersOrder';
import { dividendContractABI } from '@src/web3/generated';
import { CurrencyCode, DocumentType, Maybe, Offering, ShareOrder } from 'types';
import { dividendContractABI } from '@src/web3/generated';
import { getCurrencyOption } from '@src/utils/enumConverters';
import { getDocumentsOfType } from '@src/utils/helpersDocuments';
import { getIsEditorOrAdmin } from '@src/utils/helpersUserAndEntity';
Expand Down
6 changes: 6 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
NEXT_PUBLIC_NOTIFICATIONS_FROM = '[email protected]'
NEXT_PUBLIC_POSTMARK_HEADER= 'X-PM-Message-Stream: magic-link-stream'
NEXTAUTH_URL = "https://syndicate.cooperativ.io"
NEXT_PUBLIC_PRIVACY_URL = "https://cooperativ.io/privacy"
NEXT_PUBLIC_TERMS_URL = "https://cooperativ.io/terms"

[context.reizen]
command = "yarn build-reizen"
Expand All @@ -33,6 +35,8 @@
NEXT_PUBLIC_NOTIFICATIONS_FROM = '[email protected]'
NEXT_PUBLIC_POSTMARK_HEADER= 'X-PM-Message-Stream: magic-link-stream'
NEXTAUTH_URL = "https://syndicate.reizen.xyz"
NEXT_PUBLIC_PRIVACY_URL = "https://reizen.xyz/privacy"
NEXT_PUBLIC_TERMS_URL = "https://reizen.xyz/terms"

[context.staging]
command = "yarn build-staging"
Expand All @@ -50,4 +54,6 @@
NEXT_PUBLIC_NOTIFICATIONS_FROM = '[email protected]'
NEXT_PUBLIC_POSTMARK_HEADER= 'X-PM-Message-Stream: magic-link-stream'
NEXTAUTH_URL = "https://staging.syndicate.cooperativ.io"
NEXT_PUBLIC_PRIVACY_URL = "https://cooperativ.io/privacy"
NEXT_PUBLIC_TERMS_URL = "https://cooperativ.io/terms"

7 changes: 6 additions & 1 deletion pages/[organizationId]/[offeringId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ const ProjectProfile: NextPage<ResultProps> = ({ result }) => {
property="og:image"
content={sharingImage ? `/assets/images/sharing-images/${sharingImage?.url}` : '/assets/images/share.png'}
/>
<meta property="og:url" content={`https://cooperativ.io/${orgId}/offerings/${id}`}></meta>
<meta
property="og:url"
content={`https://${
process.env.NEXT_PUBLIC_CLIENT === 'reizen' ? 'reizen.xyz' : 'cooperativ.io'
}/${orgId}/offerings/${id}`}
></meta>
Twitter
<meta name="twitter:title" content={name} />
<meta name="twitter:description" content={shortDescription as string} />
Expand Down
7 changes: 6 additions & 1 deletion pages/[organizationId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ const OfferorProfile: NextPage<ResultProps> = ({ result }) => {
property="og:image"
content={sharingImage ? `/assets/images/sharing-images/${sharingImage?.url}` : '/assets/images/share.png'}
/>
<meta property="og:url" content={`https://cooperativ.io/${id}/portal/`}></meta>
<meta
property="og:url"
content={`https://${
process.env.NEXT_PUBLIC_CLIENT === 'reizen' ? 'reizen.xyz' : 'cooperativ.io'
}/${id}/portal/`}
></meta>
Twitter
<meta name="twitter:title" content={name ?? ''} />
<meta name="twitter:description" content={shortDescription ?? ''} />
Expand Down
6 changes: 3 additions & 3 deletions src/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ const Footer: React.FunctionComponent<FooterProps> = ({ color, lightText }) => {
<div className="flex px-4 py-1 md:p-0">
<a href="https://cooperativ.io" rel="noreferrer" target="_blank">
<span className="flex md:mr-8 w-max">
<img src={stamp} alt="logo" width="15" /> {`Cooperativ Labs ${currentYear}`}{' '}
<img src={stamp} alt="logo" width="15" /> {`Powered by Cooperativ Labs ${currentYear}`}{' '}
</span>
</a>
</div>
<div className="flex">
<Link href="https://cooperativ.io/terms">
<Link href={`${process.env.NEXT_PUBLIC_TERMS_URL}`}>
<div className="px-4 py-1 md:p-0 md:mr-8 w-max">Terms of Service</div>
</Link>
<Link href="https://cooperativ.io/privacy">
<Link href={`${process.env.NEXT_PUBLIC_PRIVACY_URL}`}>
<div className="px-4 py-1 md:p-0 w-max">Privacy Policy</div>
</Link>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import React from 'react';
import { FC } from 'react';
import { useWindowSize } from 'react-use';

type CooperativLogoProps = {
type PlatformLogoProps = {
onlySymbol?: boolean;
};

const CooperativLogo: FC<CooperativLogoProps> = ({ onlySymbol }) => {
const PlatformLogo: FC<PlatformLogoProps> = ({ onlySymbol }) => {
const windowSize = useWindowSize();
const fullLogo =
process.env.NEXT_PUBLIC_CLIENT === 'reizen'
Expand All @@ -26,4 +26,4 @@ const CooperativLogo: FC<CooperativLogoProps> = ({ onlySymbol }) => {
);
};

export default CooperativLogo;
export default PlatformLogo;
5 changes: 3 additions & 2 deletions src/components/account/CreateAccount.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as Yup from 'yup';
import CooperativLogo from '../CooperativLogo';

import Link from 'next/link';
import PlatformLogo from '../PlatformLogo';
import React, { FC, ReactNode, useState } from 'react';
import { ErrorMessage, Field, Form, Formik } from 'formik';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
Expand Down Expand Up @@ -141,7 +142,7 @@ const CreateAccount: FC = () => {
return (
<div className="mt-5 md:p-10 md:rounded-lg md:bg-white md:shadow-xl">
<div className="flex justify-center mb-10">
<CooperativLogo />
<PlatformLogo />
</div>
{loading ? (
<div className="flex justify-center items-center ">
Expand Down
2 changes: 1 addition & 1 deletion src/components/address/CreateAddress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { Form, Formik } from 'formik';
import { geocodeByPlaceId } from 'react-google-places-autocomplete';
import { GoogleMap, Marker } from '@react-google-maps/api';
import { LegalEntity } from 'types';
import { useMutation } from '@apollo/client';
import { SingleValue } from 'react-select';
import { useMutation } from '@apollo/client';

export type CreateAddressType = {
entity: LegalEntity;
Expand Down
8 changes: 6 additions & 2 deletions src/components/notifications/notificationFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ export const handleOfferingRequestNotification = async ({
completionUrl,
notificationText,
}: EmailNotificationBaseProps) => {
const emailSubject = 'Notification: Cooperativ.io trade approval requested';
const emailSubject = `Notification: ${
process.env.NEXT_PUBLIC_CLIENT === 'reizen' ? 'ReiZen' : 'Cooperativ'
} trade approval requested`;
const notificationSubject = NotificationSubject.TransactionRequest;
handleContractNotification({
organization,
Expand All @@ -100,7 +102,9 @@ export const handleTradeExecutionNotification = async ({
completionUrl,
notificationText,
}: EmailNotificationBaseProps) => {
const emailSubject = 'Notification: Cooperativ.io trade executed';
const emailSubject = `Notification: ${
process.env.NEXT_PUBLIC_CLIENT === 'reizen' ? 'ReiZen' : 'Cooperativ'
} trade executed`;
const notificationSubject = NotificationSubject.TradeExecution;
handleContractNotification({
organization,
Expand Down
12 changes: 7 additions & 5 deletions src/containers/sideBar/ManagerSideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ const ManagerSideBar: FC<ManagerSideBarProps> = ({ organizations }) => {
</div>
)}

<div className="hidden md:flex col-span-5 bg-gray-100 w-48 z-10 min-h-full">
<div className="h-full bg-opacity-0 p-1 pr-2">
<div className="mb-5 text-lg font-bold px-2 pr-4 md:mt-4 ">{currentOrganizationName}</div>
<ManagerSideBarContents organizationId={setOrgId} />
{orgId && (
<div className="hidden md:flex col-span-5 bg-gray-100 w-48 z-10 min-h-full">
<div className="h-full bg-opacity-0 p-1 pr-2">
<div className="mb-5 text-lg font-bold px-2 pr-4 md:mt-4 ">{currentOrganizationName}</div>
<ManagerSideBarContents organizationId={setOrgId} />
</div>
</div>
</div>
)}
</div>
);

Expand Down
5 changes: 3 additions & 2 deletions src/containers/sideBar/OrganizationSwitcher.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import cn from 'classnames';
import CooperativLogo from '@src/components/CooperativLogo';

import PlatformLogo from '@src/components/PlatformLogo';
import React, { FC, useContext } from 'react';
import { ApplicationStoreProps, store } from '@context/store';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
Expand Down Expand Up @@ -50,7 +51,7 @@ const OrganizationSwitcher: FC<OrganizationSwitcherProps> = ({ organizations })
</div>
</button>
<div className="absolute bottom-3 left-3 justify-center">
<CooperativLogo onlySymbol />
<PlatformLogo onlySymbol />
</div>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/containers/wallet/EnsureCompatibleNetwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ const EnsureCompatibleNetwork: FC<EnsureCompatibleNetworkProps> = ({ children })
return (
<div className="flex flex-col h-full w-screen items-center justify-center">
<Card className="md:w-96 rounded-lg mx-4 md:mx-auto mt-4 p-4 ">
The blockchain you are using is not compatible with Cooperativ. Please use{' '}
{`The blockchain you are using is not compatible with ${
process.env.NEXT_PUBLIC_CLIENT === 'reizen' ? 'ReiZen' : 'Cooperativ'
}. Please use `}
<a className="underline font-bold" href="https://sepolia.dev/" target="_blank" rel="noreferrer">
Sepolia
</a>{' '}
Expand Down
4 changes: 3 additions & 1 deletion src/pages/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ const Dashboard: FC = () => {
{!hasOrganizations ? (
<div className="flex flex-col w-full h-full items-center">
<h1 className="text-2xl mb-4 text-center">
{`Welcome to Cooperativ's portal for creating and managing investment funds.`}
{`Welcome to ${
process.env.NEXT_PUBLIC_CLIENT === 'reizen' ? 'Reizen' : 'Cooperativ'
}'s portal for creating and managing investment funds.`}
</h1>
<h2 className="text-2xl font-medium mb-8 text-center">Start by creating an organization.</h2>
<Card className="rounded-lg shadow-box p-4 " style={{ width: 700 }}>
Expand Down
4 changes: 3 additions & 1 deletion src/pages/OfferingDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ const OfferingDetails: FC<OfferingDetailsProps> = ({ offering, refetchOffering }
<AlertBanner
show={!swapContractMatches && contractMatchesCurrentChain}
color="orange-600"
text={`The swap contract for this offering does not match the share contract. Please contact Cooperativ Support.`}
text={`The swap contract for this offering does not match the share contract. Please contact ${
process.env.NEXT_PUBLIC_CLIENT === 'reizen' ? 'Reizen' : 'Cooperativ'
} Support.`}
/>
<AlertBanner
show={!contractMatchesCurrentChain}
Expand Down
4 changes: 1 addition & 3 deletions src/utils/dGraphQueries/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ export const CREATE_SWAP_CONTRACT = gql`
offering {
id
details {
investmentCurrency {
code
}
investmentCurrency
}
}
}
Expand Down
Loading

0 comments on commit 7f073f2

Please sign in to comment.