Skip to content

Commit 07f0a7b

Browse files
committed
adjust style for the left side bar
1 parent f8d6d8e commit 07f0a7b

File tree

4 files changed

+212
-44
lines changed

4 files changed

+212
-44
lines changed
+70
Loading

src/App.scss

+33-18
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,22 @@
66
}
77

88
.side-bar {
9-
display: flex;
10-
flex-direction: column;
11-
width: 15vw;
9+
width: 228px;
1210
height: 100vh;
1311
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1), 0 2px 5px rgba(0, 0, 0, 0.2);
12+
background-color: #103454;
13+
color: #f0f0f0;
14+
padding-left: 31px;
15+
background-image: url("./side-bar-background.svg");
16+
background-repeat: no-repeat;
17+
background-position: right bottom;
18+
background-size: auto 377px;
1419
}
1520

1621
.side-bar-header {
17-
display: flex;
18-
flex-direction: column;
19-
align-items: center;
2022
padding: 10px;
2123
color: whitesmoke;
22-
background-color: #2d383a;
23-
border-bottom: 5px solid crimson;
24+
margin-top: 50px;
2425
}
2526

2627
.side-bar-header {
@@ -32,6 +33,11 @@
3233

3334
.side-bar-body {
3435
padding-left: 10px;
36+
margin-top: 91px;
37+
.title {
38+
font-size: 20px;
39+
margin: 0;
40+
}
3541
}
3642

3743
#api-data {
@@ -40,14 +46,23 @@
4046
}
4147

4248
.api-link {
43-
margin-top: 10px;
44-
font-size: 12pt;
45-
transition: all 0.1s ease;
46-
padding-left: 10px;
47-
}
48-
49-
.api-link:hover {
50-
cursor: pointer;
51-
border-left: 5px solid crimson;
52-
transition: all 0.1s ease;
49+
font-size: 14px;
50+
margin-top: 12px;
51+
padding-left: 20px;
52+
position: relative;
53+
span {
54+
cursor: pointer;
55+
transition: font-weight 0.3s ease-in-out;
56+
&:hover {
57+
font-weight: 600;
58+
}
59+
}
60+
.indicator {
61+
width: 12.5px;
62+
height: 17px;
63+
background-color: white;
64+
display: inline-block;
65+
position: absolute;
66+
left: 0;
67+
}
5368
}

src/index.js

+47-26
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import SwaggerUI from "swagger-ui-react";
44
import "swagger-ui-react/swagger-ui.css";
55
import { RedocStandalone } from "redoc";
66
import "./App.scss";
7-
import logo from "./pilot_logo.png";
8-
import auth from "./swagger/auth.json"
7+
import auth from "./swagger/auth.json";
98
import bff from "./swagger/bff";
109
import bff_cli from "./swagger/bff_cli.json";
1110
import dataset from "./swagger/dataset.json";
@@ -23,39 +22,61 @@ const specs = {
2322
upload: upload,
2423
};
2524

25+
const options = [
26+
{
27+
title: "Auth",
28+
key: "auth",
29+
},
30+
{
31+
title: "BFF Web",
32+
key: "bff",
33+
},
34+
{
35+
title: "BFF CLI",
36+
key: "bff_cli",
37+
},
38+
{
39+
title: "Dataset",
40+
key: "dataset",
41+
},
42+
{
43+
title: "HPC",
44+
key: "hpc",
45+
},
46+
{
47+
title: "Metadata",
48+
key: "metadata",
49+
},
50+
{
51+
title: "Upload",
52+
key: "upload",
53+
},
54+
];
55+
2656
const App = () => {
2757
const [key, setKey] = useState("bff");
2858

2959
return (
3060
<div class="App">
3161
<div className="side-bar">
3262
<div className="side-bar-header">
33-
<img src={logo} alt="Logo" style={{ width: "100px" }} />
34-
<h3>Pilot Data Platform</h3>
63+
<img
64+
src={"api-docs/images/pilot-logo-data-platform.svg"}
65+
alt="Logo"
66+
style={{ width: "130px" }}
67+
/>
3568
</div>
3669
<div className="side-bar-body">
37-
<h3>API DOCS</h3>
38-
<div className="api-link" onClick={() => setKey("auth")}>
39-
Auth
40-
</div>
41-
<div className="api-link" onClick={() => setKey("bff")}>
42-
BFF Web
43-
</div>
44-
<div className="api-link" onClick={() => setKey("bff_cli")}>
45-
BFF CLI
46-
</div>
47-
<div className="api-link" onClick={() => setKey("dataset")}>
48-
Dataset
49-
</div>
50-
<div className="api-link" onClick={() => setKey("hpc")}>
51-
HPC
52-
</div>
53-
<div className="api-link" onClick={() => setKey("metadata")}>
54-
Metadata
55-
</div>
56-
<div className="api-link" onClick={() => setKey("upload")}>
57-
Upload
58-
</div>
70+
<h3 className="title">
71+
{" "}
72+
<span>API DOCS</span>{" "}
73+
</h3>
74+
{options.map((option) => (
75+
<div className="api-link" key={option.key}>
76+
{key === option.key && <div className="indicator"></div>}
77+
<span onClick={() => setKey(option.key)}>{option.title}</span>
78+
</div>
79+
))}
5980
</div>
6081
</div>
6182
<div id="api-data">

src/side-bar-background.svg

+62
Loading

0 commit comments

Comments
 (0)