summaryrefslogtreecommitdiffstats
path: root/web/react/components/access_history_modal.jsx
diff options
context:
space:
mode:
authornickago <ngonella@calpoly.edu>2015-08-14 09:09:39 -0700
committernickago <ngonella@calpoly.edu>2015-08-14 09:09:39 -0700
commit5c1bead36ac59ed62aeab97fc49ad2e6a9df458b (patch)
treec9fb5cdc1271106e6e114ca056a81c50b8156680 /web/react/components/access_history_modal.jsx
parentda4618013134e484f84ecd9e05e825e4a6d51f3d (diff)
downloadchat-5c1bead36ac59ed62aeab97fc49ad2e6a9df458b.tar.gz
chat-5c1bead36ac59ed62aeab97fc49ad2e6a9df458b.tar.bz2
chat-5c1bead36ac59ed62aeab97fc49ad2e6a9df458b.zip
cosmetic refactoring
Diffstat (limited to 'web/react/components/access_history_modal.jsx')
-rw-r--r--web/react/components/access_history_modal.jsx26
1 files changed, 14 insertions, 12 deletions
diff --git a/web/react/components/access_history_modal.jsx b/web/react/components/access_history_modal.jsx
index 678113a47..59c3384df 100644
--- a/web/react/components/access_history_modal.jsx
+++ b/web/react/components/access_history_modal.jsx
@@ -73,6 +73,11 @@ module.exports = React.createClass({
);
}
+ var divider = null;
+ if (i < this.state.audits.length - 1) {
+ divider = (<div className='divider-light'></div>)
+ }
+
accessList[i] = (
<div className='access-history__table'>
<div className='access__date'>{newDate}</div>
@@ -82,16 +87,19 @@ module.exports = React.createClass({
<div>{'IP: ' + currentAudit.ip_address}</div>
{moreInfo}
</div>
- {i < this.state.audits.length - 1 ?
- <div className='divider-light'/>
- :
- null
- }
+ {divider}
</div>
</div>
);
}
+ var content;
+ if (this.state.audits.loading) {
+ content = (<LoadingScreen />);
+ } else {
+ content = (<form role='form'>{accessList}</form>);
+ }
+
return (
<div>
<div className='modal fade' ref='modal' id='access-history' tabIndex='-1' role='dialog' aria-hidden='true'>
@@ -102,13 +110,7 @@ module.exports = React.createClass({
<h4 className='modal-title' id='myModalLabel'>Access History</h4>
</div>
<div ref='modalBody' className='modal-body'>
- {!this.state.audits.loading ?
- <form role='form'>
- {accessList}
- </form>
- :
- <LoadingScreen />
- }
+ {content}
</div>
</div>
</div>