File tree Expand file tree Collapse file tree 2 files changed +45
-2
lines changed Expand file tree Collapse file tree 2 files changed +45
-2
lines changed Original file line number Diff line number Diff line change
1
+ import React from "react" ;
2
+ import styled from "styled-components" ;
3
+
4
+ const Container = styled . div `
5
+ margin: 2em 0;
6
+ position: sticky;
7
+ top: 1em;
8
+ ` ;
9
+
10
+ const Item = styled . div `
11
+ padding: 0.4em 0.8em;
12
+ color: #111;
13
+ border-bottom: 1px solid #0002;
14
+ cursor: pointer;
15
+
16
+ &:hover {
17
+ transition: 100ms;
18
+ background: #0001;
19
+ color: #0972d4;
20
+ }
21
+ ` ;
22
+
23
+ export function SideBar ( ) {
24
+ return (
25
+ < Container >
26
+ < Item > Item 1</ Item >
27
+ < Item > Item 2</ Item >
28
+ </ Container >
29
+ ) ;
30
+ }
Original file line number Diff line number Diff line change 1
1
import Head from "next/head" ;
2
2
import React from "react" ;
3
+ import styled from "styled-components" ;
3
4
import { CenterContainer } from "../components/CenterContainer" ;
4
5
import { NavBar } from "../components/NavBar" ;
6
+ import { SideBar } from "../components/SideBar" ;
7
+
8
+ const Container = styled . div `
9
+ display: grid;
10
+ gap: 2em;
11
+ grid-template-columns: 250px 1fr;
12
+ ` ;
5
13
6
14
export default function Home ( ) {
7
15
return (
8
16
< >
9
17
< NavBar />
10
18
< CenterContainer style = { { margin : "2em 0" } } >
11
- < h2 > Welcome to the docs!</ h2 >
12
- < p > Here you can find the docs</ p >
19
+ < Container >
20
+ < SideBar />
21
+ < div >
22
+ < h2 > Welcome to the docs!</ h2 >
23
+ < p > Here you can find the docs</ p >
24
+ </ div >
25
+ </ Container >
13
26
</ CenterContainer >
14
27
</ >
15
28
) ;
You can’t perform that action at this time.
0 commit comments