File tree Expand file tree Collapse file tree 5 files changed +99
-12
lines changed
Expand file tree Collapse file tree 5 files changed +99
-12
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,15 @@ div#narrowSkillTitle {
106106 }
107107}
108108
109+ /* Toggle controls */
110+ .modeToggleOption : hover {
111+ opacity : 0.7 ;
112+ }
113+
114+ .sectionToggle : hover {
115+ opacity : 0.7 ;
116+ }
117+
109118/* Mobile/Narrow screen adjustments */
110119@media (max-width : 768px ) {
111120 .ui .text .container {
Original file line number Diff line number Diff line change 11import React from "react" ;
22import { Container , Divider } from "semantic-ui-react" ;
33import "./App.css" ;
4+ import { CVProvider } from "./context/CVContext" ;
45import Achievements from "./containers/Achievements" ;
56import Education from "./containers/Education" ;
67import Experience from "./containers/Experience" ;
@@ -9,21 +10,25 @@ import Header from "./containers/Header";
910import Skills from "./containers/Skills" ;
1011import PdfDownloadButton from "./components/PdfDownloadButton" ;
1112import GitHubLinkButton from "./components/GitHubLinkButton" ;
13+ import ModeToggle from "./components/ModeToggle" ;
1214
1315function App ( ) {
1416 return (
15- < Container text >
16- < PdfDownloadButton />
17- < GitHubLinkButton />
18- < Divider hidden style = { { marginTop : 10 } } className = "hideFromPrint" />
19- < Header />
20- < Experience />
21- < Education />
22- < Skills />
23- < Achievements />
24- < Footer />
25- < Divider hidden style = { { marginTop : 10 } } className = "hideFromPrint" />
26- </ Container >
17+ < CVProvider >
18+ < Container text >
19+ < PdfDownloadButton />
20+ < GitHubLinkButton />
21+ < Divider hidden style = { { marginTop : 10 } } className = "hideFromPrint" />
22+ < Header />
23+ < ModeToggle />
24+ < Experience />
25+ < Education />
26+ < Skills />
27+ < Achievements />
28+ < Footer />
29+ < Divider hidden style = { { marginTop : 10 } } className = "hideFromPrint" />
30+ </ Container >
31+ </ CVProvider >
2732 ) ;
2833}
2934
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import { MODES , ACTIONS } from "../constants/tags" ;
3+ import { useCVContext } from "../context/CVContext" ;
4+
5+ const ModeToggle = ( ) => {
6+ const { state, dispatch } = useCVContext ( ) ;
7+ const isShort = state . mode === MODES . SHORT ;
8+
9+ return (
10+ < div className = "hideFromPrint" style = { { textAlign : "center" , margin : "4px 0 8px" } } >
11+ < span
12+ onClick = { ( ) => dispatch ( { type : ACTIONS . SET_MODE , payload : MODES . SHORT } ) }
13+ className = "modeToggleOption"
14+ style = { {
15+ cursor : "pointer" ,
16+ fontWeight : isShort ? 500 : 400 ,
17+ color : isShort ? "#2185d0" : "#999" ,
18+ fontSize : "11px" ,
19+ letterSpacing : "1px" ,
20+ textTransform : "uppercase" ,
21+ } }
22+ >
23+ Short
24+ </ span >
25+ < span style = { { margin : "0 8px" , color : "#ccc" , fontSize : "11px" } } > |</ span >
26+ < span
27+ onClick = { ( ) => dispatch ( { type : ACTIONS . SET_MODE , payload : MODES . LONG } ) }
28+ className = "modeToggleOption"
29+ style = { {
30+ cursor : "pointer" ,
31+ fontWeight : isShort ? 400 : 500 ,
32+ color : isShort ? "#999" : "#2185d0" ,
33+ fontSize : "11px" ,
34+ letterSpacing : "1px" ,
35+ textTransform : "uppercase" ,
36+ } }
37+ >
38+ Long
39+ </ span >
40+ </ div >
41+ ) ;
42+ } ;
43+
44+ export default ModeToggle ;
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import { ACTIONS } from "../constants/tags" ;
3+ import { useCVContext } from "../context/CVContext" ;
4+
5+ const SectionToggle = ( { tag, label } ) => {
6+ const { state, dispatch } = useCVContext ( ) ;
7+ const isHidden = state . hiddenTags . includes ( tag ) ;
8+
9+ return (
10+ < span
11+ className = "hideFromPrint sectionToggle"
12+ onClick = { ( ) => dispatch ( { type : ACTIONS . TOGGLE_TAG , payload : tag } ) }
13+ style = { {
14+ cursor : "pointer" ,
15+ fontSize : "10px" ,
16+ color : isHidden ? "#ccc" : "#999" ,
17+ marginLeft : "8px" ,
18+ letterSpacing : "0.5px" ,
19+ fontWeight : 300 ,
20+ textTransform : "none" ,
21+ textDecoration : isHidden ? "line-through" : "none" ,
22+ } }
23+ >
24+ { label }
25+ </ span >
26+ ) ;
27+ } ;
28+
29+ export default SectionToggle ;
You can’t perform that action at this time.
0 commit comments