Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix tab list issue on mobile #2228

Merged
merged 5 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/Header/KyberAINavItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import NavGroup from './groups/NavGroup'
import { DropdownTextAnchor, StyledNavLink } from './styleds'

const CustomSlideToUnlock = styled(SlideToUnlock)`
background: ${({ theme }) => theme.subText};
background: linear-gradient(
to right,
${({ theme }) => theme.subText} 0,
Expand All @@ -25,8 +26,8 @@ const CustomSlideToUnlock = styled(SlideToUnlock)`
);
background-clip: text;
-webkit-background-clip: text;

&[data-active='true'] {
background: ${({ theme }) => theme.primary};
background: linear-gradient(
to right,
${({ theme }) => theme.primary} 0,
Expand Down
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
9 changes: 1 addition & 8 deletions src/pages/TrueSightV2/pages/TokenAnalysisList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,21 +228,18 @@ const TabWrapper = styled(motion.div)`
}
${({ theme }) => theme.mediaWidth.upToSmall`
min-width: initial;
flex:1;
flex: 1;
`}
`

const ButtonTypeActive = styled(ButtonLight)`
height: 36px;
margin: 0 !important;
display: flex;
gap: 4px;
font-size: 14px;
white-space: nowrap;
border: 1px solid ${({ theme }) => theme.primary};
background-color: ${({ theme }) => rgba(theme.primary, 0.33)};
transition: all 0.1s ease;
flex: 1;
:hover {
background-color: ${({ theme }) => rgba(theme.primary, 0.5)};
filter: none;
Expand All @@ -251,14 +248,10 @@ const ButtonTypeActive = styled(ButtonLight)`

const ButtonTypeInactive = styled(ButtonOutlined)`
height: 36px;
margin: 0 !important;
display: flex;
gap: 4px;
font-size: 14px;
white-space: nowrap;
transition: all 0.1s ease;
flex: 1;

${({ theme }) => css`
color: ${theme.subText};
border-color: ${theme.subText};
Expand Down
Loading