Skip to content

Commit a6fca82

Browse files
committed
front: rework home page
1 parent 7e75682 commit a6fca82

17 files changed

+60
-58
lines changed

front/src/assets/pictures/carto.png

-67 KB
Binary file not shown.
-23.1 KB
Binary file not shown.
-8.92 KB
Binary file not shown.
-5.98 KB
Binary file not shown.

front/src/assets/pictures/editor.png

-76.8 KB
Binary file not shown.
17.4 KB
Loading
12.8 KB
Loading
27.1 KB
Loading
28.8 KB
Loading
26.5 KB
Loading
24.7 KB
Loading

front/src/assets/pictures/map.svg

-1
This file was deleted.
-25.2 KB
Binary file not shown.

front/src/common/BootstrapSNCF/CardSNCF/CardSNCF.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import { Link } from 'react-router-dom';
44
import { connect } from 'react-redux';
5+
import './CardSNCF.scss';
56

67
class Card extends React.Component {
78
static propTypes = {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.card-img-top {
2+
padding: 2rem;
3+
}
4+
.card-body {
5+
display: flex;
6+
align-items: center;
7+
justify-content: center;
8+
padding: .5rem;
9+
height: 4rem;
10+
}

front/src/main/Home/Home.scss

+18-11
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,25 @@
1616
pointer-events: none;
1717
}
1818

19-
.title-page-link {
19+
.application-title {
2020
display: flex;
2121
align-items: center;
22-
text-align: left;
23-
font-size: 1.5rem;
24-
font-weight: 400;
25-
transition: .4s;
26-
color: var(--coolgray11);
27-
border-radius: 4px;
28-
padding: .5rem;
29-
margin-bottom: .5rem;
30-
&:hover {
31-
color: var(--primary);
22+
justify-content: center;
23+
padding: 1rem 0 0;
24+
h1 {
25+
padding-top: 2rem;
26+
font-size: 3rem;
27+
color: var(--coolgray9);
28+
}
29+
img {
30+
width: 8rem;
31+
}
32+
@media screen and (max-width: 1024px) {
33+
h1 {
34+
font-size: 1.5rem;
35+
}
36+
img {
37+
width: 4rem;
38+
}
3239
}
3340
}

front/src/main/Home/index.js

+31-46
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
import './Home.scss';
2+
3+
import Card from 'common/BootstrapSNCF/CardSNCF/CardSNCF';
24
import NavBarSNCF from 'common/BootstrapSNCF/NavBarSNCF';
35
import React from 'react';
6+
import mapImg from 'assets/pictures/home/map.png';
7+
import editorImg from 'assets/pictures/home/editor.png';
8+
import stdcmImg from 'assets/pictures/home/stdcm.png';
9+
import timetableImg from 'assets/pictures/home/timetable.png';
10+
import customgetImg from 'assets/pictures/home/customget.png';
11+
import opendataImg from 'assets/pictures/home/opendata.png';
412
import logo from 'assets/logo_osrd_seul_blanc.svg';
513
import osrdLogo from 'assets/pictures/osrd.png';
614
import { useSelector } from 'react-redux';
715
import { useTranslation } from 'react-i18next';
8-
import { Link } from 'react-router-dom';
9-
import { MdMoreTime, MdOutlineRailwayAlert, MdOutlineTimeline, MdShowChart } from 'react-icons/md';
10-
import { FaMap, FaMapMarked } from 'react-icons/fa';
1116

1217
export default function Home() {
1318
const user = useSelector((state) => state.user);
@@ -17,49 +22,29 @@ export default function Home() {
1722
<>
1823
<NavBarSNCF appName="OSRD" username={user.username} logo={logo} />
1924
<main className="mastcontainer mastcontainer-no-mastnav">
20-
<div className="">
21-
<div className="my-4 d-flex align-items-center justify-content-center">
22-
<img src={osrdLogo} alt="OSRD logo" width="92px" />
23-
<h1 className="font-weight-bold">Open Source Railway Designer</h1>
24-
</div>
25-
<div className="my-4 d-flex align-items-center justify-content-center">
26-
<div className="">
27-
<Link to="/osrd">
28-
<div className="title-page-link">
29-
<MdShowChart />
30-
<span className="ml-2">{t('timetable')}</span>
31-
</div>
32-
</Link>
33-
<Link to="/carto">
34-
<div className="title-page-link">
35-
<FaMap />
36-
<span className="ml-2">{t('map')}</span>
37-
</div>
38-
</Link>
39-
<Link to="/editor">
40-
<div className="title-page-link">
41-
<FaMapMarked />
42-
<span className="ml-2">{t('editor')}</span>
43-
</div>
44-
</Link>
45-
<Link to="/stdcm">
46-
<div className="title-page-link">
47-
<MdOutlineRailwayAlert />
48-
<span className="ml-2">{t('stdcm')}</span>
49-
</div>
50-
</Link>
51-
<Link to="/opendata">
52-
<div className="title-page-link">
53-
<MdMoreTime />
54-
<span className="ml-2">{t('opendataimport')}</span>
55-
</div>
56-
</Link>
57-
<Link to="/customget">
58-
<div className="title-page-link">
59-
<MdOutlineTimeline />
60-
<span className="ml-2">{t('customget')}</span>
61-
</div>
62-
</Link>
25+
<div className="application-title">
26+
<img src={osrdLogo} alt="OSRD logo" />
27+
<h1>Open-Source Railway Designer</h1>
28+
</div>
29+
<div className="cardscontainer">
30+
<div className="row">
31+
<div className="col-6 col-sm-4 col-md-3 col-lg-2 mb-2">
32+
<Card img={timetableImg} title={t('timetable')} link="/osrd" />
33+
</div>
34+
<div className="col-6 col-sm-4 col-md-3 col-lg-2 mb-2">
35+
<Card img={mapImg} title={t('map')} link="/carto" />
36+
</div>
37+
<div className="col-6 col-sm-4 col-md-3 col-lg-2 mb-2">
38+
<Card img={editorImg} title={t('editor')} link="/editor" />
39+
</div>
40+
<div className="col-6 col-sm-4 col-md-3 col-lg-2 mb-2">
41+
<Card img={stdcmImg} title={t('stdcm')} link="/stdcm" />
42+
</div>
43+
<div className="col-6 col-sm-4 col-md-3 col-lg-2 mb-2">
44+
<Card img={opendataImg} title={t('opendataimport')} link="/opendata" />
45+
</div>
46+
<div className="col-6 col-sm-4 col-md-3 col-lg-2 mb-2">
47+
<Card img={customgetImg} title={t('customget')} link="/customget" />
6348
</div>
6449
</div>
6550
</div>

0 commit comments

Comments
 (0)