Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

Commit 5e82289

Browse files
committed
feat: add version in header
1 parent 9bb7f40 commit 5e82289

File tree

5 files changed

+56
-13
lines changed

5 files changed

+56
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript-eslint-demo",
3-
"version": "1.0.0",
3+
"version": "0.0.2",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

src/components/Header.tsx

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,50 @@
11
import React from "react";
2+
import { Navbar, Badge } from "react-bootstrap";
23
import type { FC } from "react";
34
import "@/css/header.css";
45
import pkgJson from "../../package.json";
56

67
export const Header: FC = () => (
7-
<header>
8-
<h2 style={{ color: "#666" }}>TypeScript ESlint Demo</h2>
9-
<ul className="versions">
10-
<li>
11-
TypeScript-ESLint v
12-
{pkgJson.dependencies["@typescript-eslint/eslint-plugin"]}
13-
</li>
14-
<li>TypeScript v{pkgJson.dependencies["typescript"]}</li>
15-
</ul>
16-
</header>
8+
<Navbar bg="light">
9+
<Navbar.Brand>
10+
TypeScript ESLint Demo
11+
<Badge variant="secondary">v{pkgJson.version}</Badge>
12+
</Navbar.Brand>
13+
14+
<Navbar.Collapse className="justify-content-end">
15+
<Navbar.Text>
16+
<a
17+
className="github-button"
18+
href="https://github.com/yeonjuan/typescript-eslint-demo"
19+
data-icon="octicon-star"
20+
aria-label="Star yeonjuan/typescript-eslint-demo on GitHub"
21+
>
22+
Star
23+
</a>
24+
</Navbar.Text>
25+
<Navbar.Text>
26+
<a
27+
className="github-button"
28+
href="https://github.com/yeonjuan/typescript-eslint-demo/issues"
29+
data-icon="octicon-issue-opened"
30+
aria-label="Issue yeonjuan/typescript-eslint-demo on GitHub"
31+
>
32+
Issue
33+
</a>
34+
</Navbar.Text>
35+
<ul className="version-list">
36+
<li>
37+
<Navbar.Text className="version">
38+
TypeScript-ESLint v
39+
{pkgJson.dependencies["@typescript-eslint/eslint-plugin"]}
40+
</Navbar.Text>
41+
</li>
42+
<li>
43+
<Navbar.Text className="version">
44+
TypeScript v{pkgJson.dependencies["typescript"]}
45+
</Navbar.Text>
46+
</li>
47+
</ul>
48+
</Navbar.Collapse>
49+
</Navbar>
1750
);

src/css/app.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ main {
77
.row {
88
margin-top: 20px;
99
}
10+
.versions {
11+
float: right;
12+
}

src/css/header.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ header h2 {
77
margin: 0 0 10px;
88
padding: 0;
99
}
10+
ul {
11+
margin-bottom: 0;
12+
}
1013

11-
.versions {
12-
float: right;
14+
li {
15+
list-style: none;
16+
}
17+
.version {
18+
font-size: 10px;
1319
}

src/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
background: #fff;
2020
}
2121
</style>
22+
<script async defer src="https://buttons.github.io/buttons.js"></script>
2223
</head>
2324
<body>
2425
<div id="app"></div>

0 commit comments

Comments
 (0)