Skip to content

Commit

Permalink
Merge pull request #4 from WarsawLO/hackaton/addToGoogle
Browse files Browse the repository at this point in the history
Feature - add recruitment reminder to google calendar
  • Loading branch information
micorix committed Nov 23, 2019
2 parents bd5d14c + 666d4a7 commit b197463
Show file tree
Hide file tree
Showing 78 changed files with 1,825 additions and 1,611 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ yarn-error.log
.pnp.js
# Yarn Integrity file
.yarn-integrity
.idea
152 changes: 77 additions & 75 deletions src/components/Acomplishments.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, {Component} from 'react'
import React, { Component } from 'react'
import Select from './Select'
import Tag from './Tag'
import styled from '@emotion/styled'
import {faBan, faSave, faPlus} from '@fortawesome/free-solid-svg-icons'
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'
import { faBan, faSave, faPlus } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import Button from './Button'
import theme from 'utils/theme'

const responsiveWidth = '1000px'
//// background: ${props => !props.cancel && props.theme.colors.primary};
// color:${props => !props.cancel && 'white'};
Expand Down Expand Up @@ -36,99 +37,100 @@ const AddButton = styled(Button)`
`
const availableChoices = {
voivodeship: [
['Co najmniej podwójnym finalistą konkursu przedmiotowego', 10],
['Co najmniej podwójnym laureatem konkursu tematycznego lub interdyscyplinarnego', 7],
['Co najmniej podwójnym finalistą konkursu tematycznego lub interdyscyplinarnego', 5],
['Finalistą konkursu przedmiotowego ', 7],
['Laureatem konkursu tematycznego lub interdyscyplinarnego', 5],
['Finalistą konkursu tematycznego lub interdyscyplinarnego', 3],
],
domestic: [
['Finalistą konkursu przedmiotowego', 10],
['Laureatem konkursu tematycznego lub interdyscyplinarnego', 7],
['Finalistą konkursu tematycznego lub interdyscyplinarnego', 5]
],
international: [
['Finalistą konkursu z przedmiotu lub przedmiotów artystycznych objętych ramowym planem nauczania szkoły artystycznej', 10],
['Laureatem turnieju z przedmiotu lub przedmiotów artystycznych nieobjętych ramowym planem nauczania szkoły artystycznej', 4],
['Finalistą turnieju z przedmiotu lub przedmiotów artystycznych nieobjętych ramowym planem nauczania szkoły artystycznej', 3]
]
['Co najmniej podwójnym finalistą konkursu przedmiotowego', 10],
['Co najmniej podwójnym laureatem konkursu tematycznego lub interdyscyplinarnego', 7],
['Co najmniej podwójnym finalistą konkursu tematycznego lub interdyscyplinarnego', 5],
['Finalistą konkursu przedmiotowego ', 7],
['Laureatem konkursu tematycznego lub interdyscyplinarnego', 5],
['Finalistą konkursu tematycznego lub interdyscyplinarnego', 3],
],
domestic: [
['Finalistą konkursu przedmiotowego', 10],
['Laureatem konkursu tematycznego lub interdyscyplinarnego', 7],
['Finalistą konkursu tematycznego lub interdyscyplinarnego', 5],
],
international: [
['Finalistą konkursu z przedmiotu lub przedmiotów artystycznych objętych ramowym planem nauczania szkoły artystycznej', 10],
['Laureatem turnieju z przedmiotu lub przedmiotów artystycznych nieobjętych ramowym planem nauczania szkoły artystycznej', 4],
['Finalistą turnieju z przedmiotu lub przedmiotów artystycznych nieobjętych ramowym planem nauczania szkoły artystycznej', 3],
],
}
const CustomSelect = styled(Select)`
width:calc(100% - 20px);
`
export default class Accomplishments extends Component{
constructor(props){
super(props)
this.state = {
extent: null,
type: null,
adding: false
}
}
export default class Accomplishments extends Component {
constructor(props) {
super(props)
this.state = {
extent: null,
type: null,
adding: false,
}
}

init = () => this.setState({
adding:true
})
init = () => this.setState({
adding: true,
})

handleExtent = e => this.setState({
extent: e.target.value
})
handleExtent = e => this.setState({
extent: e.target.value,
})

handleType = e => this.setState({
type: availableChoices[this.state.extent].filter(type => type[0] == e.target.value)[0]
handleType = e => this.setState({
type: availableChoices[this.state.extent].filter(type => type[0] == e.target.value)[0],
})
cancel = () => this.setState({
adding:false,
adding: false,
extent: null,
type: null
type: null,
})
add = () => {
this.props.onAdd({
type: this.state.type,
extent: this.state.extent
extent: this.state.extent,
})
this.cancel()
}

render = () => {
if(!this.state.adding)
return (<AddButton onClick={this.init}>
<FontAwesomeIcon icon={faPlus} /> Dodaj
</AddButton>)
render = () => {
if (!this.state.adding)
return (<AddButton onClick={this.init}>
<FontAwesomeIcon icon={faPlus}/> Dodaj
</AddButton>)

return (
<div>
<CustomSelect onChange={this.handleExtent} value={this.state.extent}>
<option disabled selected>Zasięg konkursu</option>
<option value="voivodeship">Wojewódzki</option>
<option value="domestic">Ponadwojewódzki</option>
<option value="international">Międzynarodowy lub ogólnopolski</option>
</CustomSelect>
return (
<div>
<CustomSelect onChange={this.handleExtent} value={this.state.extent}>
<option disabled selected>Zasięg konkursu</option>
<option value="voivodeship">Wojewódzki</option>
<option value="domestic">Ponadwojewódzki</option>
<option value="international">Międzynarodowy lub ogólnopolski</option>
</CustomSelect>

{
this.state.extent &&
(
<CustomSelect onChange={this.handleType} value={this.state.type}>
<option disabled selected>Jestem</option>
{
this.state.extent && availableChoices[this.state.extent].map((choice) => <option data-to-add={choice[1]}>{choice[0]}</option>)
}
</CustomSelect>
)
}
<ActionsWrapper>
{
this.state.extent &&
(
<CustomSelect onChange={this.handleType} value={this.state.type}>
<option disabled selected>Jestem</option>
{
this.state.extent && availableChoices[this.state.extent].map((choice) => <option
data-to-add={choice[1]}>{choice[0]}</option>)
}
</CustomSelect>
)
}
<ActionsWrapper>

<Button className="new" onClick={this.add} disabled={!this.state.type}>
<FontAwesomeIcon icon={faSave} /> Zapisz
</Button>
<Button className="cancel" onClick={this.cancel}>
<FontAwesomeIcon icon={faBan} /> Anuluj
</Button>
</ActionsWrapper>
<Button className="new" onClick={this.add} disabled={!this.state.type}>
<FontAwesomeIcon icon={faSave}/> Zapisz
</Button>
<Button className="cancel" onClick={this.cancel}>
<FontAwesomeIcon icon={faBan}/> Anuluj
</Button>
</ActionsWrapper>


</div>
)
}
</div>
)
}
}
7 changes: 4 additions & 3 deletions src/components/Article.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react'
import styled from '@emotion/styled'

import theme from 'utils/theme'

const responsiveWidth = '1000px'
const ArticleWrapper = styled('article')`
width:100%;
Expand All @@ -20,9 +21,9 @@ h1{
export default props => {
return (
<ArticleWrapper>
<div className="container">
{props.children}
</div>
<div className="container">
{props.children}
</div>
</ArticleWrapper>
)
}
3 changes: 2 additions & 1 deletion src/components/Break.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react'
import styled from '@emotion/styled'
import theme from 'utils/theme'

const BreakElement = styled('span')`
width:100px;
height:.5em;
display:block;
border-radius:3px;
margin-bottom:.5em;
background:${props => theme.colors[props.color]};
`;
`

export default props => <BreakElement {...props} />
1 change: 1 addition & 0 deletions src/components/Button.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import styled from '@emotion/styled'
import theme from 'utils/theme'

const ButtonElement = styled('button')`
all:unset;
cursor:pointer;
Expand Down
19 changes: 10 additions & 9 deletions src/components/CheckBox.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React, {Component} from 'react'
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'
import {faCheckSquare as CheckedIcon} from '@fortawesome/free-solid-svg-icons'
import React, { Component } from 'react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faCheckSquare as CheckedIcon } from '@fortawesome/free-solid-svg-icons'

import {faCheckSquare as UncheckedIcon} from '@fortawesome/free-regular-svg-icons'
import { faCheckSquare as UncheckedIcon } from '@fortawesome/free-regular-svg-icons'
import styled from '@emotion/styled'
import theme from 'utils/theme'

const CheckboxElement = styled('div')`
position: relative;
display: inline-block;
Expand Down Expand Up @@ -39,15 +40,15 @@ const CheckboxElement = styled('div')`
background-color: white;
transition: .4s;
border-radius: 50%;
${props => props.checked &&'transform: translateX(26px);'}
${props => props.checked && 'transform: translateX(26px);'}
}
}
`


export default props => (<CheckboxElement checked={props.checked}>
<input type="checkbox" />
<span className="slider" {...props} onClick={props.onToggle}></span>
</CheckboxElement>)
export default props => (<CheckboxElement checked={props.checked}>
<input type="checkbox"/>
<span className="slider" {...props} onClick={props.onToggle}></span>
</CheckboxElement>)
27 changes: 14 additions & 13 deletions src/components/ExtensionsFilter.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import React from 'react'
import subjects from 'utils/subjectsMapping'
import Tag from 'components/Tag'

export default props => (
<>
{
subjects.map(subject => {
return (
<Tag
onClick={() => props.onToggle(subject[0])}
key={subject}
active={props.profiles.includes(subject[0])}
color={subject[1]}
light
{
subjects.map(subject => {
return (
<Tag
onClick={() => props.onToggle(subject[0])}
key={subject}
active={props.profiles.includes(subject[0])}
color={subject[1]}
light

>{subject[0]}</Tag>
>{subject[0]}</Tag>

)
})
)
})

}
}
</>
)
Loading

0 comments on commit b197463

Please sign in to comment.