This repository has been archived by the owner on Aug 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(storage): extracts offers checkout state
to its own context squash: splits context state
- Loading branch information
Showing
6 changed files
with
524 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
src/components/organisms/storage/buy/StorageOfferDescription.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import { Box, Typography } from '@material-ui/core' | ||
import { shortenString } from '@rsksmart/rif-ui' | ||
import GridItem from 'components/atoms/GridItem' | ||
import GridRow from 'components/atoms/GridRow' | ||
import LabelWithValue from 'components/atoms/LabelWithValue' | ||
import { Order, PinnedContent } from 'components/pages/storage/buy/CheckoutContext' | ||
import React, { FC } from 'react' | ||
|
||
type Props = Order & PinnedContent | ||
|
||
const StorageOrderDescription: FC<{order: Props}> = ({ order }) => { | ||
const { | ||
name: contentName, | ||
size: contentSize, | ||
hash: contentHash, | ||
id, | ||
system, | ||
} = order | ||
|
||
return ( | ||
<GridItem> | ||
<GridRow> | ||
<GridItem> | ||
<Typography | ||
variant="subtitle1" | ||
color="primary" | ||
> | ||
Selected storage provider | ||
</Typography> | ||
</GridItem> | ||
<GridItem> | ||
<LabelWithValue | ||
label="" | ||
value={shortenString(id)} | ||
/> | ||
</GridItem> | ||
<GridItem> | ||
<LabelWithValue | ||
label="System" | ||
value={system} | ||
/> | ||
</GridItem> | ||
</GridRow> | ||
{contentHash && contentSize && contentName | ||
? ( | ||
<GridRow> | ||
<GridItem> | ||
<Typography | ||
variant="subtitle1" | ||
color="primary" | ||
> | ||
Uploaded content | ||
</Typography> | ||
</GridItem> | ||
<GridItem> | ||
<LabelWithValue | ||
label="Name:" | ||
value={contentName} | ||
/> | ||
</GridItem> | ||
<GridItem> | ||
<LabelWithValue | ||
label="Hash:" | ||
value={shortenString(contentHash)} | ||
/> | ||
</GridItem> | ||
<GridItem> | ||
<LabelWithValue | ||
label="Size:" | ||
value={contentSize} | ||
/> | ||
</GridItem> | ||
</GridRow> | ||
) | ||
: ( | ||
<GridRow> | ||
<GridItem> | ||
<Typography color="textPrimary" component="div"> | ||
<Box display="inline" fontWeight="fontWeightMedium"> | ||
The size of your storage plan is calculated by the content that you upload/persist in this first step. | ||
</Box> | ||
</Typography> | ||
</GridItem> | ||
</GridRow> | ||
)} | ||
</GridItem> | ||
) | ||
} | ||
|
||
export default StorageOrderDescription |
Oops, something went wrong.