Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/express-4.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
redhatua authored Dec 12, 2024
2 parents 18342c6 + 7d619c4 commit 7738517
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 64 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
- run: yarn install --frozen-lockfile
- run: yarn lint
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:

strategy:
matrix:
os: [macos-11, windows-2022, ubuntu-20.04]
os: [macos-latest, windows-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
- run: yarn install --frozen-lockfile
- uses: battila7/get-version-action@v1.2.1
- uses: battila7/get-version-action@v2
id: get_version
- name: Replace version
run: yarn version --no-git-tag-version --new-version ${{ steps.get_version.outputs.version }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Logs help to debug issues when something goes wrong. Make sure to attach all of
## Development

Pre-requisites:
- Node 14 LTS
- Node >=16 LTS
- yarn

1. Install and build the project
Expand Down
3 changes: 0 additions & 3 deletions src/app/payment/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,6 @@ export class PaymentStore {
validateOrderResponse(order: PaymentOrder): void {
switch (this.paymentMethod?.gateway) {
case Gateway.COINGATE:
if (!order.publicGatewayData?.paymentAddress) {
throw new Error("Could not retrieve payment address")
}
if (!order.publicGatewayData?.paymentUrl) {
throw new Error("Could not retrieve payment URL")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { observer } from "mobx-react-lite"
import styled from "styled-components"
import toast from "react-hot-toast"
import { useNavigate } from "react-router-dom"
import { shell } from "electron"

import { useStores } from "../../../../store"
import { BrandButton } from "../../../../ui-kit/components/Button/BrandButton"
Expand Down Expand Up @@ -59,8 +60,11 @@ export const CoingateOrderSummary: React.FC = observer(() => {
const handleNextClick = async () => {
setLoading(() => true)
try {
await payment.openOrderSecureForm()
if (!payment.order?.publicGatewayData?.paymentUrl) {
return
}
setLoading(() => false)
shell.openExternal(payment.order.publicGatewayData.paymentUrl)
navigate("../" + topupSteps.coingateWaitingForPayment)
} catch (err) {
setLoading(() => false)
Expand Down
66 changes: 15 additions & 51 deletions src/app/views/consumer/Topup/coingate/CoingateWaitingForPayment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import React, { useEffect } from "react"
import { observer } from "mobx-react-lite"
import styled from "styled-components"
import { shell } from "electron"
import CountDown from "react-countdown"
import { useNavigate } from "react-router-dom"

Expand All @@ -20,11 +19,10 @@ import { ViewContent } from "../../../../navigation/components/ViewContent/ViewC
import { IconWallet } from "../../../../ui-kit/icons/IconWallet"
import { Heading2, Paragraph, Small } from "../../../../ui-kit/typography"
import { brand, brandLight } from "../../../../ui-kit/colors"
import { Anchor } from "../../../../ui-kit/components/Anchor"
import { QR } from "../../../../ui-kit/components/QR/QR"
import { OrderStatus } from "../../../../payment/store"
import { topupSteps } from "../../../../navigation/locations"
import { StepProgressBar } from "../../../../ui-kit/components/StepProgressBar/StepProgressBar"
import { Spinner } from "../../../../ui-kit/components/Spinner/Spinner"
import { OrderBreakdown } from "../common/OrderBreakdown"

import { LogoCoingate } from "./LogoCoingate"
Expand Down Expand Up @@ -77,32 +75,8 @@ const PaymentAmount = styled.div`
user-select: text;
`

const PaymentQR = styled.div`
background: #fff;
padding: 5px;
margin-bottom: 15px;
`

const PaymentAddress = styled.div`
overflow-wrap: anywhere;
overflow-y: scroll;
user-select: text;
opacity: 0.7;
max-height: 60px;
border: 1px solid #ffffff99;
border-radius: 5px;
padding: 10px;
`

const PaymentWarning = styled(Small)`
margin: 5px 0;
max-height: 60px;
overflow-y: scroll;
text-overflow: ellipsis;
`

const PaymentExplanation = styled(Paragraph)`
margin-top: auto;
margin-bottom: auto;
`

const LogoContainer = styled.div`
Expand All @@ -113,14 +87,14 @@ const LogoContainer = styled.div`
overflow: hidden;
`

const Loading = styled(Spinner)`
margin: auto;
`

export const CoingateWaitingForPayment: React.FC = observer(() => {
const { payment } = useStores()
const navigate = useNavigate()
const onPayInBrowserClick = () => {
if (payment.order?.publicGatewayData?.paymentUrl) {
shell.openExternal(payment.order?.publicGatewayData.paymentUrl)
}
}

useEffect(() => {
switch (payment.orderStatus) {
case OrderStatus.SUCCESS:
Expand All @@ -131,6 +105,7 @@ export const CoingateWaitingForPayment: React.FC = observer(() => {
break
}
}, [payment.orderStatus])

return (
<ViewContainer>
<ViewNavBar onBack={() => navigate(-1)}>
Expand All @@ -145,7 +120,7 @@ export const CoingateWaitingForPayment: React.FC = observer(() => {
<IconWallet color={brandLight} />
</TitleIcon>
<Title>Waiting for payment</Title>
<TitleDescription>Scan QR code or use a payment link below</TitleDescription>
<TitleDescription>Complete payment transaction in the browser</TitleDescription>
</SideTop>
<SideBot>
<OrderBreakdown />
Expand All @@ -156,8 +131,8 @@ export const CoingateWaitingForPayment: React.FC = observer(() => {
</SideBot>
</ViewSidebar>
<Content>
<PaymentCountDown>
{payment.orderExpiresAt ? (
{payment.orderExpiresAt && (
<PaymentCountDown>
<CountDown
date={payment.orderExpiresAt}
renderer={(props) => (
Expand All @@ -167,26 +142,15 @@ export const CoingateWaitingForPayment: React.FC = observer(() => {
</div>
)}
/>
) : (
<span>— : —</span>
)}
</PaymentCountDown>
</PaymentCountDown>
)}
<PaymentAmount>
<Heading2>
{payment.order?.payAmount} {payment.order?.payCurrency}
</Heading2>
</PaymentAmount>
<PaymentQR>
<QR size={168} text={payment.order?.publicGatewayData?.paymentAddress} />
</PaymentQR>
<PaymentAddress>{payment.order?.publicGatewayData?.paymentAddress}</PaymentAddress>
<PaymentWarning>
This address is for {payment.order?.payCurrency ?? "—"} (ERC20) deposits only. Do not send any
other cryptocurrency or {payment.order?.payCurrency ?? "—"} from any other chains, such as
Binance Chain (BEP-2/BSC) or your deposit will be lost.
</PaymentWarning>
<PaymentExplanation>Send the indicated amount to the address above.</PaymentExplanation>
<Anchor onClick={onPayInBrowserClick}>Pay in browser instead?</Anchor>
<Loading />
<PaymentExplanation>Waiting for payment...</PaymentExplanation>
</Content>
</ViewSplit>
</ViewContainer>
Expand Down

0 comments on commit 7738517

Please sign in to comment.