Skip to content

Commit 3c0f7cd

Browse files
authored
Merge pull request #295 from tjklint/refactor(1page)
refactor: Adjust contribution map layout for better alignment and res…
2 parents 0082281 + 0ddd445 commit 3c0f7cd

File tree

2 files changed

+13
-26
lines changed

2 files changed

+13
-26
lines changed

src/components/contribution_map/contribution_map.scss

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818

1919
.contribution-map-container {
20-
width: 100%;
20+
width: 80%; /* Set width to 80% for consistent margin with the rest of the components */
2121
margin: 0 auto;
2222
padding: 20px 0;
2323
color: #fff;
@@ -27,35 +27,30 @@
2727
margin-top: 40px;
2828
display: flex;
2929
flex-direction: column;
30+
align-items: center; /* Center everything except the header */
3031
color: #fff;
31-
align-items: center;
32-
33-
.content-wrapper {
34-
width: auto;
35-
display: flex;
36-
flex-direction: column;
37-
align-items: flex-start; // Align content to the left within the wrapper
38-
}
3932

4033
h2 {
4134
font-size: 2em;
4235
margin-bottom: 20px;
4336
color: #fff;
4437
font-family: 'RobotoMono', sans-serif;
4538
text-align: left;
39+
align-self: flex-start; /* Keep the header aligned to the left */
40+
width: 100%;
4641
}
4742

4843
.react-github-calendar {
44+
width: 100%;
4945
display: flex;
50-
justify-content: center;
51-
font-family: 'RobotoMono', sans-serif;
52-
width: auto;
46+
justify-content: center; /* Center the contribution graph */
47+
overflow-x: auto; /* Allows horizontal scroll if the graph overflows */
5348
}
5449

5550
.calendar-wrapper {
51+
width: 100%;
5652
display: flex;
57-
justify-content: center;
58-
width: auto;
53+
justify-content: center; /* Center the content within the wrapper */
5954
}
6055
}
6156
}

src/components/contribution_map/contribution_map.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ import GitHubCalendar from "react-github-calendar";
33
import "./contribution_map.scss";
44

55
const ContributionMap: React.FC = () => {
6-
const theme = {
7-
light: ["#e6ccff", "#c299ff", "#9f66ff", "#7a33cc", "#592699"],
8-
dark: ["#e6ccff", "#c299ff", "#9f66ff", "#7a33cc", "#592699"],
9-
};
10-
116
const labels = {
127
months: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
138
weekdays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
@@ -21,23 +16,20 @@ const ContributionMap: React.FC = () => {
2116
return (
2217
<div className="contribution-map-container">
2318
<section className="contribution-map">
24-
<div className="content-wrapper">
25-
<h2>My Github Contributions</h2>
26-
<div className="react-github-calendar">
27-
<div className="calendar-wrapper">
19+
<h2>My Github Contributions</h2>
20+
<div className="react-github-calendar">
21+
<div className="calendar-wrapper">
2822
<GitHubCalendar
2923
username="tjklint"
30-
blockSize={20}
24+
blockSize={18}
3125
fontSize={16}
3226
theme={{
3327
light: ["#ffffff", "#c299ff", "#9f66ff", "#7a33cc", "#592699"],
3428
dark: ["#ffffff", "#c299ff", "#9f66ff", "#7a33cc", "#592699"],
3529
}}
3630
labels={labels}
37-
3831
/>
3932
</div>
40-
</div>
4133
</div>
4234
</section>
4335
</div>

0 commit comments

Comments
 (0)