mirror of https://github.com/vector-im/riot-web
Change country dropdown to be smaller with arrow on right
parent
daee5f0325
commit
92394ba601
|
@ -30,6 +30,7 @@
|
||||||
@import "./views/auth/_AuthHeader.scss";
|
@import "./views/auth/_AuthHeader.scss";
|
||||||
@import "./views/auth/_AuthHeaderLogo.scss";
|
@import "./views/auth/_AuthHeaderLogo.scss";
|
||||||
@import "./views/auth/_AuthPage.scss";
|
@import "./views/auth/_AuthPage.scss";
|
||||||
|
@import "./views/auth/_CountryDropdown.scss";
|
||||||
@import "./views/auth/_InteractiveAuthEntryComponents.scss";
|
@import "./views/auth/_InteractiveAuthEntryComponents.scss";
|
||||||
@import "./views/auth/_LanguageSelector.scss";
|
@import "./views/auth/_LanguageSelector.scss";
|
||||||
@import "./views/auth/_ServerConfig.scss";
|
@import "./views/auth/_ServerConfig.scss";
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
Copyright 2019 New Vector Ltd
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
.mx_CountryDropdown_shortOption {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mx_CountryDropdown_option {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
|
@ -81,7 +81,7 @@ limitations under the License.
|
||||||
|
|
||||||
.mx_Dropdown_option img {
|
.mx_Dropdown_option img {
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
width: 27px;
|
width: 16px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ export default class CountryDropdown extends React.Component {
|
||||||
if (this.props.showPrefix) {
|
if (this.props.showPrefix) {
|
||||||
countryPrefix = '+' + COUNTRIES_BY_ISO2[iso2].prefix;
|
countryPrefix = '+' + COUNTRIES_BY_ISO2[iso2].prefix;
|
||||||
}
|
}
|
||||||
return <span>
|
return <span className="mx_CountryDropdown_shortOption">
|
||||||
{ this._flagImgForIso2(iso2) }
|
{ this._flagImgForIso2(iso2) }
|
||||||
{ countryPrefix }
|
{ countryPrefix }
|
||||||
</span>;
|
</span>;
|
||||||
|
@ -111,7 +111,7 @@ export default class CountryDropdown extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
const options = displayedCountries.map((country) => {
|
const options = displayedCountries.map((country) => {
|
||||||
return <div key={country.iso2}>
|
return <div className="mx_CountryDropdown_option" key={country.iso2}>
|
||||||
{ this._flagImgForIso2(country.iso2) }
|
{ this._flagImgForIso2(country.iso2) }
|
||||||
{ country.name } <span>(+{ country.prefix })</span>
|
{ country.name } <span>(+{ country.prefix })</span>
|
||||||
</div>;
|
</div>;
|
||||||
|
@ -121,7 +121,7 @@ export default class CountryDropdown extends React.Component {
|
||||||
// values between mounting and the initial value propgating
|
// values between mounting and the initial value propgating
|
||||||
const value = this.props.value || COUNTRIES[0].iso2;
|
const value = this.props.value || COUNTRIES[0].iso2;
|
||||||
|
|
||||||
return <Dropdown className={this.props.className + " left_aligned"}
|
return <Dropdown className={this.props.className}
|
||||||
onOptionChange={this._onOptionChange} onSearchChange={this._onSearchChange}
|
onOptionChange={this._onOptionChange} onSearchChange={this._onSearchChange}
|
||||||
menuWidth={298} getShortOption={this._getShortOption}
|
menuWidth={298} getShortOption={this._getShortOption}
|
||||||
value={value} searchEnabled={true} disabled={this.props.disabled}
|
value={value} searchEnabled={true} disabled={this.props.disabled}
|
||||||
|
|
Loading…
Reference in New Issue