Skip to content

Commit

Permalink
Merge branch 'main' into e2e-test-report
Browse files Browse the repository at this point in the history
  • Loading branch information
ltthienn authored Sep 11, 2023
2 parents 60d5841 + 47b6d12 commit ad742c4
Show file tree
Hide file tree
Showing 6 changed files with 247 additions and 111 deletions.
316 changes: 214 additions & 102 deletions src/assets/svg/sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/components/swapv2/LimitOrder/LimitOrderForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,11 @@ const LimitOrderForm = function LimitOrderForm({
}
}, [currencyIn?.isNative, currentAllowance, parseInputAmount, parsedActiveOrderMakingAmount])

const [approval, approveCallback] = useApproveCallback(parseInputAmount, limitOrderContract || '', !enoughAllowance)
const [approval, approveCallback] = useApproveCallback(
parseInputAmount,
limitOrderContract || undefined,
!enoughAllowance,
)

const { inputError, outPutError } = useValidateInputError({
inputAmount,
Expand Down
1 change: 1 addition & 0 deletions src/pages/TrueSightV2/components/chart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const CHART_GREEN_COLOR = '#246250'

const LABEL_GAP_BY_TIMEFRAME: { [timeframe: string]: number } = {
[KyberAITimeframe.ONE_DAY]: isMobile ? 4 : 2,
[KyberAITimeframe.THREE_DAY]: isMobile ? 12 : 6,
[KyberAITimeframe.ONE_WEEK]: isMobile ? 2 : 1,
[KyberAITimeframe.ONE_MONTH]: isMobile ? 4 : 2,
[KyberAITimeframe.THREE_MONTHS]: isMobile ? 8 : 4,
Expand Down
12 changes: 10 additions & 2 deletions src/pages/TrueSightV2/pages/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import tokenPriceLightImage from 'assets/images/truesight-v2/landing-page/token-
import tokenPriceImage from 'assets/images/truesight-v2/landing-page/token-price.png'
// import videoPlaceholderImage from 'assets/images/truesight-v2/landing-page/video-placeholder.png'
import sprite from 'assets/svg/kyberAILandingPageSprite.svg'
import { ButtonPrimary } from 'components/Button'
import Column from 'components/Column'
import DownloadWalletModal from 'components/DownloadWalletModal'
import GlobalIcon from 'components/Icons/Icon'
Expand Down Expand Up @@ -411,7 +412,7 @@ export default function KyberAILandingPage() {
/>
</Column>
)}
<Column height="100%" gap="24px" style={{ justifyContent: 'center', zIndex: 2 }}>
<Column height="100%" gap="24px" style={{ justifyContent: 'center', zIndex: 2 }} id="sign-in-form">
<Text fontSize="48px" lineHeight="60px" fontWeight={800}>
<Trans>
Ape Smart with{' '}
Expand Down Expand Up @@ -797,7 +798,14 @@ export default function KyberAILandingPage() {
</Trans>
</Text>
<Row style={{ flex: 1 }}>
<RegisterWhitelist showForm={false} />
<ButtonPrimary
onClick={() => {
const elem = document.getElementById('sign-in-form')
elem?.scrollIntoView({ behavior: 'smooth' })
}}
>
<Trans>Sign in</Trans>
</ButtonPrimary>
</Row>
</Row>
</CallToActionBox>
Expand Down
11 changes: 7 additions & 4 deletions src/pages/TrueSightV2/pages/SingleToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,9 @@ const TokenDescription = ({ description }: { description: string }) => {
const [show, setShow] = useState(true)
const [isTextExceeded, setIsTextExceeded] = useState(false)
const ref = useRef<HTMLDivElement>(null)

useLayoutEffect(() => {
setIsTextExceeded((description && ref.current && ref.current?.clientWidth <= ref.current?.scrollWidth) || false)
setIsTextExceeded((!!description && ref.current && ref.current?.clientWidth <= ref.current?.scrollWidth) || false)
}, [description])

useEffect(() => {
Expand All @@ -206,9 +207,11 @@ const TokenDescription = ({ description }: { description: string }) => {
dangerouslySetInnerHTML={{
__html:
linkify(description) +
`<span style="color:${
theme.primary
}; cursor:pointer; margin-left:4px;" id="hide-token-description-span">${t`Hide`}</span>`,
(isTextExceeded
? `<span style="color:${
theme.primary
}; cursor:pointer; margin-left:4px;" id="hide-token-description-span">${t`Hide`}</span>`
: ''),
}}
/>
{isTextExceeded && !show && (
Expand Down
12 changes: 10 additions & 2 deletions src/pages/TrueSightV2/pages/TokenAnalysisList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -578,14 +578,22 @@ const TokenRow = ({
</td>
<td className={isScrolling ? 'table-cell-shadow-right' : ''}>
<Row gap="8px">
<div style={{ position: 'relative', width: '36px', height: '36px' }}>
<div
style={{
position: 'relative',
width: '36px',
height: '36px',
borderRadius: '50%',
overflow: 'hidden',
}}
>
<img
alt="tokenInList"
src={token.tokens[0].logo}
width="36px"
height="36px"
loading="lazy"
style={{ borderRadius: '18px' }}
style={{ background: 'white' }}
/>
</div>

Expand Down

0 comments on commit ad742c4

Please sign in to comment.