11import React , { useEffect } from "react" ;
22import { makeStyles } from "@material-ui/core/styles" ;
3- import { Link } from "react-router-dom" ;
43import { HashLink } from "react-router-hash-link" ;
54import { fontMono , fontSans , orange , llslate , slate } from "./PageStyles" ;
6- import { StyledButton } from "./Common" ;
5+ import { StyledButton , StyledLink } from "./Common" ;
76
87const offsetTop = 18 ;
98const smallScreen = window . screen . height < 850 ;
9+ const thinScreen = window . screen . width < 950 ;
1010
1111const useStyles = makeStyles ( ( theme ) => ( {
1212 root : {
1313 position : "relative" ,
1414 top : ( props ) =>
1515 props . smallScreen ? `${ offsetTop / 3 } vh` : `${ offsetTop } vh` ,
16- width : " 70%",
16+ width : ( props ) => ( props . smallScreen ? "95%" : " 70%") ,
1717 margin : "auto" ,
1818 } ,
1919 hello : {
@@ -26,7 +26,7 @@ const useStyles = makeStyles((theme) => ({
2626 fontWeight : "600" ,
2727 letterSpacing : "1px" ,
2828 fontFamily : fontSans ,
29- fontSize : " 5em",
29+ fontSize : ( props ) => ( props . smallScreen ? "2. 5em" : "5em" ) ,
3030 } ,
3131 name : {
3232 color : llslate ,
@@ -36,26 +36,28 @@ const useStyles = makeStyles((theme) => ({
3636 } ,
3737 about : {
3838 fontFamily : fontSans ,
39- fontSize : "1.2em" ,
39+ fontSize : ( props ) => ( props . thinScreen ? "1.1em" : "1.2em" ) ,
40+ marginTop : ( props ) => ( props . thinScreen ? "16px" : 0 ) ,
4041 color : slate ,
41- maxWidth : " 50%",
42+ maxWidth : ( props ) => ( props . smallScreen ? "90%" : " 50%") ,
4243 } ,
4344 buttonGroup : {
44- marginTop : " 64px",
45+ marginTop : ( props ) => ( props . smallScreen ? "32px" : " 64px") ,
4546 } ,
4647 outline : {
4748 borderColor : orange ,
4849 } ,
4950 button : {
5051 float : "none" ,
51- fontSize : " 1em",
52+ fontSize : ( props ) => ( props . thinScreen ? "0.8em" : " 1em") ,
5253 marginRight : "2em" ,
53- padding : "12px 20px 12px 20px" ,
54+ padding : ( props ) =>
55+ props . thinScreen ? "6px 10px 6px 10px" : "12px 20px 12px 20px" ,
5456 } ,
5557} ) ) ;
5658
5759export default function Hero ( props ) {
58- const classes = useStyles ( { smallScreen } ) ;
60+ const classes = useStyles ( { smallScreen, thinScreen } ) ;
5961
6062 useEffect ( ( ) => {
6163 document . title = "Home | Jeremy Kanovsky" ;
@@ -72,7 +74,7 @@ export default function Hero(props) {
7274 < div className = { classes . about } >
7375 I'm a Boston-based software engineer who specializes in writing code for
7476 IoT devices and robots. Sometimes, I dabble in hardware. Currently, I'm
75- an engineer at Markforged working on the software powering
77+ an engineer at < StyledLink href = "https://markforged.com/" text = " Markforged" /> working on the software powering
7678 next-generation 3D printers.
7779 </ div >
7880
@@ -87,15 +89,15 @@ export default function Hero(props) {
8789 </ StyledButton >
8890 </ HashLink >
8991
90- < Link to = "/projects" style = { { textDecoration : "none" } } >
92+ < HashLink to = "/# projects" style = { { textDecoration : "none" } } >
9193 < StyledButton
9294 className = { classes . button }
9395 classes = { { outlined : classes . outline } }
9496 variant = "outlined"
9597 >
9698 See My Work
9799 </ StyledButton >
98- </ Link >
100+ </ HashLink >
99101 </ div >
100102 </ div >
101103 ) ;
0 commit comments