This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
class ThemeSwitcher extends Component { | |
state = { theme: null } | |
resetTheme = evt => { | |
evt.preventDefault(); | |
this.setState({ theme: null }); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { SplitButton, MenuItem } from 'react-bootstrap'; | |
class ThemeSwitcher extends Component { | |
state = { theme: null } | |
chooseTheme = (theme, evt) => { | |
evt.preventDefault(); | |
if (theme.toLowerCase() === 'reset') { theme = null } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'bootstrap/dist/css/bootstrap.min.css'; | |
import 'bootstrap/dist/css/bootstrap-theme.min.css'; | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './index.css'; | |
import App from './App'; | |
import ThemeSwitcher from './ThemeSwitcher'; | |
import registerServiceWorker from './registerServiceWorker'; | |
ReactDOM.render(<ThemeSwitcher />, document.getElementById('root')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { Button, ButtonDropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap'; | |
class ThemeSwitcher extends Component { | |
state = { theme: null, dropdownOpen: false } | |
toggleDropdown = () => { | |
this.setState({ dropdownOpen: !this.state.dropdownOpen }); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'bootstrap/dist/css/bootstrap.min.css'; | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './index.css'; | |
import App from './App'; | |
import ThemeSwitcher from './ThemeSwitcher'; | |
import registerServiceWorker from './registerServiceWorker'; | |
ReactDOM.render(<ThemeSwitcher />, document.getElementById('root')); | |
registerServiceWorker(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import logo from '../logo.svg'; | |
import { | |
Container, Row, Col, Form, Input, Button, Navbar, Nav, | |
NavbarBrand, NavLink, NavItem, UncontrolledDropdown, | |
DropdownToggle, DropdownMenu, DropdownItem | |
} from 'reactstrap'; | |
const AVATAR = 'https://www.gravatar.com/avatar/429e504af19fc3e1cfa5c4326ef3394c?s=240&d=mm&r=pg'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Fragment } from 'react'; | |
import { | |
Button, UncontrolledAlert, Card, CardImg, CardBody, | |
CardTitle, CardSubtitle, CardText | |
} from 'reactstrap'; | |
const BANNER = 'https://i.imgur.com/CaKdFMq.jpg'; | |
const SideCard = () => ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component, Fragment } from 'react'; | |
import axios from 'axios'; | |
import { Badge } from 'reactstrap'; | |
class Post extends Component { | |
state = { post: null } | |
componentDidMount() { | |
axios.get('https://baconipsum.com/api/?type=meat-and-filler¶s=4&format=text') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Fragment } from 'react'; | |
import axios from 'axios'; | |
import { Container, Row, Col } from 'reactstrap'; | |
import Post from './components/Post'; | |
import Header from './components/Header'; | |
import SideCard from './components/SideCard'; | |
const App = () => ( | |
<Fragment> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(100 + 50); // 150 | |
console.log(100 - 50); // 50 | |
console.log('100' + 50); // "10050" | |
console.log('100' - 50); // 50 | |
console.log(null + 50); // 50 | |
console.log(null - 50); // -50 | |
console.log(void 0 + 50); // NaN |