Skip to content

Commit

Permalink
Merge branch 'develop' into feature/add-locked-gsol
Browse files Browse the repository at this point in the history
  • Loading branch information
dankelleher authored Oct 2, 2023
2 parents 1aecc0e + 8b17f52 commit a7afc81
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 295 deletions.
1 change: 1 addition & 0 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@marinade.finance/marinade-ts-sdk": "^4.0.4",
"cross-env": "^7.0.3"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Dialog } from "@headlessui/react";
import { ExclamationTriangleIcon } from "@heroicons/react/24/solid";
import React, { type FC } from "react";
import { type FC } from "react";

import { BaseModal, type ModalProps } from "./";
import { MangroveButton } from "../../../rewards/components/MangroveButton";

const LockWarningModal: FC<ModalProps> = (props) => {
return (
Expand All @@ -28,10 +27,6 @@ const LockWarningModal: FC<ModalProps> = (props) => {
Locked gSOL will be available to unlock after one full epoch (2-3
days).
</p>
<MangroveButton />
<p className="text-md">
To earn a bonus Mangrove NFT, you must lock at least 0.5 gSOL.
</p>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/grow/components/PartnerButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ type PartnerProps = PropsWithChildren & { partner: Partner };

const ExternalPartner: FC<PartnerProps> = ({ children, partner }) => (
<a
href={partner.website}
target="_blank"
href={partner.website ?? "#"}
target={partner.website == null ? "_blank" : "_self"}
rel="noreferrer"
className="transition-all cursor-pointer bg-cover bg-blend-multiply bg-center bg-no-repeat hover:scale-105 hover:brightness-105"
style={
Expand All @@ -28,7 +28,7 @@ const ExternalPartner: FC<PartnerProps> = ({ children, partner }) => (

const InternalPartner: FC<PartnerProps> = ({ children, partner }) => (
<Link
to={partner.website}
to={partner.website ?? "#"}
className="transition-all cursor-pointer bg-cover bg-blend-multiply bg-center bg-no-repeat hover:scale-105 hover:brightness-105"
style={
partner.imageUrl !== undefined
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/grow/partners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const partners = [
},
{
name: "Coinable",
website: "https://coinablepay.com/",
imageUrl: "partners/coinable.svg",
},
];
2 changes: 1 addition & 1 deletion packages/app/src/grow/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export type Charity = PlaceholderOrg & {
};

export type Partner = PlaceholderOrg & {
website: string;
website?: string;
internal?: boolean;
};
22 changes: 0 additions & 22 deletions packages/app/src/hub/HubApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ import { useCarbon } from "../common/hooks";
import { useForest } from "../common/context/forestContext";
import { useHelp } from "../common/context/HelpContext";
import { AppRoute } from "../Routes";
import { AlertBadge } from "../common/content/Badge";
import { useLockHubDetails } from "./hooks/useLockHubDetails";
import { MangroveIcon } from "../rewards/components/MangroveIcon";

const LINK_CHEVRON_SIZE = 32;

Expand All @@ -37,12 +34,10 @@ const _HubApp: ForwardRefRenderFunction<
const [zenMode, updateZenMode] = useZenMode();
const { myTree } = useForest();
const { totalCarbon } = useCarbon();
const { needsUpgrade: showLockAlert } = useLockHubDetails();

const [showIntro, updateShowIntro] = useState(false);
const [introLeft, updateIntroLeft] = useState(false);
const [showHubNav, updateShowHubNav] = useState(false);
const [showAlerts, updateShowAlerts] = useState(false);

const wasHubNavShown = useRef(false);
const showWalletButton = useMemo(() => {
Expand Down Expand Up @@ -123,21 +118,6 @@ const _HubApp: ForwardRefRenderFunction<
});
}, [active, currentHelpRoute, showHubNav, showWalletButton]);

// show alerts 3s after hub nav is shown
useEffect(() => {
if (!showHubNav) {
updateShowAlerts(false);
return;
}

const timer = setTimeout(() => {
updateShowAlerts(showHubNav);
}, 3000);
return () => {
clearTimeout(timer);
};
}, [showHubNav]);

return (
<div
className={clx(
Expand Down Expand Up @@ -266,8 +246,6 @@ const _HubApp: ForwardRefRenderFunction<
<Link to="/lock" className="block w-full mt-4 leading-none">
<div className="relative inline-block">
<span className="text-2xl">Lock</span>
{showLockAlert && <AlertBadge />}
{showAlerts && <MangroveIcon />}
</div>
<br />
<IoChevronDownOutline
Expand Down
4 changes: 0 additions & 4 deletions packages/app/src/hub/components/HubIntro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { WalletMultiButton } from "@solana/wallet-adapter-react-ui";
import { type FC } from "react";

import { CarbonRecovered, LogoIcon, LogoText } from "../../common/components";
import { MangroveButton } from "../../rewards/components/MangroveButton";

const HubIntro: FC<{
show: boolean;
Expand Down Expand Up @@ -86,9 +85,6 @@ const HubIntro: FC<{
<WalletMultiButton className="!bg-green hover:!bg-green-light !text-white">
Start reducing CO<sub>2</sub>&nbsp;emissions
</WalletMultiButton>
<div className="mt-6">
<MangroveButton />
</div>
<CarbonRecovered />
</Transition.Child>
</Transition>
Expand Down
4 changes: 0 additions & 4 deletions packages/app/src/locking/LockingApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { useWallet } from "@solana/wallet-adapter-react";
import { useNFTs } from "../common/context/NFTsContext";
import { LockDetailsView } from "./LockDetails";
import { detailsIndicateUpgradePossible } from "./utils";
import { MangroveButton } from "../rewards/components/MangroveButton";
import { useScript } from "../common/hooks";
import { LockForm } from "./LockForm";
import { LockingSuccessModal } from "./LockingSuccessModal";
Expand Down Expand Up @@ -187,9 +186,6 @@ const _LockingApp: ForwardRefRenderFunction<
<h1 className="font-bold text-green-light text-3xl text-center">
Lock gSOL to receive an Impact NFT
</h1>
<div className={"flex flex-col items-center mt-4"}>
<MangroveButton />
</div>
</div>
)}
{details?.impactNFTDetails && (
Expand Down
10 changes: 1 addition & 9 deletions packages/app/src/locking/LockingSuccessModal.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
import { MangroveFormButton } from "../rewards/components/MangroveFormButton";
import { LockTweetButton } from "./LockTweetButton";
import { InfoModal } from "../common/components/modals/InfoModal";
import React, { type FC } from "react";
import { type FC } from "react";
import { type ModalControl } from "../common/hooks";
import { LAMPORTS_PER_SOL } from "@solana/web3.js";
import BN from "bn.js";
import { solToLamports } from "../common/utils";

const LOCK_REWARD_AMOUNT = new BN(0.5 * LAMPORTS_PER_SOL); // 0.5 SOL in lamports

export const LockingSuccessModal: FC<{
control: ModalControl;
amount: string;
}> = ({ control, amount }) => {
const eligibleForReward = solToLamports(amount).gte(LOCK_REWARD_AMOUNT);
return (
<InfoModal title="Well done!" modalControl={control} showActions={false}>
{eligibleForReward && <MangroveFormButton />}
<LockTweetButton />
</InfoModal>
);
Expand Down
21 changes: 0 additions & 21 deletions packages/app/src/rewards/components/MangroveButton.tsx

This file was deleted.

87 changes: 0 additions & 87 deletions packages/app/src/rewards/components/MangroveDetails.tsx

This file was deleted.

41 changes: 0 additions & 41 deletions packages/app/src/rewards/components/MangroveFormButton.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions packages/app/src/rewards/components/MangroveIcon.tsx

This file was deleted.

Loading

0 comments on commit a7afc81

Please sign in to comment.