From e3635ad35e71cb50d197080ed17dd93ccfa01d14 Mon Sep 17 00:00:00 2001
From: rlacko <rlacko@sch.bme.hu>
Date: Thu, 13 Feb 2020 11:27:25 +0100
Subject: [PATCH] added group choices to applicant profile

---
 src/components/pages/ApplicantProfile.js | 37 ++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/src/components/pages/ApplicantProfile.js b/src/components/pages/ApplicantProfile.js
index e8614de..3a6d641 100644
--- a/src/components/pages/ApplicantProfile.js
+++ b/src/components/pages/ApplicantProfile.js
@@ -4,21 +4,53 @@ import { connect } from 'react-redux';
 import { getSelectedProfile, setStatus } from '../../actions/statistics';
 import ConfirmModal from '../forms/ConfirmModal';
 
+const groupTypes = {
+  HAT: {
+    name: 'HallgatĂłi TudĂĄsbĂĄzis',
+    color: 'purple',
+  },
+  SYS: {
+    name: 'Sysadmin',
+    color: 'violet',
+  },
+  NET: {
+    name: 'NETeam',
+    color: 'blue',
+  },
+  ST: {
+    name: 'SecurITeam',
+    color: 'teal',
+  },
+  DT: {
+    name: 'DevTeam',
+    color: 'green',
+  },
+};
+
 class ApplicantProfile extends Component {
   UNSAFE_componentWillMount() {
     this.props.getSelectedProfile(this.props.match.params.id);
   }
 
   render() {
-    const { id, signed, role, full_name, nick, motivation_about, motivation_exercise, motivation_profession }
+    const { id, signed, role, full_name, 
+      nick, motivation_about, motivation_exercise, 
+      motivation_profession, groups }
     = this.props.selectedProfile;
     return (
       <Container style={{ paddingTop: '3em', paddingBottom: '6em' }}>
         <Item>
           <Item.Content>
-            <Container textAlign='center'>
+            <Container textAlign='center' style={{paddingBottom: '2em'}}>
               <Header as='h2'>{full_name}</Header>
               <Item.Meta>{nick}</Item.Meta>
+              <Header as='h2'>{groups?.map(group => {
+                return (
+                <Label color={groupTypes[group].color}>
+                  {groupTypes[group].name}
+                </Label>
+                )
+              })}</Header>
             </Container>
             <Item.Description>
               <Container textAlign='justified' style={{ padding: '1em' }}>
@@ -34,6 +66,7 @@ class ApplicantProfile extends Component {
                 <p>{motivation_exercise
                   ?.split ('\n').map ((item, i) => <div key={i}>{item}</div>)}
                 </p>
+                
               </Container>
               <Container textAlign='center' style={{ padding: '1em' }}>
                 <Header as='h3'>StĂĄtusz:</Header>
-- 
GitLab