Skip to content

Commit 0d1908c

Browse files
mrtysnclaude
andcommitted
Add ModeToggle and SectionToggle UI controls
Global SHORT/LONG toggle below the header and a per-section coursework toggle in Education. App wrapped in CVProvider. All controls hidden from print. Default view is short mode with clean URL. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 04b5d8c commit 0d1908c

File tree

5 files changed

+99
-12
lines changed

5 files changed

+99
-12
lines changed

Mert_Yasin_CV.pdf

0 Bytes
Binary file not shown.

src/App.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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 {

src/App.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import { Container, Divider } from "semantic-ui-react";
33
import "./App.css";
4+
import { CVProvider } from "./context/CVContext";
45
import Achievements from "./containers/Achievements";
56
import Education from "./containers/Education";
67
import Experience from "./containers/Experience";
@@ -9,21 +10,25 @@ import Header from "./containers/Header";
910
import Skills from "./containers/Skills";
1011
import PdfDownloadButton from "./components/PdfDownloadButton";
1112
import GitHubLinkButton from "./components/GitHubLinkButton";
13+
import ModeToggle from "./components/ModeToggle";
1214

1315
function 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

src/components/ModeToggle.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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;

src/components/SectionToggle.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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;

0 commit comments

Comments
 (0)