mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-26 23:05:00 +03:00
commit
a9a9fb50fb
@ -8,11 +8,6 @@ export default EStyleSheet.create({
|
||||
alignSelf: 'flex-start',
|
||||
height: 35,
|
||||
},
|
||||
// dropdownText: {
|
||||
// fontSize: 9,
|
||||
// color: '$primaryDarkGray',
|
||||
// marginLeft: 25,
|
||||
// },
|
||||
dropdownIcon: {
|
||||
fontSize: 22,
|
||||
color: '$primaryDarkText',
|
||||
@ -41,10 +36,10 @@ export default EStyleSheet.create({
|
||||
fontSize: 10,
|
||||
color: '$primaryDarkText',
|
||||
padding: 5,
|
||||
borderColor: '#e7e7e7',
|
||||
borderColor: '$borderColor',
|
||||
},
|
||||
dropdownTextHighlight: {
|
||||
backgroundColor: '#387be5',
|
||||
backgroundColor: '$primaryBlue',
|
||||
width: '$deviceWidth / 3',
|
||||
},
|
||||
button: {
|
||||
|
@ -26,8 +26,8 @@ export default EStyleSheet.create({
|
||||
},
|
||||
dropdownStyle: {
|
||||
marginTop: 15,
|
||||
minWidth: 172,
|
||||
width: 172,
|
||||
minWidth: 192,
|
||||
width: 192,
|
||||
},
|
||||
dropdownButtonStyle: {
|
||||
backgroundColor: '$primaryGray',
|
||||
@ -38,6 +38,7 @@ export default EStyleSheet.create({
|
||||
},
|
||||
dropdown: {
|
||||
flexGrow: 1,
|
||||
width: 150,
|
||||
},
|
||||
textStyle: {
|
||||
color: '$primaryBlue',
|
||||
|
@ -154,6 +154,7 @@ class SettingsContainer extends Component {
|
||||
|
||||
render() {
|
||||
const { serverList } = this.state;
|
||||
|
||||
return (
|
||||
<SettingsScreen
|
||||
serverList={serverList}
|
||||
|
@ -2,6 +2,9 @@ import React, { PureComponent } from 'react';
|
||||
import { ScrollView, View } from 'react-native';
|
||||
import { injectIntl } from 'react-intl';
|
||||
|
||||
// Utils
|
||||
import { groomingServerName } from '../../../utils/settings';
|
||||
|
||||
// Constants
|
||||
import LANGUAGE, { VALUE as LANGUAGE_VALUE } from '../../../constants/options/language';
|
||||
import CURRENCY, { VALUE as CURRENCY_VALUE } from '../../../constants/options/currency';
|
||||
@ -75,9 +78,9 @@ class SettingsScreen extends PureComponent {
|
||||
})}
|
||||
type="dropdown"
|
||||
actionType="api"
|
||||
options={serverList}
|
||||
options={serverList.map(serverName => groomingServerName(serverName))}
|
||||
selectedOptionIndex={serverList.indexOf(selectedApi)}
|
||||
defaultText={selectedApi}
|
||||
defaultText={groomingServerName(selectedApi)}
|
||||
handleOnChange={handleOnChange}
|
||||
/>
|
||||
<SettingsItem
|
||||
|
14
src/utils/settings.js
Normal file
14
src/utils/settings.js
Normal file
@ -0,0 +1,14 @@
|
||||
export const groomingServerName = (serverName, prefix1) => {
|
||||
const PREFIX1 = prefix1 || 'https://';
|
||||
const PREFIX2 = 'https://';
|
||||
|
||||
if (!serverName) return null;
|
||||
|
||||
if (serverName.indexOf(PREFIX1) === 0) {
|
||||
return serverName.substr(PREFIX1.length);
|
||||
}
|
||||
if (serverName.indexOf(PREFIX2) === 0) {
|
||||
return serverName.substr(PREFIX2.length);
|
||||
}
|
||||
return serverName;
|
||||
};
|
Loading…
Reference in New Issue
Block a user