forked from City-of-Helsinki/linkedevents-ui
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* MUI to Bootstrap Header-component * MUI to boostrap fix * Added Glyphicons to language & login * Added + Glyphicon to add new event * Updating basecode to be on same level as develop (#3) * Fix double encoding City-of-Helsinki#524; with caveat axios/axios#2563 * Display all api results in react select components * Fix event publisher field name for user rights check * Fix City-of-Helsinki#530 * Do not try to update deleted subevents * Do not try to edit past subevents * Refactor editability check; allow deleting and canceling series that contain deleted, canceled or past subevents * Remove unnecessary inlined sub_events at cancel to prevent API errors * Add instructions for internet events * Update snapshots * Add remote participation keyword to all internet events * Add notification about online events to cancel confirmation dialog * Add postpone button and badge * Mention postponing in cancel extra text * Add postpone button to editor too * Show postponed events in search instead of crashing * Update user rights managers * Add missing </p> * Do not remove subevents at cancel after all; deleted items removed by API PR City-of-Helsinki/linkedevents#407 * Fix removed future time validation; fixes City-of-Helsinki#536, City-of-Helsinki#528 * Update snapshots Co-authored-by: Riku Oja <[email protected]> Co-authored-by: Aleksi Salonen <[email protected]> Co-authored-by: Riku Oja <[email protected]> Co-authored-by: aceViilee <[email protected]> * Updated header-component Updated to Reactstrap based on Open design. Updated mobile-functionality. Language dropdown WIP Added Reactstrap stylesheet. Added Reactstrap & Bootstrap packets * Removed React-select language changer, replaced with component Added comment about Nav-update, removed React-select and updated language dropdown with LanguageSelector-component * Fixed padding on language-select Fixed padding to be inline with login Co-authored-by: DelusionCB <[email protected]> Co-authored-by: Riku Oja <[email protected]> Co-authored-by: Aleksi Salonen <[email protected]> Co-authored-by: Riku Oja <[email protected]> Co-authored-by: aceViilee <[email protected]>
- Loading branch information
1 parent
3b8fa5c
commit a1fdbd2
Showing
6 changed files
with
538 additions
and
106 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import classNames from 'classnames'; | ||
|
||
class LanguageSelector extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.toggle = this.toggle.bind(this); | ||
this.state = { | ||
isOpen: false, | ||
}; | ||
} | ||
|
||
toggle(e) { | ||
e.preventDefault(); | ||
this.setState({isOpen: !this.state.isOpen}); | ||
} | ||
|
||
handleLanguageChange(lang, e) { | ||
e.preventDefault(); | ||
this.props.changeLanguage(lang); | ||
this.setState({isOpen: false}) | ||
|
||
} | ||
|
||
isActiveLanguage(language) { | ||
const {userLocale} = this.props; | ||
return language.label === userLocale.locale.toUpperCase(); | ||
} | ||
|
||
render() { | ||
const {userLocale} = this.props; | ||
const activeLocale = userLocale.locale.toUpperCase(); | ||
return ( | ||
<div style={{display: 'flex', flexDirection: 'column', width: '50px', color: 'white', fontWeight: 'bold', padding: '.375rem .75rem', alignItems: 'center'}}> | ||
<div className="currentLanguage" style={{paddingTop: '0.375rem', paddingBottom: '0.375rem'}}> | ||
<a href="#" onClick={this.toggle}>{activeLocale}</a> | ||
</div> | ||
<ul className={classNames('language', {open: this.state.isOpen})}> | ||
{this.props.languages.map((language, index) => { | ||
return ( | ||
<li key={index} className={classNames('language-item',{active: this.isActiveLanguage(language)})}> | ||
<a onClick={this.handleLanguageChange.bind(this, language)} href="#">{language.label}</a> | ||
</li> | ||
) | ||
})} | ||
</ul> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
LanguageSelector.propTypes = { | ||
languages: PropTypes.array, | ||
userLocale: PropTypes.object, | ||
changeLanguage: PropTypes.func, | ||
} | ||
export default LanguageSelector; |
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
Oops, something went wrong.