Skip to content

Commit f6688e4

Browse files
committed
add Header component
1 parent 068a56b commit f6688e4

21 files changed

Lines changed: 197 additions & 16 deletions

File tree

src/assets/scss/variables.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// colors
2-
$accent-color: #bc8cf2;
3-
$accent-hover-color: #aa14f0;
2+
$accent-color-pale: #bc8cf2;
3+
$accent-color: #aa14f0;
44
$border-color: #aaa;
55
$back-color: #eee;
66
$back-hover-color: #ddd;

src/components/App/index.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.app {
2+
max-width: 600px;
3+
margin: 0 auto;
4+
}

src/components/App/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import Header from "../Header";
2+
import ProjectList from "../ProjectsList";
23
import { FunctionComponent } from "react";
4+
import "./index.scss";
5+
import MainConfig from "../../config/Main";
36

47
const App: FunctionComponent = () => {
58
return (
69
<div className="app">
710
<Header />
11+
<ProjectList projects={MainConfig.projects} />
812
</div>
913
);
1014
};

src/components/Header/index.scss

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
@import "../../assets/scss/variables.scss";
22

33
.header {
4-
4+
text-align: center;
5+
padding: 16px 0;
6+
7+
&__logo {
8+
font: 42px/150% Pacifico;
9+
color: $accent-color;
10+
}
11+
12+
&__links {
13+
list-style: none;
14+
display: flex;
15+
justify-content: center;
16+
}
17+
18+
&__link {
19+
margin: 0 8px;
20+
}
521
}

src/components/Header/index.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
import "./index.scss";
22
import { FunctionComponent } from "react";
3+
import Link from "../Link";
34

45
const Header: FunctionComponent = () => {
5-
return <header className="header"></header>;
6+
return (
7+
<header className="header">
8+
<h1 className="header__logo">Module Art</h1>
9+
<ul className="header__links">
10+
<li className="header__link">
11+
<Link text="Quick Picture Viewer" href="" />
12+
</li>
13+
<li className="header__link">
14+
<Link text="GitHub" href="" />
15+
</li>
16+
</ul>
17+
</header>
18+
);
619
};
720

821
export default Header;

src/components/Link/Props.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
interface Props {
2+
text: string;
3+
href: string;
4+
}
5+
6+
export default Props;

src/components/Link/index.scss

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@import "../../assets/scss/variables.scss";
2+
3+
.link {
4+
display: inline-block;
5+
text-decoration: none;
6+
color: $accent-color;
7+
position: relative;
8+
9+
&::before {
10+
content: "";
11+
position: absolute;
12+
top: 100%;
13+
left: 0;
14+
width: 0;
15+
height: 2px;
16+
background: $accent-color;
17+
transition: width $animation-duration;
18+
}
19+
20+
&:hover {
21+
&::before {
22+
width: 100%;
23+
}
24+
}
25+
}

src/components/Link/index.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import "./index.scss";
2+
import { FunctionComponent } from "react";
3+
import Props from "./Props";
4+
5+
const Link: FunctionComponent<Props> = ({ text, href }) => {
6+
return (
7+
<a className="link" href={href}>
8+
{text}
9+
</a>
10+
);
11+
};
12+
13+
export default Link;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
interface Props {
2+
title: string;
3+
href: string;
4+
imageUrl: string;
5+
}
6+
7+
export default Props;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.project-card {
2+
background: #eee;
3+
}

0 commit comments

Comments
 (0)