Skip to content

Commit 232330a

Browse files
committed
Add comments in cost display component
1 parent 14c4b05 commit 232330a

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/components/CostDisplay/CostDisplay.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import styles from './CostDisplay.module.css';
44

5-
const CostDisplay = ({ cost }) => (
5+
const CostDisplay = (
6+
{ cost }, //cost display content
7+
) => (
68
<div className={styles.CostDisplay} data-testid="CostDisplay">
9+
{/*display cost display with specified styles*/}
710
Cost: <span id="cost-value">{cost}</span>
11+
{/*bold the cost numeric value*/}
812
</div>
913
);
1014

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.CostDisplay {
2-
text-align: center;
2+
text-align: center; /*center cost display text component*/
33
}
44
#cost-value {
5-
font-weight: bold;
5+
font-weight: bold; /*bold numeric cost value*/
66
}

src/components/CostDisplay/CostDisplay.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
title: 'CostDisplay',
66
};
77

8-
export const Default = () => <CostDisplay />;
8+
export const Default = () => <CostDisplay />; //default JSX component render
99

1010
Default.story = {
1111
name: 'default',

0 commit comments

Comments
 (0)