-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #439 from ubc-biztech/mentors-list
Mentors list
- Loading branch information
Showing
7 changed files
with
502 additions
and
14 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import React, { | ||
useRef | ||
} from "react"; | ||
import SearchIcon from "@material-ui/icons/Search"; | ||
import { | ||
TextField | ||
} from "@material-ui/core"; | ||
import { | ||
makeStyles | ||
} from "@material-ui/core/styles"; | ||
import { | ||
COLORS | ||
} from "constants/index"; | ||
|
||
const useStyles = makeStyles({ | ||
textfield: { | ||
border: "solid white 2px", | ||
borderRadius: "10px", | ||
"& label.Mui-focused": { | ||
color: "white" | ||
}, | ||
"& .MuiOutlinedInput-root": { | ||
backgroundColor: COLORS.LIGHT_BACKGROUND_COLOR, | ||
borderRadius: "10px", | ||
"& fieldset": { | ||
borderColor: COLORS.LIGHT_BACKGROUND_COLOR | ||
}, | ||
"&:hover fieldset": { | ||
borderColor: COLORS.LIGHT_BACKGROUND_COLOR | ||
}, | ||
"&.Mui-focused fieldset": { | ||
borderColor: COLORS.LIGHT_BACKGROUND_COLOR | ||
} | ||
}, | ||
}, | ||
searchIcon: { | ||
cursor: "pointer" | ||
} | ||
}); | ||
|
||
function SearchBar ({ | ||
setSearchQuery, searchQuery | ||
}) { | ||
const classes = useStyles(); | ||
const searchRef = useRef(null); | ||
|
||
const handleEnterKeyPress = (e) => { | ||
if (e.keyCode === 13 && e.target.value !== "") { | ||
e.preventDefault(); | ||
setSearchQuery([...searchQuery, e.target.value]); | ||
e.target.value = ""; | ||
} | ||
}; | ||
|
||
const handleSearchClick = (e) => { | ||
if (searchRef.current.value !== "") { | ||
e.preventDefault(); | ||
setSearchQuery([...searchQuery, searchRef.current.value]); | ||
searchRef.current.value = ""; | ||
} | ||
}; | ||
|
||
return ( | ||
<> | ||
<div style={{ | ||
display: "flex", | ||
alignItems: "center", | ||
gap: "1%" | ||
}}> | ||
<TextField | ||
id="search-bar" | ||
className={classes.textfield} | ||
onKeyDown={handleEnterKeyPress} | ||
style={{ | ||
backgroundColor: COLORS.LIGHT_BACKGROUND_COLOR, | ||
color: "black" | ||
}} | ||
variant="outlined" | ||
placeholder="Enter a skill..." | ||
size="small" | ||
inputRef={searchRef} | ||
InputLabelProps={{ | ||
shrink: false, | ||
}} | ||
/> | ||
<div style={{ | ||
transform: "translateX(-50px)", | ||
display: "flex", | ||
justifyContent: "center", | ||
alignItems: "center" | ||
}}> | ||
<SearchIcon onClick={handleSearchClick} className={classes.searchIcon}/> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default SearchBar; |
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 |
---|---|---|
@@ -0,0 +1,110 @@ | ||
import React from "react"; | ||
import { | ||
Avatar, Typography, Box, Chip | ||
} from "@material-ui/core"; | ||
import useMediaQuery from "@material-ui/core/useMediaQuery"; | ||
import { | ||
makeStyles | ||
} from "@material-ui/core/styles"; | ||
import { | ||
useTheme | ||
} from "@material-ui/styles"; | ||
import { | ||
COLORS | ||
} from "constants/index"; | ||
|
||
const useStyles = makeStyles({ | ||
profileContainer: { | ||
display: "flex", | ||
flexDirection: "column", | ||
alignItems: "center", | ||
backgroundColor: COLORS.WHITE, | ||
borderRadius: "10px", | ||
padding: "6%", | ||
height: "100%", | ||
width: "100%", | ||
}, | ||
name: { | ||
marginTop: "2%", | ||
color: COLORS.LIGHT_BACKGROUND_COLOR, | ||
fontSize: "1.5rem", | ||
fontWeight: "bold", | ||
textAlign: "center" | ||
}, | ||
position: { | ||
marginTop: "2%", | ||
color: COLORS.LIGHT_BACKGROUND_COLOR, | ||
fontSize: "1.2rem", | ||
textAlign: "center" | ||
}, | ||
skill: { | ||
marginTop: "2%" | ||
}, | ||
profilePicture: { | ||
width: "150px", | ||
height: "150px", | ||
backgroundColor: COLORS.LIGHT_BACKGROUND_COLOR | ||
}, | ||
container: { | ||
height: "100%", | ||
flex: "0 3 350px", | ||
display: "flex", | ||
// border: "solid red 2px" | ||
}, | ||
skillsContainer: { | ||
display: "flex", | ||
justifyContent: "left", | ||
marginTop: "5%", | ||
flexWrap: "wrap", | ||
gap: "0.3vw 0.3vh" | ||
}, | ||
mobileContainer: { | ||
width: "100%", | ||
height: "100%", | ||
}, | ||
mobileProfileContainer: { | ||
// marginBottom: "2%", | ||
display: "flex", | ||
flexDirection: "column", | ||
alignItems: "center", | ||
backgroundColor: COLORS.WHITE, | ||
borderRadius: "10px", | ||
padding: "6%", | ||
height: "100%" | ||
}, | ||
}); | ||
|
||
function MentorCard(props) { | ||
const classes = useStyles(); | ||
const theme = useTheme(); | ||
const renderMobileOnly = useMediaQuery(theme.breakpoints.down("sm")); | ||
const { | ||
fname, lname, role, gender, companyName, profilePhoto, skills | ||
} = props.mentor; | ||
|
||
return ( | ||
<> | ||
<Box className={renderMobileOnly ? classes.mobileContainer : classes.container }> | ||
<Box className={renderMobileOnly ? classes.mobileProfileContainer : classes.profileContainer}> | ||
<Avatar | ||
alt={`${fname}-profile-picture`} | ||
src={profilePhoto} | ||
className={classes.profilePicture} /> | ||
<Typography className={classes.name}> | ||
{fname + ", " + lname + " " + `(${gender})`} | ||
</Typography> | ||
<Typography className={classes.position}> | ||
{role + " at " + companyName} | ||
</Typography> | ||
<div className={classes.skillsContainer}> | ||
{ | ||
skills.map((skill, idx) => <Chip key={idx} label={skill} variant="outlined"/>) | ||
} | ||
</div> | ||
</Box> | ||
</Box> | ||
</> | ||
); | ||
} | ||
|
||
export default MentorCard; |
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
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
Oops, something went wrong.