Changeset 47067ae


Ignore:
Timestamp:
01/12/21 21:24:08 (4 years ago)
Author:
i-ina <76742075+i-ina@…>
Branches:
master
Children:
96eb8bc
Parents:
2e507a8
Message:

added internships for user

Location:
client_app/src/components
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • client_app/src/components/data/components/user_internships.js

    r2e507a8 r47067ae  
    22import {Redirect} from "react-router-dom";
    33import React from "react";
     4import Internships from "./item_components/internship_component";
    45
    56const UserInternships = (props) =>{
    6     var itemsArray = [];
    7 
    87    if(props.userProfile.type==="USER"){
    98        if(props.userProfile.email!=null){
    10             props.userProfile.internships.forEach(item => {
    11                 let obj = {}
    12                 obj.header = item.title;
    13                 obj.description = item.description + "\n" + item.accountEmail + " for contact!";
    14                 obj.meta = "Company: " + item.accountName + " / Salary: " + item.salary;
    15 
    16                 itemsArray.push(obj);
    17             });
    18 
    199            return(
    20                 <Container textAlign="left">
    21                     <h1>Internships for you!</h1>
    22                     <Card.Group items={itemsArray} />
     10                <Container>
     11                <h1>Internships for you!</h1>
     12                {props.userProfile.internships.map(item =>{
     13                    return <Internships
     14                        title={item.title}
     15                        description={item.description}
     16                        accountName={item.accountName}
     17                        accountEmail={item.accountEmail}
     18                        skills={item.skillsTrained}
     19                        type={props.userProfile.type}
     20                    />})
     21                }
    2322                </Container>
    2423            );
  • client_app/src/components/main/App.js

    r2e507a8 r47067ae  
    3333                      <Route path={"/user/internships"} render={() => <UserInternships userProfile={this.state.currentUser}/>} />
    3434                      <Route path={"/user/projects"} render={() => <UserProjects userProfile={this.state.currentUser}/>} />
    35                       <Route path={"/team/jobs"} />
     35                      <Route path={"/team/jobs"} render={() => <CompanyJobs userProfile={this.state.currentUser} />}/>
    3636                      <Route path={"/team/projects"} />
    3737                      <Route path={"/company/jobs"} render={() => <CompanyJobs userProfile={this.state.currentUser} />}/>
Note: See TracChangeset for help on using the changeset viewer.