source: client_app/src/components/data/profile.js@ 2e507a8

Last change on this file since 2e507a8 was 2e507a8, checked in by Vzdra <vladko.zdravkovski@…>, 3 years ago

front end additions

  • Property mode set to 100644
File size: 1.3 KB
Line 
1import React from 'react';
2import UserDetails from "./components/profiles/user_profile";
3import { Redirect } from "react-router-dom";
4import CompanyProfile from "./components/profiles/company_profile";
5import TeamProfile from "./components/profiles/team_profile";
6
7const Profile = (props) => {
8
9 if(props.userProfile.type==="USER"){
10 return (
11 <UserDetails data={{
12 email: props.userProfile.email,
13 name: props.userProfile.name,
14 surname: props.userProfile.surname,
15 retained: props.userProfile.retained,
16 toLearn: props.userProfile.toLearn
17 }}/>
18 );
19 }
20
21 if(props.userProfile.type==="COMPANY"){
22 return (
23 <CompanyProfile data={{
24 email: props.userProfile.email,
25 name: props.userProfile.name,
26 address: props.userProfile.address
27 }}/>
28 );
29 }
30
31 if(props.userProfile.type==="TEAM"){
32 return (
33 <TeamProfile data={{
34 email: props.userProfile.email,
35 name: props.userProfile.name,
36 members: props.userProfile.members
37 }}/>
38 );
39 }
40
41 return(
42 <Redirect to={"/login"}/>
43 );
44}
45
46export default Profile;
Note: See TracBrowser for help on using the repository browser.