Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Firebase #5

Merged
merged 4 commits into from
Apr 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
firebase*
*.swo
*.swp
.firebase*
17 changes: 17 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"hosting":{
"public": "build" ,
"headers": [
{
"source": "/service-worker.js",
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never Caches Service Worker .js facebook/create-react-app#2440

"headers": [
{"key": "Cache-Control", "value": "no-cache"}
]}
],
"rewrites": [{
"source": "**",
"destination": "/index.html"
}]
}
}

4 changes: 0 additions & 4 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,9 @@ class App extends Component {
uri: "https://api.rss2json.com/v1/api.json?rss_url=https%3A%2F%2Fmedium.com%2Ffeed%2Fwwwid",
feed: [],
isLoad: false,
query: this.filters
}
}

filters(param){
//console.log(this.state.feed)
}
componentDidMount(){
this.fetchCache()
}
Expand Down
15 changes: 7 additions & 8 deletions src/Component/AppContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ export const getContext = Components =>
return (
<AppContext.Consumer>
{ data =>{
let { match } = this.props
let { params } = match
let { feed } = data

if( Object.keys(params).length === 1 && 'items' in feed){
let { match } = this.props,
{ params } = match,
{ feed } = data

if( Object.keys(params).length === 1 &&
'items' in feed){
data = filter(params, data)
data.single = 'slug' in params ? true:false
}

else {
}else {
data.feed.filter = false
data.single = 'slug' in params ? true:false
}
Expand Down
5 changes: 3 additions & 2 deletions src/Component/Slugify.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ const toSlug = text => {
return text.toString().toLowerCase()
.replace(/\s+/g, '-')
.replace(/&/g, '-and-')
.replace(/[^\w/\-]+/g, '')
.replace(/\-\-+/g, '-')
.replace(/[^\w/\\-]+/g, '')
.replace(/\/-\/-+/g, '-')
.replace(/\x2f/, '-') // change from / to -
}

export default toSlug
2 changes: 1 addition & 1 deletion src/Component/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const logoList = [

const IconList = props => {
return (
<li keys>
<li>
<a href={props.uri} rel="noopener" target="_blank" alt={props.uri}>
<Icon {...props}></Icon>
</a>
Expand Down