Skip to content

Commit

Permalink
some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoYhun committed Aug 11, 2023
1 parent 05d74c4 commit 09a25cb
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
14 changes: 10 additions & 4 deletions src/pages/TrueSightV2/components/chart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -925,12 +925,12 @@ export const NetflowToWhaleWallets = ({ tab, noAnimation }: { tab?: ChartTab; no
const theme = useTheme()
const { chain, address } = useParams()
const { state, dispatch } = useChartStatesContext(KYBERAI_CHART_ID.NETFLOW_TO_WHALE_WALLET, {
timeframe: KyberAITimeframe.ONE_MONTH,
timeframe: KyberAITimeframe.ONE_WEEK,
showOptions: ['showInflow', 'showOutflow', 'showNetflow'],
noData: true,
})

const timeframe = state?.timeframe || KyberAITimeframe.ONE_MONTH
const timeframe = state?.timeframe || KyberAITimeframe.ONE_WEEK
const showInflow = state?.showOptions?.includes('showInflow')
const showOutflow = state?.showOptions?.includes('showOutflow')
const showNetflow = state?.showOptions?.includes('showNetflow')
Expand All @@ -940,6 +940,7 @@ export const NetflowToWhaleWallets = ({ tab, noAnimation }: { tab?: ChartTab; no
const timerange =
{
[KyberAITimeframe.ONE_DAY]: 3600,
[KyberAITimeframe.THREE_DAY]: 3600,
[KyberAITimeframe.ONE_WEEK]: 86400,
[KyberAITimeframe.ONE_MONTH]: 86400,
[KyberAITimeframe.THREE_MONTHS]: 86400,
Expand All @@ -948,6 +949,7 @@ export const NetflowToWhaleWallets = ({ tab, noAnimation }: { tab?: ChartTab; no
now -
({
[KyberAITimeframe.ONE_DAY]: 86400,
[KyberAITimeframe.THREE_DAY]: 259200,
[KyberAITimeframe.ONE_WEEK]: 604800,
[KyberAITimeframe.ONE_MONTH]: 2592000,
[KyberAITimeframe.THREE_MONTHS]: 7776000,
Expand Down Expand Up @@ -1173,6 +1175,7 @@ export const NetflowToWhaleWallets = ({ tab, noAnimation }: { tab?: ChartTab; no
}
timeframes={[
KyberAITimeframe.ONE_DAY,
KyberAITimeframe.THREE_DAY,
KyberAITimeframe.ONE_WEEK,
KyberAITimeframe.ONE_MONTH,
KyberAITimeframe.THREE_MONTHS,
Expand Down Expand Up @@ -1358,12 +1361,12 @@ export const NetflowToCentralizedExchanges = ({ tab, noAnimation }: { tab?: Char
const theme = useTheme()
const { chain, address } = useParams()
const { state, dispatch } = useChartStatesContext(KYBERAI_CHART_ID.NETFLOW_TO_CEX, {
timeframe: KyberAITimeframe.ONE_MONTH,
timeframe: KyberAITimeframe.ONE_WEEK,
showOptions: ['showInflow', 'showOutflow', 'showNetflow'],
noData: true,
})

const timeframe = state?.timeframe || KyberAITimeframe.ONE_MONTH
const timeframe = state?.timeframe || KyberAITimeframe.ONE_WEEK
const showInflow = state?.showOptions?.includes('showInflow')
const showOutflow = state?.showOptions?.includes('showOutflow')
const showNetflow = state?.showOptions?.includes('showNetflow')
Expand All @@ -1373,6 +1376,7 @@ export const NetflowToCentralizedExchanges = ({ tab, noAnimation }: { tab?: Char
const timerange =
{
[KyberAITimeframe.ONE_DAY]: 3600,
[KyberAITimeframe.THREE_DAY]: 3600,
[KyberAITimeframe.ONE_WEEK]: 86400,
[KyberAITimeframe.ONE_MONTH]: 86400,
[KyberAITimeframe.THREE_MONTHS]: 86400,
Expand All @@ -1381,6 +1385,7 @@ export const NetflowToCentralizedExchanges = ({ tab, noAnimation }: { tab?: Char
now -
({
[KyberAITimeframe.ONE_DAY]: 86400,
[KyberAITimeframe.THREE_DAY]: 259200,
[KyberAITimeframe.ONE_WEEK]: 604800,
[KyberAITimeframe.ONE_MONTH]: 2592000,
[KyberAITimeframe.THREE_MONTHS]: 7776000,
Expand Down Expand Up @@ -1564,6 +1569,7 @@ export const NetflowToCentralizedExchanges = ({ tab, noAnimation }: { tab?: Char
onSelect={timeframe => dispatch({ type: CHART_STATES_ACTION_TYPE.TIMEFRAME_CHANGE, payload: { timeframe } })}
timeframes={[
KyberAITimeframe.ONE_DAY,
KyberAITimeframe.THREE_DAY,
KyberAITimeframe.ONE_WEEK,
KyberAITimeframe.ONE_MONTH,
KyberAITimeframe.THREE_MONTHS,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/TrueSightV2/components/table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export const Top10HoldersTable = () => {
window.open(getEtherscanLink(NETWORK_TO_CHAINID[chain], item.address, 'address'), '_blank')
}}
>
<Icon id="open-link" size={16} /> Analyze
<Icon id="open-link" size={16} /> Explore
</ActionButton>
</RowFit>
</Column>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/TrueSightV2/pages/SingleToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ export default function SingleToken() {
const [showShare, setShowShare] = useState(false)
const above768 = useMedia(`(min-width:${MEDIA_WIDTHS.upToSmall}px)`)
const { chain, address } = useParams()
const [currentTab, setCurrentTab] = useState<DiscoverTokenTab>(DiscoverTokenTab.OnChainAnalysis)
const [currentTab, setCurrentTab] = useState<DiscoverTokenTab>(DiscoverTokenTab.TechnicalAnalysis)

const { data: token, isLoading } = useKyberAITokenOverview()

Expand Down Expand Up @@ -596,8 +596,8 @@ export default function SingleToken() {
<DisplaySettings currentTab={currentTab} />
</RowFit>
</Row>
{currentTab === DiscoverTokenTab.OnChainAnalysis && <OnChainAnalysis />}
{currentTab === DiscoverTokenTab.TechnicalAnalysis && <TechnicalAnalysis />}
{currentTab === DiscoverTokenTab.OnChainAnalysis && <OnChainAnalysis />}
</ChartStatesContext.Provider>
<KyberAIShareModal
isOpen={showShare}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/TrueSightV2/pages/TokenAnalysisList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ const tokenTypeList: {
tooltip?: (theme: DefaultTheme) => ReactNode
title: string
}[] = [
{ type: KyberAIListType.ALL, title: t`All` },
{ type: KyberAIListType.MYWATCHLIST, icon: 'star', title: t`My Watchlist` },
{ type: KyberAIListType.ALL, title: t`All` },
{
type: KyberAIListType.BULLISH,
title: t`Bullish`,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/TrueSightV2/types/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,8 @@ export interface ISRLevel {
}

export enum DiscoverTokenTab {
OnChainAnalysis = 'On-Chain Analysis',
TechnicalAnalysis = 'Technical Analysis',
// News = 'News',
OnChainAnalysis = 'On-Chain Analysis',
}

export enum ChartTab {
Expand All @@ -179,6 +178,7 @@ export enum KyberAITimeframe {
ONE_HOUR = '1h',
FOUR_HOURS = '4h',
ONE_DAY = '1d',
THREE_DAY = '3d',
FOUR_DAY = '4d',
ONE_WEEK = '7d',
ONE_MONTH = '1m',
Expand Down

0 comments on commit 09a25cb

Please sign in to comment.