Skip to content

Instantly share code, notes, and snippets.

@ryanjyost
Last active May 8, 2019 12:40
Show Gist options
  • Select an option

  • Save ryanjyost/97b693bbfe079f348e6fd0b396411d2a to your computer and use it in GitHub Desktop.

Select an option

Save ryanjyost/97b693bbfe079f348e6fd0b396411d2a to your computer and use it in GitHub Desktop.
App.js #1 in React Responsive Tutorial
import React, { Component } from "react";
import TopBar from "./components/TopBar";
import FooterMenu from "./components/FooterMenu";
import Content from "./components/Content";
class App extends Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
const styles = {
white: (opacity = 1) => `rgba(255, 255, 255, ${opacity})`,
black: (opacity = 1) => `rgba(0, 0, 0, ${opacity})`,
topBarHeight: 40,
footerMenuHeight: 50
};
const menuItems = [
{ icon: `πŸ˜€`, text: "Item 1" },
{ icon: `πŸ˜‰`, text: "Item 2" },
{ icon: `😎`, text: "Item 3" },
{ icon: `πŸ€”`, text: "Item 4" },
{ icon: `πŸ˜›`, text: "Item 5" }
];
return (
<div
style={{
backgroundColor: styles.black(0.05),
minHeight: "100vh",
position: "relative"
}}
>
<TopBar styles={styles} />
<Content styles={styles} />
<FooterMenu menuItems={menuItems} styles={styles} />
</div>
);
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment