Skip to content

Commit ffc59ee

Browse files
committed
scrollable to article
1 parent 30f73fe commit ffc59ee

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/App.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ const Navigation = styled.nav`
1111
margin: 30px;
1212
`;
1313

14+
const Article = styled.div`
15+
overflow-y: scroll;
16+
height: 100vh;
17+
`;
18+
1419
const Anchor = styled.a`
1520
display: block;
1621
margin-bottom: 10px;
@@ -25,11 +30,6 @@ const Anchor = styled.a`
2530
: null};
2631
`;
2732

28-
const Scrollable = styled.div`
29-
overflow-y: scroll;
30-
height: 100vh;
31-
`;
32-
3333
class App extends Component {
3434
constructor(props) {
3535
super(props);
@@ -112,7 +112,7 @@ class App extends Component {
112112
))}
113113
</Navigation>
114114

115-
<Scrollable ref={this.rootRef}>
115+
<Article ref={this.rootRef}>
116116
{this.state.things.map(thing => (
117117
<div
118118
key={thing.id}
@@ -123,7 +123,7 @@ class App extends Component {
123123
<p>{thing.text}</p>
124124
</div>
125125
))}
126-
</Scrollable>
126+
</Article>
127127
</Horizontal>
128128
);
129129
}

0 commit comments

Comments
 (0)