Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Priscila Oliveira authored and Priscila Oliveira committed Nov 3, 2017
0 parents commit c2ffbd7
Show file tree
Hide file tree
Showing 48 changed files with 8,250 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"presets": [
[
"env",
{
"modules": false
}
],
"react",
"stage-0"
],
"plugins": [
"transform-object-rest-spread",
[
"module-resolver",
{
"root": [
"./"
],
"alias": {
"components": "./src/components",
"containers": "./src/containers",
"ducks": "./src/ducks",
"sagas": "./src/sagas"
}
}
]
],
"env": {
"production": {
"only": [
"src"
]
}
}
}
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# editorconfig.org

root = true

[*]
indent_style = tab
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.{sass,scss,json}]
indent_style = space
indent_size = 2

[*.js]
line_length=100
indent_style = tab

70 changes: 70 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"parser": "babel-eslint",
"extends": "airbnb",
"env": {
"browser": true,
"node": true,
"jest": true,
"es6": true
},
"plugins": [
"react",
"jsx-a11y"
],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"arrow-body-style": [2, "as-needed"],
"class-methods-use-this": 0,
"comma-dangle": [2, "only-multiline"],
"no-tabs": 0,
"import/imports-first": 0,
"import/newline-after-import": 0,
"import/no-dynamic-require": 0,
"import/no-extraneous-dependencies": 0,
"import/no-named-as-default": 0,
"import/no-unresolved": 0,
"import/extensions": 0,
"import/no-webpack-loader-syntax": 0,
"import/prefer-default-export": 0,
"indent": [
2,
"tab",
{
"SwitchCase": 1
}
],
"semi": ["error", "never"],
"jsx-a11y/aria-props": 2,
"jsx-a11y/heading-has-content": 0,
"jsx-a11y/href-no-hash": 2,
"jsx-a11y/label-has-for": 2,
"jsx-a11y/mouse-events-have-key-events": 2,
"jsx-a11y/role-has-required-aria-props": 2,
"jsx-a11y/role-supports-aria-props": 2,
"jsx-quotes": ["error", "prefer-single"],
"max-len": 0,
"newline-per-chained-call": 0,
"no-unused-expressions": ["error", { "allowTernary": true, "allowTaggedTemplates": true }],
"no-confusing-arrow": 0,
"no-console": 1,
"no-use-before-define": 0,
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
"prefer-template": 2,
"react/forbid-prop-types": 0,
"react/jsx-first-prop-new-line": [2, "multiline"],
"react/jsx-filename-extension": 0,
"react/jsx-no-target-blank": 0,
"react/require-default-props": 0,
"react/require-extension": 0,
"react/self-closing-comp": 0,
"react/jsx-indent": [2, "tab"],
"react/jsx-indent-props": [2, "tab"],
"require-yield": 0
}
}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### JS ###
coverage/
node_modules/
dist/
*.log

### Intellij ###
.idea/
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: npm run heroku:start
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"# random-quotes"
80 changes: 80 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"name": "random-quotes",
"version": "1.0.0",
"private": true,
"description": "Random quotes app built with React, Redux-Saga and Firebase",
"main": "index.js",
"repository": "https://github.com/priscilawebdev/random-quotes.git",
"author": "Priscila Oliveira <priscilawebdev@gmail.com>",
"license": "UNLICENSED",
"dependencies": {
"babel-polyfill": "^6.26.0",
"bootstrap-sass": "^3.3.7",
"chalk": "^2.2.0",
"express": "^4.16.2",
"firebase": "^4.6.0",
"glamor": "^2.20.40",
"glamorous": "^4.10.0",
"history": "^4.7.2",
"intl": "^1.2.5",
"node-sass": "^4.5.3",
"prop-types": "^15.6.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-intl": "^2.4.0",
"react-loadable": "^5.3.1",
"react-redux": "^5.0.6",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-router-redux": "5.0.0-alpha.6",
"redux": "^3.7.2",
"redux-action-buffer": "^1.1.0",
"redux-persist": "4.10.1",
"redux-saga": "^0.16.0",
"redux-saga-firebase": "^0.6.1",
"rimraf": "^2.6.2"
},
"devDependencies": {
"babel-cli": "6.24.1",
"babel-eslint": "7.2.3",
"babel-loader": "^7.1.2",
"babel-plugin-dynamic-import-node": "^1.1.0",
"babel-plugin-module-resolver": "^2.7.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
"babel-preset-env": "1.5.1",
"babel-preset-react": "6.16.0",
"babel-preset-react-hmre": "^1.1.1",
"babel-preset-stage-0": "6.16.0",
"baggage-loader": "^1.0.0",
"circular-dependency-plugin": "^4.2.0",
"compression-webpack-plugin": "^1.0.1",
"copy-webpack-plugin": "^4.2.0",
"css-loader": "0.25.0",
"eslint": "3.19.0",
"eslint-config-airbnb": "15.0.1",
"eslint-config-airbnb-base": "11.2.0",
"eslint-plugin-import": "2.7.0",
"eslint-plugin-jsx-a11y": "5.0.3",
"eslint-plugin-react": "7.0.1",
"eslint-watch": "^3.1.2",
"extract-text-webpack-plugin": "2.1.0",
"file-loader": "0.11.1",
"html-webpack-plugin": "^2.30.1",
"image-webpack-loader": "^3.4.2",
"sass-loader": "^6.0.6",
"style-loader": "0.16.1",
"webpack": "^3.8.1",
"webpack-hot-middleware": "^2.20.0",
"webpack-merge": "^4.1.0"
},
"scripts": {
"start": "webpack-dev-server --inline --hot --colors --progress --open --config webpack.dev.js",
"build": "npm run clean && webpack --config webpack.prod.js",
"postbuild": "node ./server.js",
"clean": "rimraf ./dist/*",
"lint": "eslint ./src",
"lint:watch": "esw --watch ./src",
"heroku:start": "node ./server.js",
"postinstall": "npm run clean && webpack --config webpack.prod.js"
}
}
Binary file added public/favicon.ico
Binary file not shown.
21 changes: 21 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">

