forked from moulik-deepsource/demo-javascript
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathNavComponent.js
More file actions
53 lines (48 loc) · 1.02 KB
/
NavComponent.js
File metadata and controls
53 lines (48 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import Link from "next/link";
import styled from "styled-components";
import { Head } from "next/document";
/** next-link-passhref */
const RedLink = styled.a`
color: red;
`;
function NavLink({ href, name }) {
// Must add passHref to Link
return (
<Link href={href}>
<RedLink>{name}</RedLink>
</Link>
);
}
export default NavLink;
/** next-no-css-tags */
export class NavBar extends Head {
render() {
return (
<div>
<h1>Hello title</h1>
<link href="/_next/static/css/styles.css" rel="stylesheet" />
</div>
);
}
}
/** no-title-in-document-head */
export class NavMenu {
render() {
return (
<Head>
<title>My page title</title>
</Head>
);
}
}
/** no-unwanted-polyfillio */
export class NavCard extends Head {
render() {
return (
<div>
<h1>Hello title</h1>
<script src="https://polyfill.io/v3/polyfill.min.js?features=WeakSet%2CPromise%2CPromise.prototype.finally%2Ces2015%2Ces5%2Ces6"></script>
</div>
);
}
}