Skip to content

Commit

Permalink
fix: use tables for tabular data and add table styles
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikThePendric committed Sep 17, 2020
1 parent 775f3c8 commit a140b9d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/aboutPage/AboutSection.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const AboutSection = ({ header, attributes }) => (
<InfoHeader text={header} />
<Card style={styles.card}>
<CardText>
<div className="info-content">
<table className="info-content">
{attributes.map(({ label, value }) => (
<InfoItem
key={label}
Expand All @@ -30,7 +30,7 @@ const AboutSection = ({ header, attributes }) => (
}
/>
))}
</div>
</table>
</CardText>
</Card>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/layout/InfoCard.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ class InfoCard extends Component {
return (
<Card style={styles.card}>
<CardText>
<div className="info-content">
<table className="info-content">
{this.getLabelComponents(labelNames)}
</div>
</table>
</CardText>
</Card>
);
Expand Down
8 changes: 4 additions & 4 deletions src/layout/InfoItem.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';
import PropTypes from 'prop-types';

const InfoItem = ({ label, value, labelStyle }) => (
<div className="label-row">
<span className="label-name" style={labelStyle}>{label}</span>
<span className="label-value">{value}</span>
</div>
<tr className="label-row">
<td className="label-name" style={labelStyle}>{label}</td>
<td className="label-value">{value}</td>
</tr>
);

InfoItem.propTypes = {
Expand Down
14 changes: 4 additions & 10 deletions src/layout/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,21 @@ html, body {
margin-bottom: 64px;
}

.label-row {
display: flex;
padding: 4px 0px;
flex-direction: row;
justify-content: space-between;
.info-content {
width: 100%;
margin: 0;
}

.label-name {
display: inline-block;
flex: 1;
color: #777;
font-size: 12pt;
width: 110px;
text-align: right;
padding-right: 20px;
white-space: nowrap;
vertical-align: top;
}

.label-value {
display: inline-block;
flex: 2;
font-size: 12pt;
max-width: 510px;
}

0 comments on commit a140b9d

Please sign in to comment.