This file contains 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'; | |
export default class SampleClass extends Component { | |
constructor(props) { | |
super(props) | |
} | |
componentDidMount() { | |
//this is action, and you need to set up bindActionCreators if you wanna use action directory. | |
this.props.fetchDogApi() |
This file contains 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
render() { | |
const maxWidth = '1024px'; | |
const transition = '.5s'; | |
return ( | |
<div> | |
<Style> | |
{ | |
` | |
body { | |
margin: 0; |
This file contains 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
body { | |
margin: 0; | |
} | |
.nav-item { | |
padding: 1rem; | |
background: #CCC; | |
color: #222; | |
} |
This file contains 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
... | |
"webpack": "^2.1.0-beta.28", | |
"webpack-dev-server": "^2.1.0-beta.0" | |
... |
This file contains 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
const webpack = require('webpack'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const path = require('path'); | |
module.exports = { | |
entry: [ | |
'./index.js', | |
'./ejs/index.ejs', | |
'./ejs/detail.ejs' | |
], |
This file contains 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 classNames from 'classnames'; | |
import Image1 from '../../img/book1.png'; | |
import Image2 from '../../img/book2.png'; | |
import Image3 from '../../img/book3.png'; | |
import Media1 from '../../img/media1.png'; | |
import Media2 from '../../img/media2.png'; | |
import github1 from '../../img/github1.png'; | |
import github2 from '../../img/github2.png'; | |
import github3 from '../../img/github3.png'; |
This file contains 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
class Test { | |
constructor(options) { | |
this.options = Object.assign({ | |
elem: '#app', | |
time: 1000, | |
animate: 'normal' | |
}, options) | |
... | |
} | |
... |
This file contains 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
RewriteEngine on | |
# Don't rewrite files or directories | |
RewriteCond %{REQUEST_FILENAME} -f [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^ - [L] | |
# Redirect http://www. to just http:// | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] |