-
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.
Merge pull request #20 from yannick1691/dev
Fixed language
- Loading branch information
Showing
12 changed files
with
216 additions
and
29 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
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
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
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,69 @@ | ||
import { h, Component } from 'preact'; | ||
import style from './style'; | ||
import base from '../../base'; | ||
import TeamCard from '../../components/teamCard'; | ||
import CreateTeam from '../../components/createTeam'; | ||
|
||
export default class Settings extends Component { | ||
constructor() { | ||
super(); | ||
|
||
this.removeTeam = this.removeTeam.bind(this); | ||
this.addTeam = this.addTeam.bind(this); | ||
} | ||
|
||
state = { | ||
teams: {} | ||
} | ||
|
||
componentWillMount(nextProps, nextState){ | ||
this.ref = base.syncState(`users/${this.props.uuid}/teams`, { | ||
context: this, | ||
state: 'teams' | ||
}); | ||
} | ||
|
||
|
||
componentWillUpdate(nextProps, nextState){ | ||
this.ref = base.syncState(`users/${this.props.uuid}/teams`, { | ||
context: this, | ||
state: 'teams' | ||
}); | ||
} | ||
|
||
componentWillUnmount() { | ||
base.removeBinding(this.ref); | ||
} | ||
|
||
removeTeam = (key) => { | ||
const teams = { ...this.state.teams }; | ||
teams[key] = null; | ||
this.setState({ teams }); | ||
base.remove(`teams/${key}/members/${this.props.uuid}`); | ||
}; | ||
|
||
addTeam(team) { | ||
// update our state | ||
const teams = { ...this.state.teams }; | ||
// Add in our team | ||
teams[team.name] = true; | ||
// set state | ||
this.setState({ teams }); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div class={style.content}> | ||
<h2>teams</h2> | ||
<div class={style.teamsContent}> | ||
{ | ||
Object | ||
.keys(this.state.teams) | ||
.map(key => <TeamCard removeTeam={this.removeTeam} key={key} index={key} />) | ||
} | ||
<CreateTeam uuid={this.props.uuid} addTeam={this.addTeam} /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} |
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,93 @@ | ||
.content{ | ||
display: block; | ||
width: 100%; | ||
} | ||
|
||
.content h2{ | ||
text-align: center; | ||
} | ||
|
||
.teamsContent{ | ||
display: flex; | ||
justify-content: space-around; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.cardWrap{ | ||
display: inline-block; | ||
width: 20%; | ||
min-width: 300px; | ||
margin: 5px; | ||
} | ||
|
||
.cardWrap h1{ | ||
font-size: 25px; | ||
text-transform: uppercase; | ||
color: white; | ||
} | ||
|
||
.cardBackcolor{ | ||
background: #9c27b0; | ||
color: white; | ||
margin-left: -16px; | ||
margin-top: -16px; | ||
margin-right: -16px; | ||
margin-bottom: -16px; | ||
height: 175px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 16px; | ||
} | ||
|
||
.buttonSubmit{ | ||
font-family: Roboto, sans-serif; | ||
-moz-osx-font-smoothing: grayscale; | ||
-webkit-font-smoothing: antialiased; | ||
font-size: 0.875rem; | ||
font-weight: 500; | ||
letter-spacing: 0.04em; | ||
line-height: 2.25rem; | ||
text-decoration: none; | ||
text-transform: uppercase; | ||
display: inline-block; | ||
position: relative; | ||
-webkit-box-sizing: border-box; | ||
box-sizing: border-box; | ||
min-width: 88px; | ||
height: 36px; | ||
padding: 0 16px; | ||
border: none; | ||
outline: none; | ||
text-align: center; | ||
-webkit-user-select: none; | ||
-moz-user-select: none; | ||
-ms-user-select: none; | ||
user-select: none; | ||
-webkit-appearance: none; | ||
overflow: hidden; | ||
vertical-align: middle; | ||
border-radius: 2px; | ||
color: white; | ||
} | ||
|
||
.teamInput{ | ||
height: 35px; | ||
width: 142px; | ||
margin-left: 0px; | ||
margin-right: 8px; | ||
padding: 5px 10px; | ||
border: none; | ||
border-bottom: 2px solid #eee; | ||
background: none; | ||
color: #333; | ||
font-size: 15px; | ||
} | ||
|
||
.teamInput:focus{ | ||
border: none; | ||
outline: none; | ||
border-bottom: 2px solid #9c27b0; | ||
color: #9c27b0; | ||
} |