Skip to content

Commit

Permalink
Remove fusdc/arb earned
Browse files Browse the repository at this point in the history
  • Loading branch information
user committed Apr 19, 2024
1 parent 7dd8b75 commit 506d55b
Show file tree
Hide file tree
Showing 12 changed files with 1,120 additions and 757 deletions.
638 changes: 381 additions & 257 deletions web/app.fluidity.money/app/components/FLYClaimSubmitModal/index.tsx

Large diffs are not rendered by default.

1,061 changes: 631 additions & 430 deletions web/app.fluidity.money/app/components/FLYStakingStatsModal/index.tsx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ export const FluidifyForm = ({

const [swapInput, setSwapInput] = useState<string>("");

const swapAmount: BN = snapToValidValue(swapInput, assetToken, assetToken.userTokenBalance);
const swapAmount: BN = snapToValidValue(
swapInput,
assetToken,
assetToken.userTokenBalance
);

const assertCanSwap =
connected &&
Expand Down Expand Up @@ -72,7 +76,7 @@ export const FluidifyForm = ({
snapToValidValue(
assetToken.userTokenBalance.toString(),
assetToken,
assetToken.userTokenBalance,
assetToken.userTokenBalance
),
assetToken.decimals
)
Expand Down
11 changes: 6 additions & 5 deletions web/app.fluidity.money/app/components/MobileModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ type IMobileModal = {
path: (network: string) => string;
icon: JSX.Element;
}>;
nonNavigationEntries?: Array<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLElement>, HTMLElement>>;
nonNavigationEntries?: Array<
React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLElement>, HTMLElement>
>;
activeIndex: number;
chains: Record<string, { name: string; icon: JSX.Element }>;
unclaimedFluid: number;
Expand Down Expand Up @@ -209,8 +211,7 @@ export default function MobileModal({
{/* Navigation between pages */}
<ul className="sidebar-nav">
<>
{navigationMap
.map((obj, index) => {
{navigationMap.map((obj, index) => {
const key = Object.values(obj)[0];
const { name, icon, path } = obj;
const active = index === activeIndex;
Expand Down Expand Up @@ -241,8 +242,8 @@ export default function MobileModal({
</li>
);
})}
{...(nonNavigationEntries || [])}
</>
{...nonNavigationEntries || []}
</>
</ul>

{/* Navigation at bottom of modal */}
Expand Down
6 changes: 5 additions & 1 deletion web/app.fluidity.money/app/queries/addReferral.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { gql, jsonPost } from "~/util";

const mutation = gql`
mutation addReferral($referrer: String!, $referee: String!, $epoch: lootbox_epoch!) {
mutation addReferral(
$referrer: String!
$referee: String!
$epoch: lootbox_epoch!
) {
insert_lootbox_referrals_one(
object: { referrer: $referrer, referee: $referee, epoch: $epoch }
) {
Expand Down
12 changes: 10 additions & 2 deletions web/app.fluidity.money/app/queries/addReferralCode.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { gql, jsonPost } from "~/util";

const mutation = gql`
mutation addReferral($address: String!, $referral_code: String!, $epoch: lootbox_epoch!) {
mutation addReferral(
$address: String!
$referral_code: String!
$epoch: lootbox_epoch!
) {
insert_lootbox_referral_codes_one(
object: { address: $address, referral_code: $referral_code, epoch: $epoch}
object: {
address: $address
referral_code: $referral_code
epoch: $epoch
}
) {
address
referral_code
Expand Down
5 changes: 3 additions & 2 deletions web/app.fluidity.money/app/queries/requestProof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ export type RequestProofRes = {
};

export const requestProof = (address: string, signature: string) => {
const body = {address, signature};
const body = { address, signature };

const url = "https://lyqieipytnj32qqga7mpgdpn7q0pxmlw.lambda-url.ap-southeast-2.on.aws/";
const url =
"https://lyqieipytnj32qqga7mpgdpn7q0pxmlw.lambda-url.ap-southeast-2.on.aws/";

return jsonPost<RequestProofBody, RequestProofRes>(url, body, {});
};
8 changes: 6 additions & 2 deletions web/app.fluidity.money/app/queries/useReferralCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { gql, jsonPost } from "~/util";

const queryByAddress = gql`
query getReferralCodeByAddress($address: String!, $epoch: lootbox_epoch!) {
lootbox_referral_codes(where: { address: { _eq: $address }, epoch: { _eq: $epoch } }) {
lootbox_referral_codes(
where: { address: { _eq: $address }, epoch: { _eq: $epoch } }
) {
address
referral_code
epoch
Expand All @@ -12,7 +14,9 @@ const queryByAddress = gql`

const queryByCode = gql`
query getReferralCodeByCode($code: String!, $epoch: lootbox_epoch!) {
lootbox_referral_codes(where: { referral_code: { _eq: $code }, epoch: { _eq: $epoch } }) {
lootbox_referral_codes(
where: { referral_code: { _eq: $code }, epoch: { _eq: $epoch } }
) {
address
referral_code
epoch
Expand Down
52 changes: 41 additions & 11 deletions web/app.fluidity.money/app/queries/useReferralCount.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { gql, jsonPost } from "~/util";

const queryActiveByReferrerAddress = gql`
query getClaimedReferrerReferralCount($address: String!, $epoch: lootbox_epoch!) {
lootbox_referrals_aggregate (
where: { referrer: { _eq: $address }, active: { _eq: true }, epoch: { _eq: $epoch } }
query getClaimedReferrerReferralCount(
$address: String!
$epoch: lootbox_epoch!
) {
lootbox_referrals_aggregate(
where: {
referrer: { _eq: $address }
active: { _eq: true }
epoch: { _eq: $epoch }
}
) {
aggregate {
count
Expand All @@ -13,9 +20,16 @@ const queryActiveByReferrerAddress = gql`
`;

const queryActiveByRefereeAddress = gql`
query getClaimedReferreeReferralCount($address: String!, $epoch: lootbox_epoch!) {
query getClaimedReferreeReferralCount(
$address: String!
$epoch: lootbox_epoch!
) {
lootbox_referrals_aggregate(
where: { referee: { _eq: $address }, active: { _eq: true }, epoch: { _eq: $epoch } }
where: {
referee: { _eq: $address }
active: { _eq: true }
epoch: { _eq: $epoch }
}
) {
aggregate {
count
Expand All @@ -25,9 +39,16 @@ const queryActiveByRefereeAddress = gql`
`;

const queryInactiveByRefereeAddress = gql`
query getClaimedReferrerReferralCount($address: String!, $epoch: lootbox_epoch!) {
query getClaimedReferrerReferralCount(
$address: String!
$epoch: lootbox_epoch!
) {
lootbox_referrals_aggregate(
where: { referee: { _eq: $address }, active: { _eq: false }, epoch: { _eq: $epoch } }
where: {
referee: { _eq: $address }
active: { _eq: false }
epoch: { _eq: $epoch }
}
) {
aggregate {
count
Expand Down Expand Up @@ -55,10 +76,13 @@ type ReferralCountRes = {
errors?: unknown;
};

const useActiveReferralCountByReferrerAddress = (address: string, epoch: string) => {
const useActiveReferralCountByReferrerAddress = (
address: string,
epoch: string
) => {
const variables = {
address,
epoch
epoch,
};

const body = {
Expand All @@ -79,7 +103,10 @@ const useActiveReferralCountByReferrerAddress = (address: string, epoch: string)
);
};

const useActiveReferralCountByRefereeAddress = (address: string, epoch: string) => {
const useActiveReferralCountByRefereeAddress = (
address: string,
epoch: string
) => {
const variables = {
address,
epoch,
Expand All @@ -103,7 +130,10 @@ const useActiveReferralCountByRefereeAddress = (address: string, epoch: string)
);
};

const useInactiveReferralCountByRefereeAddress = (address: string, epoch: string) => {
const useInactiveReferralCountByRefereeAddress = (
address: string,
epoch: string
) => {
const variables = {
address,
epoch,
Expand Down
29 changes: 24 additions & 5 deletions web/app.fluidity.money/app/queries/useReferrals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@ export type Referral = {
};

const QUERY_BY_ADDRESS = gql`
query getReferralByAddress($referrer: String!, $referee: String!, $epoch: lootbox_epoch!) {
query getReferralByAddress(
$referrer: String!
$referee: String!
$epoch: lootbox_epoch!
) {
lootbox_referrals(
where: { referrer: { _eq: $referrer }, referee: { _eq: $referee }, epoch: { _eq: $epoch } }
where: {
referrer: { _eq: $referrer }
referee: { _eq: $referee }
epoch: { _eq: $epoch }
}
) {
active
createdTime: created_time
Expand All @@ -25,9 +33,16 @@ const QUERY_BY_ADDRESS = gql`
`;

const QUERY_INACTIVE_BY_ADDRESS = gql`
query getInactiveReferralByAddress($address: String!, $epoch: lootbox_epoch!) {
query getInactiveReferralByAddress(
$address: String!
$epoch: lootbox_epoch!
) {
lootbox_referrals(
where: { referee: { _eq: $address }, active: { _eq: false }, epoch: { _eq: $epoch } }
where: {
referee: { _eq: $address }
active: { _eq: false }
epoch: { _eq: $epoch }
}
order_by: { created_time: asc }
limit: 1
) {
Expand Down Expand Up @@ -65,7 +80,11 @@ type ReferralsRes = {
errors?: unknown;
};

const useReferralByAddress = (referrer: string, referee: string, epoch: string) => {
const useReferralByAddress = (
referrer: string,
referee: string,
epoch: string
) => {
const variables = {
referrer,
referee,
Expand Down
6 changes: 5 additions & 1 deletion web/app.fluidity.money/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import { withSentry } from "@sentry/remix";

import globalStylesheetUrl from "./global-styles.css";
import surfingStylesheetUrl from "@fluidity-money/surfing/dist/style.css";
import { JoeFarmlandsOrCamelotKingdomLinks, ToolTipLinks, FLYClaimSubmitModalLinks } from "./components";
import {
JoeFarmlandsOrCamelotKingdomLinks,
ToolTipLinks,
FLYClaimSubmitModalLinks,
} from "./components";
import { ToolProvider } from "./components/ToolTip";
import CacheProvider from "contexts/CacheProvider";
import { useEffect, useState } from "react";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
toSignificantDecimals,
numberToCommaSeparated,
useViewport,
numberToMonetaryString,
toDecimalPlaces,
} from "@fluidity-money/surfing";
import {
Expand Down Expand Up @@ -519,7 +518,7 @@ const Airdrop = () => {
const airdropLeaderboardData = useMemo(() => ({
loaded: airdropLeaderboardData_?.loaded,
leaderboard: getLeaderboardWithUser(
airdropLeaderboardData_?.leaderboard || [],
airdropLeaderboardData_?.leaderboard || [],
address ?? ""
)
}), [airdropLeaderboardData_])
Expand Down Expand Up @@ -1597,7 +1596,7 @@ const airdropRankRow = (
isMobile = false
): IRow => {
const { address } = useContext(FluidityFacadeContext);
const { user, rank, referralCount, fusdcEarned, flyStaked, bottles } = data;
const { user, rank, referralCount, flyStaked, bottles } = data;

return {
className: `airdrop-row ${isMobile ? "airdrop-mobile" : ""} ${address && address === user ? "highlighted-row" : ""
Expand Down Expand Up @@ -1662,40 +1661,6 @@ const airdropRankRow = (
</Text>
</td>
);
case "$fUSDC EARNED":
return (
<td>
<Text
prominent
style={
address && address === user
? {
color: "black",
}
: {}
}
>
{numberToMonetaryString(fusdcEarned)}
</Text>
</td>
);
case "$ARB EARNED":
return (
<td>
<Text
prominent
style={
address && address === user
? {
color: "black",
}
: {}
}
>
0
</Text>
</td>
);
case "$FLY STAKED":
return (
<td>
Expand Down Expand Up @@ -1818,8 +1783,6 @@ const Leaderboard = ({
{ name: "RANK" },
{ name: "USER" },
{ name: "BOTTLES" },
{ name: "$fUSDC EARNED" },
{ name: "$ARB EARNED" },
{ name: "$FLY STAKED" },
{ name: "REFERRALS" },
]}
Expand Down

0 comments on commit 506d55b

Please sign in to comment.