Skip to content

Commit

Permalink
Merge pull request #120 from dappforce/deploy/transfer-page
Browse files Browse the repository at this point in the history
Add transfer page
  • Loading branch information
olehmell authored Dec 20, 2023
2 parents 83afa44 + 26d1dba commit 046a330
Show file tree
Hide file tree
Showing 48 changed files with 1,196 additions and 409 deletions.
50 changes: 23 additions & 27 deletions public/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -934,24 +934,24 @@ video {
width: 100%;
}

.w-screen {
width: 100vw;
}

.w-\[260px\] {
width: 260px;
}

.w-max {
width: -moz-max-content;
width: max-content;
}

.w-screen {
width: 100vw;
}

.min-w-fit {
min-width: -moz-fit-content;
min-width: fit-content;
}

.max-w-\[260px\] {
max-width: 260px;
}

.max-w-\[min\(24rem\2c _95vw\)\] {
max-width: min(24rem, 95vw);
}
Expand Down Expand Up @@ -980,10 +980,6 @@ video {
max-width: 24rem;
}

.max-w-\[260px\] {
max-width: 260px;
}

.flex-shrink-0 {
flex-shrink: 0;
}
Expand Down Expand Up @@ -1522,6 +1518,11 @@ video {
padding: 4px;
}

.\!px-4 {
padding-left: 1rem !important;
padding-right: 1rem !important;
}

.\!py-4 {
padding-top: 1rem !important;
padding-bottom: 1rem !important;
Expand Down Expand Up @@ -1602,11 +1603,6 @@ video {
padding-bottom: 1.25rem;
}

.\!px-4 {
padding-left: 1rem !important;
padding-right: 1rem !important;
}

.pb-0 {
padding-bottom: 0px;
}
Expand Down Expand Up @@ -1848,6 +1844,11 @@ video {
color: rgb(0 0 0 / var(--tw-text-opacity));
}

.text-blue-400 {
--tw-text-opacity: 1;
color: rgb(96 165 250 / var(--tw-text-opacity));
}

.text-current {
color: currentColor;
}
Expand Down Expand Up @@ -1913,11 +1914,6 @@ video {
color: rgb(255 255 255 / 0.8);
}

.text-blue-400 {
--tw-text-opacity: 1;
color: rgb(96 165 250 / var(--tw-text-opacity));
}

.opacity-0 {
opacity: 0;
}
Expand Down Expand Up @@ -2451,6 +2447,11 @@ video {
padding: 1.5rem;
}

.md\:\!px-6 {
padding-left: 1.5rem !important;
padding-right: 1.5rem !important;
}

.md\:px-6 {
padding-left: 1.5rem;
padding-right: 1.5rem;
Expand All @@ -2461,11 +2462,6 @@ video {
padding-bottom: 1.5rem;
}

.md\:\!px-6 {
padding-left: 1.5rem !important;
padding-right: 1.5rem !important;
}

.md\:text-left {
text-align: left;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/creatorsStaking/Creators/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const CreatorsSection = ({ defaultSpaceId }: CreatorsSectionProps) => {
useFetchCreatorsSpaces(creatorsSpaceIds)
useFetchEraStakes(creatorsSpaceIds, currentEra)
useFetchBackerInfoBySpaces(creatorsSpaceIds, myAddress)
useFetchBalanceByNetwork('subsocial', myAddress)
useFetchBalanceByNetwork({ network: 'subsocial', address: myAddress })

return (
<ModalContextWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const StakeOrIncreaseStakeAmountInput = (

const { minimumStakingAmount, minimumRemainingAmount } = stakingConsts || {}

const balancesByCurrency = useBalancesByNetwork({
const { currencyBalance: balancesByCurrency } = useBalancesByNetwork({
address: myAddress,
network: 'subsocial',
currency: tokenSymbol,
Expand Down Expand Up @@ -225,9 +225,9 @@ export const AmountInput = ({
}

useEffect(() => {
if(inputRef.current) {
if (inputRef.current) {
inputRef.current.focus()
}
}
}, [])

return (
Expand Down
4 changes: 3 additions & 1 deletion src/components/creatorsStaking/Creators/modals/TxButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ function StakingTxButton ({
fetchGeneralEraInfo(dispatch)
fetchEraStakes(dispatch, [ spaceId ], eraInfo?.info?.currentEra || '0')

fetchEraStakes(dispatch, [ spaceId ], eraInfo?.info?.currentEra || '0')

fetchBackerLedger(dispatch, myAddress || '')

if (modalVariant === 'stake') {
Expand Down Expand Up @@ -129,7 +131,7 @@ export function StakeOrIncreaseTxButton (props: CommonTxButtonProps) {
const sendEvent = useSendEvent()
const { decimal } = useGetDecimalsAndSymbolByNetwork('subsocial')

const balancesByCurrency = useBalancesByNetwork({
const { currencyBalance: balancesByCurrency } = useBalancesByNetwork({
address: myAddress,
network: 'subsocial',
currency: props.tokenSymbol,
Expand Down
10 changes: 9 additions & 1 deletion src/components/main/Main.module.sass
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
\:global .DfSectionOuter
max-width: calc(1088px + #{$space_normal} * 2) !important

.TransferPage
\:global .DfSectionOuter
max-width: 632px !important
height: 100%

\:global .DfSection
height: 100%

.WarningMessage
display: flex
background: #fff
Expand All @@ -27,4 +35,4 @@
@media (max-width: 767px)
.CreatorStakingSection
\:global .DfSection
margin-top: 0 !important
margin-top: 0 !important
41 changes: 41 additions & 0 deletions src/components/main/TransferPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react'
import { NextPage } from 'next'
import TransferPageLayout from '../transfer/TransferPageLayout'
import { PageContent } from '../utils/PageWrapper'
import clsx from 'clsx'
import Footer from '../footer/Footer'
import styles from './Main.module.sass'

type TransferPageProps = {
transferType?: string
asset?: string
from?: string
to?: string
recipient?: string
amount?: string
}

const TransferPage: NextPage<TransferPageProps> = (props) => {
const { transferType, asset, from, to, recipient, amount } = props

return (
<>
<div className={clsx('layout-wrapper', styles.TransferPage)}>
<PageContent>
<TransferPageLayout
transferType={
transferType === 'cross' ? 'cross-chain' : 'same-chain'
}
defaultSelectedToken={{ token: asset || 'DOT', network: from }}
to={to}
defaultRecipient={recipient}
amount={amount}
/>
</PageContent>
</div>
<Footer />
</>
)
}

export default TransferPage
Loading

0 comments on commit 046a330

Please sign in to comment.