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

Commit

Permalink
fix(storage): fixes visual defects + buggy mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajpiar committed Sep 15, 2021
1 parent ba56302 commit eb3a07a
Show file tree
Hide file tree
Showing 12 changed files with 155 additions and 136 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rif-marketplace-ui",
"version": "1.4.2",
"version": "1.4.3",
"description": "RIF Marketplace provides a digital catalogue with a wide range of decentralised services.",
"keywords": [
"RIF",
Expand Down
9 changes: 6 additions & 3 deletions src/components/molecules/RifAddress.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
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 RifAddressProps extends TypographyProps {
pretext?: string
value: string
disableChecksum?: boolean
}

const RifAddress: FC<RifAddressProps> = ({ pretext, value, ...rest }) => {
const address = shortChecksumAddress(value)
const RifAddress: FC<RifAddressProps> = ({
pretext, value, disableChecksum, ...rest
}) => {
const address = disableChecksum ? shortenString(value) : shortChecksumAddress(value)

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

0 comments on commit eb3a07a

Please sign in to comment.