Skip to content

Commit

Permalink
fix some kyberAI bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoYhun committed Sep 11, 2023
1 parent 22d227c commit adcf386
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/constants/networks/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const base: EVMNetworkInfo = {
defaultBlockSubgraph: 'https://base-graph.kyberengineering.io/subgraphs/name/kybernetwork/base-blocks',
etherscanUrl: 'https://basescan.org',
etherscanName: 'Base Explorer',
bridgeURL: EMPTY,
bridgeURL: 'https://bridge.base.org/deposit',
nativeToken: {
symbol: 'ETH',
name: 'ETH',
Expand Down
34 changes: 27 additions & 7 deletions src/pages/TrueSightV2/components/LoadingTextAnimation.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { useMedia } from 'react-use'
import styled, { keyframes } from 'styled-components'

import { MEDIA_WIDTHS } from 'theme'

const bounce = keyframes`
15%,
35%,
Expand All @@ -24,7 +27,6 @@ const Wrapper = styled.div`
color: ${({ theme }) => theme.text};
animation: ${bounce} 3s infinite ease;
min-width: 10px;
display: flex;
justify-content: center;
margin-bottom: 10px;
}
Expand Down Expand Up @@ -120,16 +122,34 @@ const Wrapper = styled.div`
animation-delay: 1.55s;
}
${({ theme }) => theme.mediaWidth.upToSmall`
font-size: 12px;
font-size: 14px;
`}
`

export default function LoadingTextAnimation() {
const isMobile = useMedia(`(max-width: ${MEDIA_WIDTHS.upToSmall}px)`)
return (
<Wrapper>
{'Crafting your screenshot...'.split('').map((w, index) => (
<span key={index}>{w}</span>
))}
</Wrapper>
<>
{isMobile ? (
<Wrapper>
<div>
{'Crafting your'.split('').map((w, index) => (
<span key={index}>{w}</span>
))}
</div>
<div>
{'screenshot...'.split('').map((w, index) => (
<span key={index}>{w}</span>
))}
</div>
</Wrapper>
) : (
<Wrapper>
{'Crafting your screenshot...'.split('').map((w, index) => (
<span key={index}>{w}</span>
))}
</Wrapper>
)}
</>
)
}
13 changes: 8 additions & 5 deletions src/pages/TrueSightV2/components/chart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2724,6 +2724,7 @@ export const Prochart = ({
'mainSeriesProperties.priceAxisProperties.autoScale': true,
'scalesProperties.textColor': theme.text,
})

tvWidget
.activeChart()
.createStudy('Relative Strength Index')
Expand Down Expand Up @@ -2764,7 +2765,7 @@ export const Prochart = ({
const addSRLevels = useCallback(() => {
if (!currentPrice || !tvWidget) return
SRLevels?.forEach((level: ISRLevel) => {
const entityId = tvWidget.activeChart().createMultipointShape([{ time: level.timestamp, price: level.value }], {
const entityId = tvWidget?.activeChart().createMultipointShape([{ time: level.timestamp, price: level.value }], {
shape: 'horizontal_ray',
lock: true,
disableSelection: true,
Expand Down Expand Up @@ -2799,10 +2800,12 @@ export const Prochart = ({
}, [tvWidget, SRLevels, showSRLevels, currentPrice, theme, removeSRLevels, addSRLevels])

useEffect(() => {
if (resolution && tvWidget?.activeChart().resolution() !== (resolution as ResolutionString)) {
tvWidget?.activeChart().setResolution(resolution as ResolutionString)
variablesRef.current.resolution = resolution
}
try {
if (resolution && tvWidget?.activeChart().resolution() !== (resolution as ResolutionString)) {
tvWidget?.activeChart().setResolution(resolution as ResolutionString)
variablesRef.current.resolution = resolution
}
} catch {}
}, [resolution, tvWidget])

return (
Expand Down

0 comments on commit adcf386

Please sign in to comment.