Changeset 2e507a8 for client_app/src/components/data
- Timestamp:
- 01/12/21 21:10:56 (4 years ago)
- Branches:
- master
- Children:
- 47067ae
- Parents:
- a70db1a
- Location:
- client_app/src/components/data
- Files:
-
- 9 added
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
client_app/src/components/data/components/user_jobs.js
ra70db1a r2e507a8 1 1 import React from 'react'; 2 2 import { Redirect } from 'react-router-dom'; 3 import { Container, Card } from 'semantic-ui-react' 3 import { Container, Card } from 'semantic-ui-react'; 4 import Jobs from '../components/item_components/job_component'; 4 5 5 6 … … 7 8 var itemsArray = []; 8 9 9 if(props.userProfile.email!=null){ 10 props.userProfile.jobs.forEach(item => { 11 let obj = {} 12 obj.header = item.title; 13 obj.description = item.description + "\n" + "Contact: " + item.accountEmail; 14 if(item.accountType=="TEAM"){ 15 obj.meta = "Team: " + item.accountName + " / Salary: " + item.salary 16 }else{ 17 obj.meta = "Company: " + item.accountName + " / Salary: " + item.salary 18 } 19 20 itemsArray.push(obj); 21 }); 22 23 return( 24 <Container textAlign="left"> 25 <h1>Jobs for you!</h1> 26 <Card.Group items={itemsArray} /> 27 </Container> 28 ); 10 if(props.userProfile.type==="USER"){ 11 if(props.userProfile.email!=null){ 12 return( 13 <Container textAlign="left"> 14 <h1>Jobs for you!</h1> 15 {props.userProfile.jobs.map(item =>{ 16 return <Jobs 17 title={item.title} 18 description={item.description} 19 accountName={item.accountName} 20 accountEmail={item.accountEmail} 21 skills={item.skillsRequired} 22 type={props.userProfile.type} 23 /> 24 })} 25 </Container> 26 ); 27 } 29 28 } 30 29 -
client_app/src/components/data/profile.js
ra70db1a r2e507a8 1 1 import React from 'react'; 2 import UserDetails from "./components/ user_profile";2 import UserDetails from "./components/profiles/user_profile"; 3 3 import { Redirect } from "react-router-dom"; 4 import CompanyProfile from "./components/profiles/company_profile"; 5 import TeamProfile from "./components/profiles/team_profile"; 4 6 5 7 const Profile = (props) => { … … 17 19 } 18 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 19 41 return( 20 42 <Redirect to={"/login"}/>
Note:
See TracChangeset
for help on using the changeset viewer.