source: client_app/src/components/profiles/profile.js@ c9fa474

Last change on this file since c9fa474 was c9fa474, checked in by i-ina <76742075+i-ina@…>, 4 years ago

cleaning

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[17abe5e]1import React from 'react';
[c9fa474]2import UserDetails from "./user_profile";
[6f9b7b0]3import { Redirect } from "react-router-dom";
[c9fa474]4import CompanyProfile from "./company_profile";
5import TeamProfile from "./team_profile";
[17abe5e]6
7const Profile = (props) => {
8
[6f9b7b0]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 );
[17abe5e]19 }
20
[2e507a8]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
[17abe5e]41 return(
[6f9b7b0]42 <Redirect to={"/login"}/>
[17abe5e]43 );
44}
45
46export default Profile;
Note: See TracBrowser for help on using the repository browser.