Skip to content

Commit

Permalink
feat: move coordinates source to graph (#2046)
Browse files Browse the repository at this point in the history
  • Loading branch information
meelrossi committed Nov 3, 2023
1 parent 415f59c commit 5ea5bba
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ const EstateDetail = ({ nft, order, rental }: Props) => {
below={
<>
<BidList nft={nft} />
{estate.size > 0 && <ParcelCoordinates estateId={nft.tokenId} />}
{estate.size > 0 && (
<ParcelCoordinates
parcelCoordinates={nft.data.estate?.parcels || []}
total={nft.data.estate?.size || 0}
/>
)}
<TransactionHistory asset={nft} />
<RentalHistory asset={nft} />
</>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
.ParcelCoordinates {
margin-top: 48px;
}

.coordinates {
display: grid;
justify-content: space-between;
gap: 6px;
grid-template-columns: repeat(auto-fill, 110px);
margin-top: 13px;
overflow: hidden;
}

Expand All @@ -27,10 +31,16 @@
}

.coordinate {
margin: 6px;
cursor: pointer !important;
}

.moreText {
font-size: 12px;
display: flex;
align-items: center;
gap: 4px;
}

.showMore {
margin-top: 15px;
justify-content: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import { Props } from './ParcelCoordinates.types'
import styles from './ParcelCoordinates.module.css'

const ParcelCoordinates = (props: Props) => {
const { parcelCoordinates } = props
const { parcelCoordinates, total } = props

return (
<div className={styles.ParcelCoordinates}>
<Header sub>{t('parcel_coordinates.title')}</Header>
<Collapsible collapsedHeight={60}>
<Collapsible collapsedHeight={35}>
<Row className={styles.coordinates}>
{parcelCoordinates.map((parcel, index) => (
<Link
Expand All @@ -30,6 +30,14 @@ const ParcelCoordinates = (props: Props) => {
/>
</Link>
))}
{parcelCoordinates.length < total ? (
<span className={styles.moreText}>
{t('parcel_coordinates.and_more', {
amount: total - parcelCoordinates.length,
strong: (text: string) => <strong>{text}</strong>
})}
</span>
) : null}
</Row>
</Collapsible>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { Tile } from '../../../Atlas/Atlas.types'

export type Props = {
estateId: string
parcelCoordinates: Tile[]
parcelCoordinates: { x: number; y: number }[]
total: number
}

export type OwnProps = Pick<Props, 'estateId'>

export type MapStateProps = Pick<Props, 'parcelCoordinates'>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import ParcelCoordinates from './ParcelCoordinates.container'
import ParcelCoordinates from './ParcelCoordinates'
export { ParcelCoordinates }
3 changes: 2 additions & 1 deletion webapp/src/modules/translation/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,8 @@
"parcel_coordinates": {
"title": "Parcels",
"show_more": "SHOW MORE",
"show_less": "SHOW LESS"
"show_less": "SHOW LESS",
"and_more": "and <strong>{amount}</strong> more..."
},
"price_change_notice": {
"message": "The price may fluctuate due to market changes"
Expand Down
3 changes: 2 additions & 1 deletion webapp/src/modules/translation/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,8 @@
"parcel_coordinates": {
"title": "Parcelas",
"show_more": "MOSTRAR MÁS",
"show_less": "MOSTRAR MENOS"
"show_less": "MOSTRAR MENOS",
"and_more": "y <strong>{amount}</strong> más..."
},
"price_change_notice": {
"message": "El precio puede variar debido a cambios en el mercado"
Expand Down
3 changes: 2 additions & 1 deletion webapp/src/modules/translation/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,8 @@
"parcel_coordinates": {
"title": "地块",
"show_more": "展示更多",
"show_less": "显示较少"
"show_less": "显示较少",
"and_more": "和 <strong>{amount}</strong> 更多的..."
},
"price_change_notice": {
"message": "价格或因市场变化而波动"
Expand Down

0 comments on commit 5ea5bba

Please sign in to comment.