From 263f2904acd2d8db7663113016beac99de10dc72 Mon Sep 17 00:00:00 2001
From: 2712 <2712@trustless.computer>
Date: Fri, 19 Jan 2024 17:29:50 +0700
Subject: [PATCH] update code
---
src/modules/Whitelist/leaderBoard/index.tsx | 170 +++++++++++++-------
1 file changed, 108 insertions(+), 62 deletions(-)
diff --git a/src/modules/Whitelist/leaderBoard/index.tsx b/src/modules/Whitelist/leaderBoard/index.tsx
index 27985e4fa..e37832854 100644
--- a/src/modules/Whitelist/leaderBoard/index.tsx
+++ b/src/modules/Whitelist/leaderBoard/index.tsx
@@ -33,14 +33,14 @@ const valueToImage: any = {
'30': 'flash_supper.svg',
};
-export const LEADER_BOARD_ID = 'LEADER_BOARD_ID'
+export const LEADER_BOARD_ID = 'LEADER_BOARD_ID';
const LeaderBoard = () => {
const { list } = useAppSelector(leaderBoardSelector);
const [isFetching, setIsFetching] = useState(true);
const [refreshing, setRefreshing] = useState(false);
const needReload = useAppSelector(commonSelector).needReload;
- const dispatch = useAppDispatch()
+ const dispatch = useAppDispatch();
const hasIncrementedPageRef = useRef(false);
const refParams = useRef({
@@ -50,7 +50,7 @@ const LeaderBoard = () => {
const refInitial = useRef(false);
useEffect(() => {
- fetchData(true);
+ fetchData(true);
}, [needReload]);
const removeOwnerRecord = (arr: ILeaderBoardPoint[] = []) => {
@@ -60,10 +60,12 @@ const LeaderBoard = () => {
const fetchData = async (isNew?: boolean) => {
try {
-
const sortList = (arr: ILeaderBoardPoint[]) => {
- return uniqBy(orderBy(arr, item => Number(item.need_active || false), 'desc'), (item: ILeaderBoardPoint) => item.twitter_id)
- }
+ return uniqBy(
+ orderBy(arr, (item) => Number(item.need_active || false), 'desc'),
+ (item: ILeaderBoardPoint) => item.twitter_id,
+ );
+ };
const { data: response, count } = await getTopLeaderBoards({
...refParams.current,
});
@@ -77,18 +79,22 @@ const LeaderBoard = () => {
page: 1,
};
const reArr = removeOwnerRecord(response);
- const arr = sortList(response2.concat(reArr))
- dispatch(setLeaderBoard({
- list: arr,
- count
- }));
+ const arr = sortList(response2.concat(reArr));
+ dispatch(
+ setLeaderBoard({
+ list: arr,
+ count,
+ }),
+ );
} else {
const reArr = removeOwnerRecord(response);
const arr = sortList([...reArr]);
- dispatch(setLeaderBoard({
- list: arr,
- count
- }));
+ dispatch(
+ setLeaderBoard({
+ list: arr,
+ count,
+ }),
+ );
}
} catch (error) {
} finally {
@@ -122,10 +128,9 @@ const LeaderBoard = () => {
fontSize: '12px',
letterSpacing: '-0.5px',
borderBottom: '1px solid #FFFFFF33',
- textTransform: 'uppercase'
+ textTransform: 'uppercase',
};
-
const columns: ColumnProp[] = useMemo(() => {
return [
{
@@ -138,7 +143,7 @@ const LeaderBoard = () => {
fontWeight: 500,
verticalAlign: 'middle',
letterSpacing: '-0.5px',
- color: 'black !important'
+ color: 'black !important',
},
render(data: ILeaderBoardPoint) {
return (
@@ -149,7 +154,7 @@ const LeaderBoard = () => {
justifyContent={'space-between'}
paddingLeft={'16px'}
>
-
- {data?.twitter_name || ""}
- {data?.twitter_name || ''}
INVITE POINTS
+INVITE PTS
Referral points are calculated based on the total number of friends you refer to the allowlist.
++ Referral points are calculated based on the total number of + friends you refer to the allowlist. +
BITCOIN OG POINTS
+BITCOIN PTS
Bitcoin OG is calculated from total gas fees paid on Bitcoin.
++ Bitcoin OG is calculated from total gas fees paid on + Bitcoin. +
MODULAR POINTS
+MODULAR PTS
Modular Points are calculated from your holding & staking TIA
++ Modular Points are calculated from your holding & staking{' '} + TIA +
TWEET POINTS
+TWEET PTS
Content Points are calculated based on the performance of your posts on X, including Views.
- Note: To be qualified, you must tag:
@BVMnetwork
+ Content Points are calculated based on the performance of
+ your posts on X, including Views. Note: To be qualified, you
+ must tag:
+ @BVMnetwork
+