Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new product: hide performance #69

Merged
merged 1 commit into from
Apr 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions web/src/app/products/product-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ import { gray70Hover } from "@carbon/colors";
import { useParams } from "react-router-dom";
import { useWallet } from "@solana/wallet-adapter-react";

const OBJECTIVE_MAP: { [key: string]: string } = {
"AdXkDnJpFKqZeoUygLvm5dp2b5JGVPz3rEWfGCtB5Kc2": "The Glam Investment Fund seeks to reflect generally the performance of the price of Bitcoin and Solana.",
"Dt4uayF35AKhhgaPNxdVRh4khNaGAih8L9SMSs9Wr6CP": "LFG aims to generate superior returns through trading in futures markets.",
}

const LOCKUP_MAP: { [key: string]: number } = {
"Dt4uayF35AKhhgaPNxdVRh4khNaGAih8L9SMSs9Wr6CP": 72*60,
}

const DISABLE_PERF: { [key: string]: boolean } = {
"Dt4uayF35AKhhgaPNxdVRh4khNaGAih8L9SMSs9Wr6CP": true,
}

export default function ProductPage() {
class FundModel {
key: PublicKey;
Expand Down Expand Up @@ -87,6 +100,8 @@ export default function ProductPage() {
data?.shareClasses[0].toBase58() || "1111111111111111111111111111111111";
const isManager = publicKey?.toString() === data?.manager?.toString();

const disablePerf = DISABLE_PERF[fundId] || false;

const fund = {
id: fundId,
symbol: data?.symbol || "",
Expand All @@ -95,8 +110,7 @@ export default function ProductPage() {
manager: data?.manager,
treasury: data?.treasury,
shareClass0: data?.shareClasses[0],
investmentObjective:
"The Glam Investment Fund seeks to reflect generally the performance of the price of Bitcoin and Solana.",
investmentObjective: OBJECTIVE_MAP[fundId] || "Not provided.",
nav: totalShares ? aum / totalShares : 100,
// dailyNavChange: 2,
dailyNavChange: fundPerfChartData[fundPerfChartData.length - 2].value,
Expand All @@ -119,7 +133,7 @@ export default function ProductPage() {
terms: {
highWaterMark: false,
hurdleRate: false,
lockupPeriod: "60", // denominated in minutes
lockupPeriod: LOCKUP_MAP[fundId] || 60, // denominated in minutes
minimumSubscription: 0,
maximumSubscription: 10000
}
Expand Down Expand Up @@ -224,6 +238,7 @@ export default function ProductPage() {
</p>
</div>
<br />
{ !disablePerf && (
<div className="flex flex-col gap-[12px]">
<p>15 Days NAV Change</p>
<div className="flex items-center ">
Expand All @@ -238,6 +253,7 @@ export default function ProductPage() {
))}
</div>
</div>
)}
</Tile>
</div>
<div className="col-span-1">
Expand Down Expand Up @@ -339,10 +355,17 @@ export default function ProductPage() {
</div>
<div className="col-span-2">
<Tile className="">
{!disablePerf && (
<LineChart
data={chartData.data}
options={chartData.options}
/>
) || (
<div className="cds--cc--title" style={{ height: 355 }}>
<p className="title">Performance</p>
<p>Not yet available.</p>
</div>
)}
</Tile>
</div>
<div className="col-span-2">
Expand Down