Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.

Commit

Permalink
feat(item entry): add error text for invalid items
Browse files Browse the repository at this point in the history
  • Loading branch information
tnoelcke committed Oct 15, 2018
1 parent 06d8512 commit 17d98f6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Assets/Styles/item-bank.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
height: 100%;
}

.error-text {
font-size: 14px;
color: red;
}

.item-map-iframe {
flex-grow: 1;
padding: 0 0 0 @spacing-unit;
Expand Down
12 changes: 12 additions & 0 deletions src/ItemEntryTable/ItemEntryRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,17 @@ export class ItemEntryRow extends React.Component<
);
}

renderError() {
let errorElement: JSX.Element;
if (this.props.row.valid !== undefined || this.props.row.valid) {
errorElement = <td className="error-text">Item Not Found</td>;
} else {
errorElement = <td />;
}

return errorElement;
}

render() {
const { editRow } = this.state;

Expand All @@ -236,6 +247,7 @@ export class ItemEntryRow extends React.Component<
)}
{this.renderRowSection(editRow)}
{this.renderDeleteButton()}
{this.renderError()}
</tr>
);
}
Expand Down

0 comments on commit 17d98f6

Please sign in to comment.