<link rel="manifest" href="/manifest.json">
<link rel="shortcut icon" href="/favicon.ico" />

<title>Random Quotes</title>
</head>
<body>
<noscript>You must enable <strong>JavaScript</strong> to use this app!</noscript>
<div id="root"></div>
<!-- Caveat Font -->
<link href="https://fonts.googleapis.com/css?family=Caveat:400" rel="stylesheet">
<!-- Roboto Font -->
<link href="https://fonts.googleapis.com/css?family=Roboto:400" rel="stylesheet">
</body>
</html>
15 changes: 15 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"short_name": "Random Quotes",
"name": "Random Quotes, built with React, Redux-Saga and Firebase",
"icons": [
{
"src": "favicon.ico",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
16 changes: 16 additions & 0 deletions src/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* eslint-disable no-underscore-dangle */
import firebase from 'firebase'
import ReduxSagaFirebase from 'redux-saga-firebase'

const myFirebaseApp = firebase.initializeApp({
apiKey: 'AIzaSyC0GJrWfjPI3ihl3bsZajgOaU_8ETuh0vc',
authDomain: 'random-quotes-d464b.firebaseapp.com',
databaseURL: 'https://random-quotes-d464b.firebaseio.com',
projectId: 'random-quotes-d464b',
storageBucket: 'random-quotes-d464b.appspot.com',
messagingSenderId: '102722321201'
})

const reduxSagaFirebase = new ReduxSagaFirebase(myFirebaseApp)

export default reduxSagaFirebase
1 change: 1 addition & 0 deletions src/components/Heart/img/icon-heart-empty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/Heart/img/icon-heart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions src/components/Heart/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import PropTypes from 'prop-types'
import glamorous from 'glamorous'

import imgHeart from './img/icon-heart.svg'
import imgHeartEmpty from './img/icon-heart-empty.svg'

const Heart = glamorous.span({
height: '15',
width: '14',
display: 'inline-block',
position: 'absolute',
top: 2,
cursor: 'pointer'
}, ({ full = false }) => ({
backgroundImage: `url(${full ? imgHeart : imgHeartEmpty})`
}))

Heart.propTypes = {
full: PropTypes.bool.isRequired
}


export default Heart
15 changes: 15 additions & 0 deletions src/components/Screen/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react'
import PropTypes from 'prop-types'

const Screen = ({ children }) => (
<div className='Screen'>
{children}
</div>
)

Screen.propTypes = {
children: PropTypes.node.isRequired
}


export default Screen
8 changes: 8 additions & 0 deletions src/components/Screen/index.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.Screen
position: relative
flex: 1 0 auto
justify-content: center
display: flex
flex-direction: column
padding: 0
height: 100%
1 change: 1 addition & 0 deletions src/components/Spinner/img/loading.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/components/Spinner/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react'

export const Spinner = () => (
<div className='Spinner Spinner--centered' />
)

export default Spinner
27 changes: 27 additions & 0 deletions src/components/Spinner/index.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.Spinner
position: relative
text-align: center
margin: 0 auto
width: 38px
display: block
&:after
content: ""
display: block
padding-bottom: 100%
background: url(./img/loading.svg) center center no-repeat
size: cover
animation-name: spin
animation-duration: 750ms
animation-iteration-count: infinite
animation-timing-function: linear

.Spinner--lg
width: 100%
&:after
animation-duration: 1200ms

.Spinner--centered
position: absolute
top: 50%
left: 50%

Empty file added src/containers/About/index.js
Empty file.
18 changes: 18 additions & 0 deletions src/containers/App/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react'
import Switch from 'react-router-dom/Switch'
import Route from 'react-router-dom/Route'

import Screen from 'components/Screen'
import HomePage from 'containers/HomePage/Loadable'

export default function App() {
return (
<div className='AppWrapper'>
<Screen>
<Switch>
<Route exact path='/' component={HomePage} />
</Switch>
</Screen>
</div>
)
}
Loading

0 comments on commit c2ffbd7

Please sign in to comment.