Skip to content

Commit 1c901de

Browse files
committed
refactor: move style of main in a separate file
1 parent a9e5962 commit 1c901de

File tree

5 files changed

+101
-96
lines changed

5 files changed

+101
-96
lines changed

app/src/components/PartnersList.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ export default function PartnersList({ partners }: { partners: Partner[] }) {
1919

2020
return (
2121
<div className={styles.partnersList}>
22-
<h1>Partenaires</h1>
22+
<h1 className="light" z>
23+
Partenaires
24+
</h1>
2325
<div className={styles.list}>{list}</div>
2426
</div>
2527
);

app/src/pages/index.tsx

+11-6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
queryTranslations,
1212
translate,
1313
} from "@/locales";
14+
import styles from "@/styles/Homepage.module.scss";
1415
import {
1516
Association,
1617
AssociationMembership,
@@ -31,14 +32,18 @@ export default function Home(
3132

3233
return (
3334
<>
34-
<div className="divLogo">
35-
<DirectusImage img={translation.banner} className="mainLogo" />
36-
<img src={PreviewImage.src} alt="preview" className="galleryPreview" />
35+
<div className={styles.divLogo}>
36+
<DirectusImage img={translation.banner} className={styles.mainLogo} />
37+
<img
38+
src={PreviewImage.src}
39+
alt="preview"
40+
className={styles.galleryPreview}
41+
/>
3742
</div>
3843

39-
<div className="news">
44+
<div className={styles.news}>
4045
<h1 className="light">News</h1>
41-
<div className="news-list">
46+
<div className={styles.newsList}>
4247
{props.news.map((n) => (
4348
<NewsCard key={(n as any).id} news={n} />
4449
))}
@@ -52,7 +57,7 @@ export default function Home(
5257
social_links={props.social_links}
5358
/>
5459

55-
<div className="cardList">
60+
<div className={styles.cardList}>
5661
<h1>{translate("committee", locale(router), { capitalize: true })}</h1>
5762
<div>
5863
{props.committee.map((m) => (

app/src/styles/Homepage.module.scss

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
@import "glass";
2+
3+
.divLogo {
4+
width: 100%;
5+
height: 80vh;
6+
7+
display: grid;
8+
grid-template-columns: 1fr 1fr;
9+
10+
@media (max-width: 1200px) {
11+
height: 50vh;
12+
}
13+
14+
@media (max-width: 800px) {
15+
grid-template-columns: 1fr;
16+
height: fit-content;
17+
}
18+
19+
.mainLogo {
20+
grid-row: 1;
21+
grid-column: 1;
22+
23+
height: 15rem;
24+
margin-top: 40%;
25+
width: 100%;
26+
27+
@media (max-width: 1200px) {
28+
width: 75%;
29+
margin: auto;
30+
margin-top: 30%;
31+
}
32+
33+
@media (max-width: 800px) {
34+
width: 50%;
35+
margin: auto;
36+
margin-top: 15%;
37+
}
38+
}
39+
40+
.galleryPreview {
41+
grid-row: 1;
42+
grid-column: 2;
43+
width: 110%;
44+
45+
@media (max-width: 800px) {
46+
display: none;
47+
}
48+
}
49+
}
50+
51+
.news {
52+
@extend .glass;
53+
54+
width: 100%;
55+
overflow: scroll;
56+
57+
padding: 2em;
58+
59+
.newsList {
60+
margin: 2%;
61+
gap: 2em;
62+
width: fit-content;
63+
display: flex;
64+
flex-direction: row;
65+
}
66+
}
67+
68+
.cardList {
69+
display: flex;
70+
flex-direction: column;
71+
row-gap: 1em;
72+
margin-top: 5rem;
73+
74+
border-radius: 3rem;
75+
background-color: var(--background-color);
76+
width: 80%;
77+
78+
> div {
79+
display: grid;
80+
grid-gap: 1rem;
81+
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
82+
align-items: center;
83+
justify-items: center;
84+
padding: 2rem;
85+
}
86+
}

app/src/styles/PartnersList.module.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.partnersList {
22
width: 100%;
3-
background-color: white;
3+
background-color: #0d1d2a;
44
display: flex;
55
flex-direction: column;
66
align-items: center;

app/src/styles/globals.scss

-88
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ a {
2828

2929
overflow: hidden;
3030

31-
gap: 4rem;
32-
3331
padding-top: 3rem;
3432
padding-bottom: 6rem;
3533
min-height: 100vh;
@@ -43,71 +41,6 @@ a {
4341
}
4442
}
4543

46-
.divLogo {
47-
width: 100%;
48-
height: 80vh;
49-
50-
display: grid;
51-
grid-template-columns: 1fr 1fr;
52-
53-
@media (max-width: 1200px) {
54-
height: 50vh;
55-
}
56-
57-
@media (max-width: 800px) {
58-
grid-template-columns: 1fr;
59-
height: fit-content;
60-
}
61-
62-
.mainLogo {
63-
grid-row: 1;
64-
grid-column: 1;
65-
66-
height: 15rem;
67-
margin-top: 40%;
68-
width: 100%;
69-
70-
@media (max-width: 1200px) {
71-
width: 75%;
72-
margin: auto;
73-
margin-top: 30%;
74-
}
75-
76-
@media (max-width: 800px) {
77-
width: 50%;
78-
margin: auto;
79-
margin-top: 15%;
80-
}
81-
}
82-
83-
.galleryPreview {
84-
grid-row: 1;
85-
grid-column: 2;
86-
width: 110%;
87-
88-
@media (max-width: 800px) {
89-
display: none;
90-
}
91-
}
92-
}
93-
94-
.news {
95-
@extend .glass;
96-
97-
width: 100%;
98-
overflow: scroll;
99-
100-
padding: 2em;
101-
102-
.news-list {
103-
margin: 2%;
104-
gap: 2em;
105-
width: fit-content;
106-
display: flex;
107-
flex-direction: row;
108-
}
109-
}
110-
11144
.text {
11245
h1 {
11346
text-align: center;
@@ -212,24 +145,3 @@ h1 {
212145
justify-content: center;
213146
}
214147
}
215-
216-
.cardList {
217-
display: flex;
218-
flex-direction: column;
219-
row-gap: 1em;
220-
221-
> div {
222-
display: grid;
223-
grid-gap: 1rem;
224-
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
225-
align-items: center;
226-
justify-items: center;
227-
padding: 2rem;
228-
}
229-
230-
border-radius: 3rem;
231-
232-
background-color: var(--background-color);
233-
234-
width: 80%;
235-
}

0 commit comments

Comments
 (0)