mc-react-header 0.2.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/App.css CHANGED
@@ -1,38 +1,38 @@
1
- .App {
2
- text-align: center;
3
- }
4
-
5
- .App-logo {
6
- height: 40vmin;
7
- pointer-events: none;
8
- }
9
-
10
- @media (prefers-reduced-motion: no-preference) {
11
- .App-logo {
12
- animation: App-logo-spin infinite 20s linear;
13
- }
14
- }
15
-
16
- .App-header {
17
- background-color: #282c34;
18
- min-height: 100vh;
19
- display: flex;
20
- flex-direction: column;
21
- align-items: center;
22
- justify-content: center;
23
- font-size: calc(10px + 2vmin);
24
- color: white;
25
- }
26
-
27
- .App-link {
28
- color: #61dafb;
29
- }
30
-
31
- @keyframes App-logo-spin {
32
- from {
33
- transform: rotate(0deg);
34
- }
35
- to {
36
- transform: rotate(360deg);
37
- }
38
- }
1
+ .App {
2
+ text-align: center;
3
+ }
4
+
5
+ .App-logo {
6
+ height: 40vmin;
7
+ pointer-events: none;
8
+ }
9
+
10
+ @media (prefers-reduced-motion: no-preference) {
11
+ .App-logo {
12
+ animation: App-logo-spin infinite 20s linear;
13
+ }
14
+ }
15
+
16
+ .App-header {
17
+ background-color: #282c34;
18
+ min-height: 100vh;
19
+ display: flex;
20
+ flex-direction: column;
21
+ align-items: center;
22
+ justify-content: center;
23
+ font-size: calc(10px + 2vmin);
24
+ color: white;
25
+ }
26
+
27
+ .App-link {
28
+ color: #61dafb;
29
+ }
30
+
31
+ @keyframes App-logo-spin {
32
+ from {
33
+ transform: rotate(0deg);
34
+ }
35
+ to {
36
+ transform: rotate(360deg);
37
+ }
38
+ }
package/src/App.js CHANGED
@@ -1,23 +1,23 @@
1
- import "./App.css";
2
-
3
- import MaterialsCloudHeader from "./MaterialsCloudHeader";
4
-
5
- function App() {
6
- return (
7
- <div className="App">
8
- <MaterialsCloudHeader
9
- activeSection={"discover"} // see the corresponding key in MaterialsCloudHeader/Navbar.js
10
- breadcrumbsPath={[
11
- { name: "Discover", link: "https://www.materialscloud.org/discover" },
12
- { name: "Materials Cloud three-dimensional crystals database", link: "https://www.materialscloud.org/discover/mc3d" },
13
- { name: "test", link: null },
14
- ]}
15
- >
16
- <h3>Test content</h3>
17
- <p>Test content</p>
18
- </MaterialsCloudHeader>
19
- </div>
20
- );
21
- }
22
-
23
- export default App;
1
+ import "./App.css";
2
+
3
+ import MaterialsCloudHeader from "./MaterialsCloudHeader";
4
+
5
+ function App() {
6
+ return (
7
+ <div className="App">
8
+ <MaterialsCloudHeader
9
+ activeSection={"discover"} // see the corresponding key in MaterialsCloudHeader/Navbar.js
10
+ breadcrumbsPath={[
11
+ { name: "Discover", link: "https://www.materialscloud.org/discover" },
12
+ { name: "Materials Cloud three-dimensional crystals database", link: "https://www.materialscloud.org/discover/mc3d" },
13
+ { name: "test", link: null },
14
+ ]}
15
+ >
16
+ <h3>Test content</h3>
17
+ <p>Test content</p>
18
+ </MaterialsCloudHeader>
19
+ </div>
20
+ );
21
+ }
22
+
23
+ export default App;
package/src/App.test.js CHANGED
@@ -1,14 +1,14 @@
1
- import { render, screen } from "@testing-library/react";
2
- import App from "./App";
3
-
4
- test("renders learn link", () => {
5
- render(<App />);
6
- const linkElement = screen.getByText(/LEARN/i);
7
- expect(linkElement).toBeInTheDocument();
8
- });
9
-
10
- test("renders work link", () => {
11
- render(<App />);
12
- const linkElement = screen.getByText(/WORK/i);
13
- expect(linkElement).toBeInTheDocument();
14
- });
1
+ import { render, screen } from "@testing-library/react";
2
+ import App from "./App";
3
+
4
+ test("renders learn link", () => {
5
+ render(<App />);
6
+ const linkElement = screen.getByText(/LEARN/i);
7
+ expect(linkElement).toBeInTheDocument();
8
+ });
9
+
10
+ test("renders work link", () => {
11
+ render(<App />);
12
+ const linkElement = screen.getByText(/WORK/i);
13
+ expect(linkElement).toBeInTheDocument();
14
+ });
@@ -1,101 +1,97 @@
1
- /* Style the list */
2
- ul.mc-breadcrumb {
3
- padding: 7px 10px 7px 20px;
4
- list-style: none;
5
- background-color: #f5f5f5;
6
- border-radius: 2px;
7
- border: 1px solid #d6d6d6;
8
- font-size: 16px;
9
- font-weight: 300;
10
- font-family: "Open Sans", sans-serif;
11
- text-align: left;
12
- margin: 6px;
13
- margin-bottom: 20px;
14
- /* margin-top: 20px; */
15
- overflow: hidden;
16
- display: flex;
17
- flex-direction: row;
18
- /* flex-wrap: wrap; */
19
- /* gap: 40px; */
20
- justify-content: start;
21
- align-items: center;
22
- }
23
-
24
-
25
- /* Display list items side by side */
26
- ul.mc-breadcrumb li {
27
- display: inline;
28
- line-height: 1.0;
29
- margin-right: 46px;
30
- position: relative;
31
- }
32
-
33
- /* Add a color to all links inside the list */
34
- ul.mc-breadcrumb li a {
35
- color: #303f9f;
36
- text-decoration: none;
37
- /* position: relative; */
38
- /* padding: 0px 5px 0px 50px; */
39
- /* padding: 10px 0 10px 65px; */
40
- /* z-index: 3; */
41
- }
42
-
43
-
44
- /* Add a color on mouse-over, if the <a> has href defined */
45
- ul.mc-breadcrumb li a[href]:hover {
46
- text-decoration: underline;
47
- }
48
-
49
- /* prevent _reboot.scss from bootstrap to override this */
50
- ul.mc-breadcrumb li a:not([href]):hover {
51
- color: #303f9f;
52
- }
53
-
54
- .mc-breadcrumb li a::after {
55
- content: " ";
56
- display: block;
57
- width: 0;
58
- height: 0;
59
- border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */
60
- border-bottom: 50px solid transparent;
61
- border-left: 30px solid #f5f5f5;
62
- position: absolute;
63
- top: 50%;
64
- margin-top: -50px;
65
- /* left: 100%; */
66
- z-index: 2;
67
- right: 0;
68
- z-index: 2;
69
- transform: translate(30px, 0);
70
- }
71
-
72
- .mc-breadcrumb li a::before {
73
- content: " ";
74
- display: block;
75
- width: 0;
76
- height: 0;
77
- border-top: 50px solid transparent;
78
- border-bottom: 50px solid transparent;
79
- border-left: 30px solid #d6d6d6;
80
- position: absolute;
81
- top: 50%;
82
- margin-top: -50px;
83
- margin-left: 2px;
84
- /* left: 100%; */
85
- right: 0;
86
- z-index: 1;
87
- transform: translate(32px, 0);
88
- }
89
-
90
- .mc-breadcrumb li:last-child a {
91
- background: transparent !important;
92
- color: #303f9f;
93
- /* pointer-events: none;
94
- cursor: default; */
95
- }
96
- .mc-breadcrumb li:last-child a::after,
97
- .mc-breadcrumb li:last-child a::before {
98
- border: 0;
99
- display: none;
100
- }
101
-
1
+ /* Style the list */
2
+ ul.mc-breadcrumb {
3
+ padding: 7px 10px 7px 20px;
4
+ list-style: none;
5
+ background-color: #f5f5f5;
6
+ border-radius: 2px;
7
+ border: 1px solid #d6d6d6;
8
+ font-size: 16px;
9
+ font-family: "Open Sans", sans-serif;
10
+ text-align: left;
11
+ margin: 6px;
12
+ margin-bottom: 20px;
13
+ /* margin-top: 20px; */
14
+ overflow: hidden;
15
+ display: flex;
16
+ flex-direction: row;
17
+ /* flex-wrap: wrap; */
18
+ /* gap: 40px; */
19
+ justify-content: start;
20
+ align-items: center;
21
+ }
22
+
23
+ /* Display list items side by side */
24
+ ul.mc-breadcrumb li {
25
+ display: inline;
26
+ line-height: 1;
27
+ margin-right: 46px;
28
+ position: relative;
29
+ }
30
+
31
+ /* Add a color to all links inside the list */
32
+ ul.mc-breadcrumb li a {
33
+ color: #303f9f;
34
+ text-decoration: none;
35
+ /* position: relative; */
36
+ /* padding: 0px 5px 0px 50px; */
37
+ /* padding: 10px 0 10px 65px; */
38
+ /* z-index: 3; */
39
+ }
40
+
41
+ /* Add a color on mouse-over, if the <a> has href defined */
42
+ ul.mc-breadcrumb li a[href]:hover {
43
+ text-decoration: underline;
44
+ }
45
+
46
+ /* prevent _reboot.scss from bootstrap to override this */
47
+ ul.mc-breadcrumb li a:not([href]):hover {
48
+ color: #303f9f;
49
+ }
50
+
51
+ .mc-breadcrumb li a::after {
52
+ content: " ";
53
+ display: block;
54
+ width: 0;
55
+ height: 0;
56
+ border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */
57
+ border-bottom: 50px solid transparent;
58
+ border-left: 30px solid #f5f5f5;
59
+ position: absolute;
60
+ top: 50%;
61
+ margin-top: -50px;
62
+ /* left: 100%; */
63
+ z-index: 2;
64
+ right: 0;
65
+ z-index: 2;
66
+ transform: translate(30px, 0);
67
+ }
68
+
69
+ .mc-breadcrumb li a::before {
70
+ content: " ";
71
+ display: block;
72
+ width: 0;
73
+ height: 0;
74
+ border-top: 50px solid transparent;
75
+ border-bottom: 50px solid transparent;
76
+ border-left: 30px solid #d6d6d6;
77
+ position: absolute;
78
+ top: 50%;
79
+ margin-top: -50px;
80
+ margin-left: 2px;
81
+ /* left: 100%; */
82
+ right: 0;
83
+ z-index: 1;
84
+ transform: translate(32px, 0);
85
+ }
86
+
87
+ .mc-breadcrumb li:last-child a {
88
+ background: transparent !important;
89
+ color: #303f9f;
90
+ /* pointer-events: none;
91
+ cursor: default; */
92
+ }
93
+ .mc-breadcrumb li:last-child a::after,
94
+ .mc-breadcrumb li:last-child a::before {
95
+ border: 0;
96
+ display: none;
97
+ }
@@ -1,19 +1,15 @@
1
- import React from "react";
2
-
3
- import "./Breadcrumbs.css";
4
-
5
- function Breadcrumbs(props) {
6
- return (
7
- <ul className="mc-breadcrumb">
8
- {props.breadcrumbsPath.map((el, i) => {
9
- return (
10
- <li key={i}>
11
- <a href={el.link}>{el.name}</a>
12
- </li>
13
- );
14
- })}
15
- </ul>
16
- );
17
- }
18
-
19
- export default Breadcrumbs;
1
+ import "./Breadcrumbs.css";
2
+
3
+ const Breadcrumbs = ({ breadcrumbsPath }) => (
4
+ <ul className="mc-breadcrumb">
5
+ {breadcrumbsPath.map((el, i) => {
6
+ return (
7
+ <li key={i}>
8
+ <a href={el.link}>{el.name}</a>
9
+ </li>
10
+ );
11
+ })}
12
+ </ul>
13
+ );
14
+
15
+ export default Breadcrumbs;
@@ -1,129 +1,128 @@
1
- .mc-navbar {
2
- background-color: rgb(255, 255, 255);
3
- overflow: hidden;
4
- border-bottom: 3px solid #dee6e6;
5
- z-index: 10;
6
- font-family: "Open Sans", sans-serif;
7
- }
8
-
9
- .mc-navbar .mc-navbrand {
10
- float: left;
11
- display: block;
12
- text-align: center;
13
- font-size: 0px;
14
- padding: 7px 15px 5px 20px;
15
- /* border: 1px solid green; */
16
- }
17
-
18
- .mc-navbar .mc-navlink {
19
- float: left;
20
- display: block;
21
- color: #455860;
22
- font-size: 16px;
23
- line-height: 32px;
24
- font-weight: 700;
25
- text-align: center;
26
- padding: 14px 15px;
27
- text-decoration: none;
28
- /* border: 1px solid green; */
29
- }
30
-
31
- /* Change the color of links on hover */
32
- .mc-navbar a:hover {
33
- color: #8fa5af;
34
- }
35
-
36
- /* Add an active class to highlight the current page */
37
- .mc-navbar a.active {
38
- background-color: #fbfcfc;
39
- color: #cc1b30;
40
- }
41
-
42
- .more-dropdown {
43
- padding: 14px 0px;
44
- float: right;
45
- /* border: 1px solid rgb(128, 0, 0); */
46
- /* overflow: hidden; */
47
- }
48
-
49
- .more-btn {
50
- color: #455860;
51
- font-size: 16px;
52
- line-height: 32px;
53
- /* display: block; */
54
- text-decoration: none;
55
- font-weight: 700;
56
- cursor: pointer;
57
- text-align: center;
58
- padding: 21px 20px;
59
- /* border: 1px solid green; */
60
- /* margin: 0; Important for vertical align on mobile phones */
61
- user-select: none;
62
- }
63
-
64
- .dropdown-content {
65
- display: none;
66
- position: absolute;
67
- right: 0;
68
- background-color: #ffffff;
69
- min-width: 220px;
70
- border-radius: 6px;
71
- border: 2px solid #dee6e6;
72
- z-index: 100;
73
- padding: 5px 0px;
74
- }
75
-
76
- .dropdown-content a {
77
- float: none;
78
- color: #455860;
79
- font-weight: 300;
80
- padding: 10px 14px;
81
- text-decoration: none;
82
- display: block;
83
- text-align: left;
84
- font-size: 16px;
85
- line-height: 10px;
86
- z-index: 100;
87
- }
88
-
89
- .dropdown-content a:hover {
90
- background-color: #fbfcfc;
91
- }
92
-
93
- .dropdown-open {
94
- display: block;
95
- }
96
-
97
- /* Show the dropdown menu on hover */
98
- /* .more-dropdown:hover .dropdown-content {
99
- display: block;
100
- } */
101
-
102
- @media screen and (max-width: 680px) {
103
- /* .mc-navbar a.menu {
104
- float: right;
105
- display: block;
106
- border: 2px solid #455860;
107
- } */
108
- /* .mc-navbar {
109
- position: relative;
110
- } */
111
- .mc-navbar .mc-navlink {
112
- position: relative;
113
- float: none;
114
- display: block;
115
- text-align: left;
116
- padding: 2px 20px 2px;
117
- z-index: 10;
118
- }
119
- .mc-navbar .mc-navbrand {
120
- float: none;
121
- display: block;
122
- text-align: left;
123
- }
124
- .mc-navbar .more-dropdown {
125
- position: absolute;
126
- top: 0;
127
- right: 0;
128
- }
129
- }
1
+ .mc-navbar {
2
+ background-color: rgb(255, 255, 255);
3
+ overflow: hidden;
4
+ border-bottom: 3px solid #dee6e6;
5
+ z-index: 10;
6
+ font-family: "Open Sans", sans-serif;
7
+ }
8
+
9
+ .mc-navbar .mc-navbrand {
10
+ float: left;
11
+ display: block;
12
+ text-align: center;
13
+ font-size: 0px;
14
+ padding: 7px 15px 5px 20px;
15
+ /* border: 1px solid green; */
16
+ }
17
+
18
+ .mc-navbar .mc-navlink {
19
+ float: left;
20
+ display: block;
21
+ color: #455860;
22
+ font-size: 16px;
23
+ line-height: 32px;
24
+ font-weight: 700;
25
+ text-align: center;
26
+ padding: 14px 15px;
27
+ text-decoration: none;
28
+ /* border: 1px solid green; */
29
+ }
30
+
31
+ /* Change the color of links on hover */
32
+ .mc-navbar a:hover {
33
+ color: #8fa5af;
34
+ }
35
+
36
+ /* Add an active class to highlight the current page */
37
+ .mc-navbar a.active {
38
+ background-color: #fbfcfc;
39
+ color: #cc1b30;
40
+ }
41
+
42
+ .more-dropdown {
43
+ padding: 14px 0px;
44
+ float: right;
45
+ /* border: 1px solid rgb(128, 0, 0); */
46
+ /* overflow: hidden; */
47
+ }
48
+
49
+ .more-btn {
50
+ color: #455860;
51
+ font-size: 16px;
52
+ line-height: 32px;
53
+ /* display: block; */
54
+ text-decoration: none;
55
+ font-weight: 700;
56
+ cursor: pointer;
57
+ text-align: center;
58
+ padding: 21px 20px;
59
+ /* border: 1px solid green; */
60
+ /* margin: 0; Important for vertical align on mobile phones */
61
+ user-select: none;
62
+ }
63
+
64
+ .dropdown-content {
65
+ display: none;
66
+ position: absolute;
67
+ right: 0;
68
+ background-color: #ffffff;
69
+ min-width: 220px;
70
+ border-radius: 6px;
71
+ border: 2px solid #dee6e6;
72
+ z-index: 100;
73
+ padding: 5px 0px;
74
+ }
75
+
76
+ .dropdown-content a {
77
+ float: none;
78
+ color: #455860;
79
+ padding: 10px 14px;
80
+ text-decoration: none;
81
+ display: block;
82
+ text-align: left;
83
+ font-size: 16px;
84
+ line-height: 10px;
85
+ z-index: 100;
86
+ }
87
+
88
+ .dropdown-content a:hover {
89
+ background-color: #fbfcfc;
90
+ }
91
+
92
+ .dropdown-open {
93
+ display: block;
94
+ }
95
+
96
+ /* Show the dropdown menu on hover */
97
+ /* .more-dropdown:hover .dropdown-content {
98
+ display: block;
99
+ } */
100
+
101
+ @media screen and (max-width: 680px) {
102
+ /* .mc-navbar a.menu {
103
+ float: right;
104
+ display: block;
105
+ border: 2px solid #455860;
106
+ } */
107
+ /* .mc-navbar {
108
+ position: relative;
109
+ } */
110
+ .mc-navbar .mc-navlink {
111
+ position: relative;
112
+ float: none;
113
+ display: block;
114
+ text-align: left;
115
+ padding: 2px 20px 2px;
116
+ z-index: 10;
117
+ }
118
+ .mc-navbar .mc-navbrand {
119
+ float: none;
120
+ display: block;
121
+ text-align: left;
122
+ }
123
+ .mc-navbar .more-dropdown {
124
+ position: absolute;
125
+ top: 0;
126
+ right: 0;
127
+ }
128
+ }