style: cleanup empty fields

This commit is contained in:
Carlos Valente
2021-07-28 14:37:46 +02:00
parent f65748b5de
commit 39a7699de3
2 changed files with 35 additions and 7 deletions
+17 -3
View File
@@ -19,16 +19,30 @@
padding: 0;
margin: 0;
font-size: 0.9em;
color: #aaa;
color: #ccc;
display: flex;
justify-content: space-between;
}
.label {
.label,
.emptyLabel {
padding: 0;
margin: 0;
font-size: 0.9em;
color: #ccc;
}
.label {
font-size: 0.9em;
color: #aaa;
}
.label::after {
content: ': ';
}
.emptyLabel {
font-size: 0.8em;
color: #555;
}
.notes {
+18 -4
View File
@@ -7,6 +7,12 @@ export default function InfoTitle(props) {
const [collapsed, setCollapsed] = useState(false);
const { title, data } = props;
const noTitl = data.title == null || data.title === '';
const noPres = data.presenter == null || data.presenter === '';
const noSubt = data.subtitle == null || data.subtitle === '';
const noNote = data.note == null || data.note === '';
return (
<div className={style.container}>
<div className={style.header}>
@@ -21,19 +27,27 @@ export default function InfoTitle(props) {
{!collapsed && (
<>
<div>
<span className={style.label}>Title: </span>
<span className={noTitl ? style.emptyLabel : style.label}>
Title
</span>
{data.title}
</div>
<div>
<span className={style.label}>Presenter: </span>
<span className={noPres ? style.emptyLabel : style.label}>
Presenter
</span>
{data.presenter}
</div>
<div>
<span className={style.label}>Subtitle: </span>
<span className={noSubt ? style.emptyLabel : style.label}>
Subtitle
</span>
{data.subtitle}
</div>
<div className={style.notes}>
<span className={style.label}>Note: </span>
<span className={noNote ? style.emptyLabel : style.label}>
Note
</span>
{data.note}
</div>
</>