-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
505 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"siteId": "333362bb-34db-4636-8b8d-959ffcdf221e" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* /index.html 200 |
Binary file not shown.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { log } from 'util'; | ||
|
||
const Content = styled.div` | ||
display: grid; | ||
grid-template-rows: auto 1fr; | ||
max-width: 500px; | ||
width: 80%; | ||
min-height: 200px; | ||
box-shadow: rgba(0, 0, 0, 0.15) 0px 20px 40px; | ||
border-radius: 15px; | ||
overflow: hidden; | ||
background: white; | ||
margin: auto; | ||
p { | ||
padding: 20px; | ||
margin: 0; | ||
color: ${props => props.color}; | ||
} | ||
`; | ||
|
||
const InputWithButton = styled.div` | ||
display: grid; | ||
grid-template-rows: 1fr 40px; | ||
border-radius: 15px; | ||
overflow: hidden; | ||
background: white; | ||
button { | ||
border-radius: 0px; | ||
background: ${props => props.color}; | ||
} | ||
input, | ||
textarea { | ||
background: white; | ||
color: ${props => props.color}; | ||
border-radius: 0; | ||
display: block; | ||
text-align: center; | ||
width: 100%; | ||
&:focus { | ||
outline: none; | ||
} | ||
} | ||
textarea { | ||
resize: none; | ||
border: none; | ||
text-align: left; | ||
display: inline-block; | ||
width: 100%; | ||
margin: auto; | ||
font-weight: lighter; | ||
border-radius: 5px; | ||
text-align: center; | ||
} | ||
`; | ||
|
||
class AddCard extends React.Component { | ||
textRef = React.createRef(); | ||
|
||
handleClick = () => { | ||
let text = this.textRef.current.value; | ||
text && this.props.addStuff(text); | ||
this.textRef.current.value = ''; | ||
}; | ||
|
||
render() { | ||
return ( | ||
<Content color={this.props.color}> | ||
<p>{this.props.text}</p> | ||
<InputWithButton color={this.props.color}> | ||
<textarea ref={this.textRef} placeholder="Type here anything" /> | ||
<button onClick={this.handleClick}>Add</button> | ||
</InputWithButton> | ||
</Content> | ||
); | ||
} | ||
} | ||
|
||
export default AddCard; |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
const Card = styled.div` | ||
display: inline-block; | ||
box-shadow: rgba(0, 0, 0, 0.15) 0px 10px 20px; | ||
background: white; | ||
color: ${props => props.color}; | ||
border-radius: 15px; | ||
max-width: 80%; | ||
margin: ${props => props.margin}; | ||
p { | ||
padding: 10px; | ||
margin: 0; | ||
} | ||
`; | ||
|
||
class DisplayCard extends React.Component { | ||
handleRemove = () => { | ||
this.props.removeStuff(this.props.index); | ||
}; | ||
render() { | ||
return ( | ||
<Card color={this.props.color} onClick={this.handleRemove} margin={this.props.margin || 0}> | ||
<p>{this.props.text}</p> | ||
</Card> | ||
); | ||
} | ||
} | ||
|
||
export default DisplayCard; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
const Card = styled.div` | ||
display: inline-block; | ||
box-shadow: rgba(0, 0, 0, 0.15) 0px 10px 20px; | ||
background: white; | ||
color: ${props => props.color}; | ||
border-radius: 15px; | ||
max-width: 80%; | ||
margin: ${props => props.margin}; | ||
p { | ||
padding: 10px; | ||
margin: 0; | ||
} | ||
`; | ||
|
||
class GodDisplayCard extends React.Component { | ||
// handleRemove = () => { | ||
// this.props.index && this.props.removeStuff(this.props.index); | ||
// }; | ||
render() { | ||
return ( | ||
<Card color={this.props.color} margin={this.props.margin || 0}> | ||
<p>{this.props.text}</p> | ||
</Card> | ||
); | ||
} | ||
} | ||
|
||
export default GodDisplayCard; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React, { Component } from 'react'; | ||
import base from '../base'; | ||
import styled from 'styled-components'; | ||
import { goodColor, badColor } from '../utils/colors'; | ||
import GodDisplayCard from './GodDisplayCard'; | ||
|
||
const Cards = styled.div` | ||
padding: 1rem; | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: center; | ||
`; | ||
|
||
const Content = styled.div` | ||
padding: 1rem; | ||
.title { | ||
color: rgb(80, 80, 80); | ||
font-weight: lighter; | ||
} | ||
`; | ||
|
||
class GodMode extends Component { | ||
state = { | ||
firebase: {}, | ||
}; | ||
|
||
componentDidMount() { | ||
this.ref = base.bindToState('app', { | ||
context: this, | ||
state: 'firebase', | ||
asArray: false, | ||
then: () => console.log(this.state.firebase), | ||
}); | ||
} | ||
|
||
componentWillUnmount() { | ||
base.removeBinding(this.ref); | ||
} | ||
|
||
render() { | ||
const goods = Object.keys(this.state.firebase).map(person => this.state.firebase[person].good); | ||
const bads = Object.keys(this.state.firebase).map(person => this.state.firebase[person].bad); | ||
const good = [].concat(...goods); | ||
const bad = [].concat(...bads); | ||
|
||
return ( | ||
<Content> | ||
<h4 className="title">You are in God mode now 😇 Discuss with other Gods and make our lives better 🌞🦋🌸</h4> | ||
<Cards> | ||
{good.map(text => ( | ||
<GodDisplayCard text={text} color={goodColor} margin="10px" /> | ||
))} | ||
</Cards> | ||
<Cards> | ||
{bad.map(text => ( | ||
<GodDisplayCard text={text} color={badColor} margin="10px" /> | ||
))} | ||
</Cards> | ||
</Content> | ||
); | ||
} | ||
} | ||
|
||
export default GodMode; |
Oops, something went wrong.