-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5240 from reactioncommerce/feat-kieckhafer-update…
…ReadOnlyOrderWithSidebar refactor: update styling of orderCard header section, move details to sidebar
- Loading branch information
Showing
5 changed files
with
205 additions
and
171 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
imports/plugins/core/orders/client/components/OrderCardCustomerDetails.js
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,53 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import Card from "@material-ui/core/Card"; | ||
import CardContent from "@material-ui/core/CardContent"; | ||
import CardHeader from "@material-ui/core/CardHeader"; | ||
import Grid from "@material-ui/core/Grid"; | ||
import Typography from "@material-ui/core/Typography"; | ||
|
||
|
||
/** | ||
* @name OrderCardCustomerDetails | ||
* @params {Object} props Component props | ||
* @returns {React.Component} returns a React component | ||
*/ | ||
function OrderCardCustomerDetails({ order }) { | ||
const { email, fulfillmentGroups } = order; | ||
const { shippingAddress: { fullName, phone } } = fulfillmentGroups[0].data; | ||
|
||
return ( | ||
<Card> | ||
<CardHeader | ||
title="Customer information" | ||
/> | ||
<CardContent> | ||
<Grid container spacing={24}> | ||
<Grid item xs={12} md={12}> | ||
<Typography variant="h4"> | ||
{fullName} | ||
</Typography> | ||
</Grid> | ||
<Grid item xs={12} md={12}> | ||
<Typography variant="body1">{email}</Typography> | ||
<Typography variant="body1">{phone}</Typography> | ||
</Grid> | ||
</Grid> | ||
</CardContent> | ||
</Card> | ||
); | ||
} | ||
|
||
OrderCardCustomerDetails.propTypes = { | ||
order: PropTypes.shape({ | ||
email: PropTypes.string, | ||
fulfillmentGroups: PropTypes.arrayOf(PropTypes.shape({ | ||
shippingAddress: PropTypes.shape({ | ||
fullName: PropTypes.string, | ||
phone: PropTypes.string | ||
}) | ||
})) | ||
}) | ||
}; | ||
|
||
export default OrderCardCustomerDetails; |
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
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
Oops, something went wrong.