From cd58a830b59c8447d403e00c577b93d885ff0dd0 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sat, 21 Oct 2017 00:11:53 +0200 Subject: [PATCH] Together with sidebar this loads the info of the selected request item on the admin page. --- .../app/components/admin/AdminRequestInfo.jsx | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 client/app/components/admin/AdminRequestInfo.jsx diff --git a/client/app/components/admin/AdminRequestInfo.jsx b/client/app/components/admin/AdminRequestInfo.jsx new file mode 100644 index 0000000..fa7c36e --- /dev/null +++ b/client/app/components/admin/AdminRequestInfo.jsx @@ -0,0 +1,69 @@ +import React, { Component } from 'react'; + +class AdminRequestInfo extends Component { + + constructor() { + super(); + } + + userAgent(agent) { + if (agent) { + try { + return agent.split(" ")[1].replace(/[\(\;]/g, ''); + } + catch(e) { + return agent; + } + } + return ''; + } + + displayInfo() { + let adminIndexStyle = { + wrapper: { + width: '100%', + }, + headerWrapper: { + width: '100%', + }, + poster: { + float: 'left', + minHeight: '450px', + }, + info: { + float: 'left', + minHeight: '450px', + } + } + const request = this.props.display; + + if (request) { + return ( +
+
+ {request.name} + {request.year} +
+
+ +
+
+ type: {request.type}
+ status: {request.status}
+ ip: {request.ip}
+ user_agent: {this.userAgent(request.user_agent)}
+ request_date: {request.requested_date}
+
+
+ ) + } + } + + render() { + return ( +
{this.displayInfo()}
+ ); + } +} + +export default AdminRequestInfo; \ No newline at end of file