Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

chore(backport): fix(storage): fixes visual defects + buggy mapping #976

Open
wants to merge 1 commit into
base: mainnet
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "rif-marketplace-ui",
<<<<<<< HEAD
"version": "1.3.5",
=======
"version": "1.4.3",
>>>>>>> 4393fc1 (fix(storage): fixes visual defects + buggy mapping)
"description": "RIF Marketplace provides a digital catalogue with a wide range of decentralised services.",
"keywords": [
"RIF",
Expand Down
10 changes: 9 additions & 1 deletion src/components/molecules/RifAddress.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
import Typography, { TypographyProps } from '@material-ui/core/Typography'
import { CopyTextTooltip } from '@rsksmart/rif-ui'
import { CopyTextTooltip, shortenString } from '@rsksmart/rif-ui'
import React, { FC } from 'react'
import { shortChecksumAddress } from 'utils/stringUtils'

export interface AddressItemProps extends TypographyProps {
pretext?: string
value: string
disableChecksum?: boolean
}

<<<<<<< HEAD
const RifAddress: FC<AddressItemProps> = ({ pretext, value, ...rest }) => {
const address = shortChecksumAddress(value)
=======
const RifAddress: FC<RifAddressProps> = ({
pretext, value, disableChecksum, ...rest
}) => {
const address = disableChecksum ? shortenString(value) : shortChecksumAddress(value)
>>>>>>> 4393fc1 (fix(storage): fixes visual defects + buggy mapping)

const displayElement = (
<Typography {...rest}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export {
CombinedPriceCell,
IconedItem,
ReturnButton,
RifAddress as AddressItem,
RifAddress,
JobDoneBox,
SelectRowButton,
}
4 changes: 2 additions & 2 deletions src/components/organisms/rns/sell/MyDomains.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AddressItem, SelectRowButton } from 'components/molecules'
import { RifAddress, SelectRowButton } from 'components/molecules'
import DomainFilters from 'components/organisms/filters/DomainFilters'
import MarketPageTemplate from 'components/templates/MarketPageTemplate'
import { RnsDomain } from 'models/marketItems/DomainItem'
Expand Down Expand Up @@ -70,7 +70,7 @@ const MyDomains: FC = () => {
maxLength={30}
/>
)
: <AddressItem pretext="Unknown RNS:" value={tokenId} />
: <RifAddress pretext="Unknown RNS:" value={tokenId} />

const isProcessingConfs = pendingConfs.some(
({ contractActionData }) => (
Expand Down
4 changes: 2 additions & 2 deletions src/components/organisms/rns/sell/MyOffers.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import IconButton from '@material-ui/core/IconButton'
import ClearIcon from '@material-ui/icons/Clear'
import { AddressItem, CombinedPriceCell, SelectRowButton } from 'components/molecules'
import { RifAddress, CombinedPriceCell, SelectRowButton } from 'components/molecules'
import DomainFilters from 'components/organisms/filters/DomainFilters'
import MarketPageTemplate from 'components/templates/MarketPageTemplate'
import { RnsDomain } from 'models/marketItems/DomainItem'
Expand Down Expand Up @@ -76,7 +76,7 @@ const MyOffers: FC = () => {
maxLength={30}
/>
)
: <AddressItem pretext="Unknown RNS:" value={tokenId} />
: <RifAddress pretext="Unknown RNS:" value={tokenId} />

const isProcessingConfs = pendingConfs.some(
({ contractActionData }) => (
Expand Down
6 changes: 3 additions & 3 deletions src/components/organisms/rns/sell/SoldDomains.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AddressItem, CombinedPriceCell } from 'components/molecules'
import { RifAddress, CombinedPriceCell } from 'components/molecules'
import DomainFilters from 'components/organisms/filters/DomainFilters'
import MarketPageTemplate from 'components/templates/MarketPageTemplate'
import { RnsSoldDomain } from 'models/marketItems/DomainItem'
Expand Down Expand Up @@ -52,12 +52,12 @@ const SoldDomains: FC<{}> = () => {
const pseudoResolvedName = name && `${name}.rsk`
const displayDomainName = domainName || pseudoResolvedName
? <ShortenTextTooltip value={domainName || pseudoResolvedName as string} maxLength={30} />
: <AddressItem pretext="Unknown RNS:" value={tokenId} />
: <RifAddress pretext="Unknown RNS:" value={tokenId} />

const displayItem = {
id,
domainName: displayDomainName,
buyer: <AddressItem value={buyer} />,
buyer: <RifAddress value={buyer} />,
currency: displayName,
sellingPrice: <CombinedPriceCell
price={price.toString()}
Expand Down
13 changes: 9 additions & 4 deletions src/components/organisms/storage/agreements/DetailsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from '@rsksmart/rif-ui'
/* eslint-disable-next-line import/no-unresolved */
import { ModalProps } from '@rsksmart/rif-ui/dist/components/atoms/modal/Modal'
import GridColumn from 'components/atoms/GridColumn'
import GridItem from 'components/atoms/GridItem'
import RifCard from 'components/organisms/RifCard'
import { AgreementCustomerView, AgreementProviderView } from 'components/organisms/storage/agreements/utils'
Expand Down Expand Up @@ -35,7 +34,9 @@ const useModalStyles = makeStyles((theme: Theme) => ({
},
}))

const DetailsModal: FC<DetailsModalProps> = ({ modalProps, itemDetails, actions }) => {
const DetailsModal: FC<DetailsModalProps> = ({
modalProps, itemDetails, actions,
}) => {
const modalCardStyleClasses = useModalStyles()
return (
<Modal
Expand All @@ -55,8 +56,11 @@ const DetailsModal: FC<DetailsModalProps> = ({ modalProps, itemDetails, actions
<ModalHeader className={modalCardStyleClasses.modalWidth}>
<ModalTitle>{itemDetails?.title}</ModalTitle>
</ModalHeader>
<GridColumn
<Grid
container
spacing={2}
wrap="nowrap"
direction="column"
className={modalCardStyleClasses.itemDetails}
>
{itemDetails ? Object.keys(itemDetails)
Expand All @@ -68,6 +72,7 @@ const DetailsModal: FC<DetailsModalProps> = ({ modalProps, itemDetails, actions
container
direction="row"
spacing={6}
wrap="nowrap"
xs={12}
>
<GridItem
Expand All @@ -84,7 +89,7 @@ const DetailsModal: FC<DetailsModalProps> = ({ modalProps, itemDetails, actions
<GridItem xs={6}>{itemDetails[key]}</GridItem>
</Grid>
)) : ''}
</GridColumn>
</Grid>
</RifCard>
</ModalBody>
</>
Expand Down
Loading