-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: ice-hector <[email protected]>
- Loading branch information
1 parent
27ec382
commit dfa4dbe
Showing
89 changed files
with
1,103 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
// SPDX-License-Identifier: ice License 1.0 | ||
|
||
import {AuthConfig} from '@api/auth/types'; | ||
import {FeatureToggleConfig} from '@api/auth/types'; | ||
import {get} from '@api/client'; | ||
import {NO_CACHE_HEADERS} from '@api/client/getHeaders'; | ||
import {ENV} from '@constants/env'; | ||
|
||
export function getConfig() { | ||
return get<AuthConfig>(ENV.AUTH_CONFIG_URL ?? '', undefined, undefined, { | ||
headers: NO_CACHE_HEADERS, | ||
}); | ||
return get<FeatureToggleConfig>( | ||
ENV.AUTH_CONFIG_URL ?? '', | ||
undefined, | ||
undefined, | ||
{ | ||
headers: NO_CACHE_HEADERS, | ||
}, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-License-Identifier: ice License 1.0 | ||
|
||
import {get} from '@api/client'; | ||
import {TotalCoins} from '@api/tokenomics/types'; | ||
|
||
type Params = { | ||
days: number; | ||
tz: string; | ||
}; | ||
|
||
export function getTotalCoins({days, tz}: Params) { | ||
return get<TotalCoins>('/tokenomics-statistics/total-coins', { | ||
days, | ||
tz, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: ice License 1.0 | ||
|
||
import {COLORS} from '@constants/colors'; | ||
import * as React from 'react'; | ||
import Svg, {Path, SvgProps} from 'react-native-svg'; | ||
import {rem} from 'rn-units'; | ||
|
||
export const CoinsStackSmallIcon = ({ | ||
color = COLORS.white, | ||
width = rem(28), | ||
height = rem(28), | ||
...props | ||
}: SvgProps) => ( | ||
<Svg width={width} height={height} fill="none" viewBox="0 0 28 28" {...props}> | ||
<Path | ||
stroke={color} | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth={1.5} | ||
d="M24.5 9.333c0-1.933-3.656-3.5-8.167-3.5-4.51 0-8.166 1.567-8.166 3.5m16.333 0V14c0 1.19-1.384 2.24-3.5 2.872-1.323.397-2.932.628-4.667.628-1.734 0-3.343-.233-4.666-.628-2.115-.632-3.5-1.682-3.5-2.872V9.333m16.333 0c0 1.19-1.384 2.24-3.5 2.872-1.323.397-2.932.628-4.667.628-1.734 0-3.343-.232-4.666-.628-2.115-.632-3.5-1.682-3.5-2.872M3.5 14v4.666c0 1.19 1.385 2.24 3.5 2.873 1.323.396 2.932.627 4.667.627 1.735 0 3.343-.232 4.666-.627 2.116-.633 3.5-1.683 3.5-2.873V17.5M3.5 14c0-1.397 1.907-2.602 4.667-3.163M3.5 14c0 1.19 1.385 2.24 3.5 2.872 1.323.397 2.932.628 4.667.628.81 0 1.593-.05 2.333-.145" | ||
/> | ||
</Svg> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/components/BarGraph/hooks/useGetTotalCoinsBarGraphDataForStatsPeriod.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// SPDX-License-Identifier: ice License 1.0 | ||
|
||
import {totalCoinsToGraphData} from '@components/BarGraph/utils/totalCoinsToGraphData'; | ||
import {isSplashHiddenSelector} from '@store/modules/AppCommon/selectors'; | ||
import {StatsPeriod} from '@store/modules/Stats/types'; | ||
import {TokenomicsActions} from '@store/modules/Tokenomics/actions'; | ||
import {getTotalCoinsStatsSelector} from '@store/modules/Tokenomics/selectors'; | ||
import {TotalCoinsBarGraphData} from '@store/modules/Tokenomics/types'; | ||
import {useEffect, useMemo} from 'react'; | ||
import {useDispatch, useSelector} from 'react-redux'; | ||
|
||
export function useGetTotalCoinsBarGraphDataForStatsPeriod( | ||
statsPeriod: StatsPeriod, | ||
): TotalCoinsBarGraphData { | ||
const timeSeries = useSelector(getTotalCoinsStatsSelector(statsPeriod)); | ||
const isSplashHidden = useSelector(isSplashHiddenSelector); | ||
|
||
const totalCoinsBarGraphData: TotalCoinsBarGraphData = useMemo(() => { | ||
return totalCoinsToGraphData({ | ||
timeSeries, | ||
}); | ||
}, [timeSeries]); | ||
|
||
const dispatch = useDispatch(); | ||
useEffect(() => { | ||
if (isSplashHidden) { | ||
dispatch( | ||
TokenomicsActions.GET_TOTAL_COINS_STATS.START.create(statsPeriod), | ||
); | ||
} | ||
}, [dispatch, statsPeriod, isSplashHidden]); | ||
|
||
return totalCoinsBarGraphData; | ||
} |
6 changes: 3 additions & 3 deletions
6
...hooks/useGetBarGraphDataForStatsPeriod.ts → ...etUserGrowthBarGraphDataForStatsPeriod.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...s/BarGraph/utils/timeSeriesToGraphData.ts → ...Graph/utils/timeSeriesToUsersGraphData.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// SPDX-License-Identifier: ice License 1.0 | ||
|
||
import {TotalCoinsTimeSeries} from '@api/tokenomics/types'; | ||
import {BarGraphData} from '@components/BarGraph/types'; | ||
import {dayjs} from '@services/dayjs'; | ||
import {TotalCoinsBarGraphData} from '@store/modules/Tokenomics/types'; | ||
|
||
export function totalCoinsToGraphData({ | ||
timeSeries, | ||
}: { | ||
timeSeries: TotalCoinsTimeSeries[]; | ||
}): TotalCoinsBarGraphData { | ||
if (!timeSeries?.length) { | ||
return { | ||
blockchainData: [], | ||
preStakingData: [], | ||
standardData: [], | ||
totalData: [], | ||
}; | ||
} | ||
|
||
const blockchainData: BarGraphData[] = timeSeries.map( | ||
({date, blockchain}) => { | ||
return { | ||
label: dayjs(date).format('MM/DD'), | ||
value: blockchain, | ||
}; | ||
}, | ||
); | ||
|
||
const preStakingData: BarGraphData[] = timeSeries.map( | ||
({date, preStaking}) => { | ||
return { | ||
label: dayjs(date).format('MM/DD'), | ||
value: preStaking, | ||
}; | ||
}, | ||
); | ||
|
||
const standardData: BarGraphData[] = timeSeries.map(({date, standard}) => { | ||
return { | ||
label: dayjs(date).format('MM/DD'), | ||
value: standard, | ||
}; | ||
}); | ||
|
||
const totalData: BarGraphData[] = timeSeries.map(({date, total}) => { | ||
return { | ||
label: dayjs(date).format('MM/DD'), | ||
value: total, | ||
}; | ||
}); | ||
|
||
return { | ||
blockchainData, | ||
preStakingData, | ||
standardData, | ||
totalData, | ||
}; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.