generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into mui1684
- Loading branch information
Showing
1 changed file
with
94 additions
and
55 deletions.
There are no files selected for viewing
149 changes: 94 additions & 55 deletions
149
client/src/components/presentational/profile/UserTable.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,98 @@ | ||
import React from 'react'; | ||
import ProfileOption from '../profile/ProfileOption'; | ||
|
||
import { | ||
Box, | ||
Table, | ||
TableBody, | ||
TableCell, | ||
TableHead, | ||
TableRow, | ||
} from '@mui/material'; | ||
|
||
const UserTable = ({ context }) => { | ||
const { user, removeOption } = context; | ||
|
||
return ( | ||
<div className="user-info"> | ||
<table className="user-data"> | ||
<tbody> | ||
<tr> | ||
<th className="user-data__header">Name</th> | ||
<td className="user-data__info user-data">{user.name}</td> | ||
</tr> | ||
<tr> | ||
<th className="user-data__header">Email</th> | ||
<td className="user-data__info">{user.email}</td> | ||
</tr> | ||
<tr> | ||
<th className="user-data__header">Github</th> | ||
<td className="user-data__info">{user.github}</td> | ||
</tr> | ||
|
||
{user.slack ? | ||
(<tr> | ||
<th className="user-data__header">Slack</th> | ||
<td className="user-data__info">{user.slack}</td> | ||
</tr>):("")} | ||
|
||
{user.desiredRoles ? | ||
(<tr> | ||
<th className="user-data__header">Desired Roles</th> | ||
<td className="user-data__info user-data__info--flex"> | ||
{user.desiredRoles.map((option, index)=> (<ProfileOption key={index} option={option} removeOption={()=>removeOption("desiredRoles", option)}/>))} | ||
</td> | ||
</tr>):("")} | ||
|
||
{user.hackNights ? | ||
(<tr> | ||
<th className="user-data__header">My Hack Nights</th> | ||
<td className="user-data__info user-data__info--flex"> | ||
{user.hackNights.map((option, index)=>(<ProfileOption key={index} option={option} removeOption={()=>removeOption("hackNights", option)}/>))} | ||
</td> | ||
</tr>):("")} | ||
|
||
{user.availability ? | ||
(<tr> | ||
<th className="user-data__header">Availability</th> | ||
<td className="user-data__info user-data__info--flex"> | ||
{user.availability.map((option, index)=>(<ProfileOption key={index} option={option} removeOption={()=>removeOption("availability", option)}/>))} | ||
</td> | ||
</tr>):("")} | ||
</tbody> | ||
</table> | ||
</div> | ||
) | ||
} | ||
|
||
export default UserTable; | ||
const { user, removeOption } = context; | ||
|
||
return ( | ||
<Box className="user-info"> | ||
<Table className="user-data"> | ||
<TableBody> | ||
<TableRow> | ||
<TableHead className="user-data__header">Name</TableHead> | ||
<TableCell className="user-data__info user-data">{user.name}</TableCell> | ||
</TableRow> | ||
<TableRow> | ||
<TableHead className="user-data__header">Email</TableHead> | ||
<TableCell className="user-data__info">{user.email}</TableCell> | ||
</TableRow> | ||
<TableRow> | ||
<TableHead className="user-data__header">Github</TableHead> | ||
<TableCell className="user-data__info">{user.github}</TableCell> | ||
</TableRow> | ||
|
||
{user.slack ? ( | ||
<TableRow> | ||
<TableHead className="user-data__header">Slack</TableHead> | ||
<TableCell className="user-data__info">{user.slack}</TableCell> | ||
</TableRow> | ||
) : ( | ||
'' | ||
)} | ||
|
||
{user.desiredRoles ? ( | ||
<TableRow> | ||
<TableHead className="user-data__header">Desired Roles</TableHead> | ||
<TableCell className="user-data__info user-data__info--flex"> | ||
{user.desiredRoles.map((option, index) => ( | ||
<ProfileOption | ||
key={index} | ||
option={option} | ||
removeOption={() => removeOption('desiredRoles', option)} | ||
/> | ||
))} | ||
</TableCell> | ||
</TableRow> | ||
) : ( | ||
'' | ||
)} | ||
|
||
{user.hackNights ? ( | ||
<TableRow> | ||
<TableHead className="user-data__header">My Hack Nights</TableHead> | ||
<TableCell className="user-data__info user-data__info--flex"> | ||
{user.hackNights.map((option, index) => ( | ||
<ProfileOption | ||
key={index} | ||
option={option} | ||
removeOption={() => removeOption('hackNights', option)} | ||
/> | ||
))} | ||
</TableCell> | ||
</TableRow> | ||
) : ( | ||
'' | ||
)} | ||
|
||
{user.availability ? ( | ||
<TableRow> | ||
<TableHead className="user-data__header">Availability</TableHead> | ||
<TableCell className="user-data__info user-data__info--flex"> | ||
{user.availability.map((option, index) => ( | ||
<ProfileOption | ||
key={index} | ||
option={option} | ||
removeOption={() => removeOption('availability', option)} | ||
/> | ||
))} | ||
</TableCell> | ||
</TableRow> | ||
) : ( | ||
'' | ||
)} | ||
</TableBody> | ||
</Table> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default UserTable; |