Skip to content

Commit d9c2c39

Browse files
Fixing poster layout with new PosterLayout in Navigation.js. Adding back hi_tea.png which seemed to be absent...
1 parent 084c8df commit d9c2c39

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

public/assets/hi_tea.png

105 KB
Loading

src/App.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,9 @@
11
import React, { Component } from "react";
22

3-
import Background from "./Background";
4-
53
class App extends Component {
64
render() {
7-
const { width, height } = this.props.size;
8-
{/*
9-
return (
10-
<div className="App">
11-
<Background width={width} height={height} />
12-
<h1 className="center w-100">SIGGRAPH @ UIUC</h1>
13-
</div>
14-
);
15-
*/}
165
return (
17-
<div style={{ height: '100%', position: 'absolute', left: '0px', width: '100%', overflow: 'hidden'}}>
18-
<center>
19-
<img className="poster" style ={{paddingbottom:'500px', height: '90%', width: '100%'}} src="/siggraph/assets/hi_tea.png" alt="hi tea poster" />
20-
</center>
21-
</div>
22-
6+
<img className="poster" style ={{width: '100%'}} src={process.env.PUBLIC_URL + '/assets/hi_tea.png'} alt="hi tea poster" />
237
);
248
}
259
}

src/Navigation.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ class Navigation extends Component {
3434
return (
3535
<Router basename="/"> {/* When using HashRouter, we don't need the public URL as a basename */}
3636
<Switch>
37-
<DefaultLayout exact path="/" component={App} size={this.state} />
37+
{/*
38+
PosterLayout is like DefaultLayout but without a Container component. This allows the poster to stretch
39+
the full length of the screen. When the front page has a poster, use PosterLayout for App. Otherwise
40+
use DefaultLayout.
41+
*/}
42+
<PosterLayout exact path="/" component={App} size={this.state} />
3843
<DefaultLayout
3944
path="/projects"
4045
component={Projects}
@@ -72,6 +77,23 @@ const DefaultLayout = ({ component: Component, size, ...rest }) => {
7277
);
7378
};
7479

80+
const PosterLayout = ({ component: Component, size, ...rest }) => {
81+
return (
82+
<Route
83+
{...rest}
84+
render={matchProps => (
85+
<>
86+
<div className="main-container">
87+
<Header />
88+
<Component {...matchProps} size={size} />
89+
<Footer />
90+
</div>
91+
</>
92+
)}
93+
/>
94+
);
95+
};
96+
7597
const Construction = () => <h1>This page is under construction</h1>;
7698

7799
const NotFound = () => (

0 commit comments

Comments
 (0)