Skip to content

Commit

Permalink
Improved more filters button
Browse files Browse the repository at this point in the history
  • Loading branch information
AlixH committed Nov 22, 2021
1 parent 152bedc commit ac0f7d0
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/I18n/languages/cz.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@
"result": "Result",
"optional": "Optional",
"defaultSettings": "Default Settings",
"notApplicable": "N/A"
"notApplicable": "N/A",
"showMore": "Show more",
"showLess": "Show less"
},
"sidebar": {
"home": "Domovská stránka",
Expand Down
4 changes: 3 additions & 1 deletion src/I18n/languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@
"result": "Result",
"optional": "Optional",
"defaultSettings": "Default Settings",
"notApplicable": "N/A"
"notApplicable": "N/A",
"showMore": "Show more",
"showLess": "Show less"
},
"sidebar": {
"home": "Home",
Expand Down
4 changes: 3 additions & 1 deletion src/I18n/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@
"result": "Result",
"optional": "Optional",
"defaultSettings": "Default Settings",
"notApplicable": "N/A"
"notApplicable": "N/A",
"showMore": "Show more",
"showLess": "Show less"
},
"sidebar": {
"home": "Home",
Expand Down
4 changes: 3 additions & 1 deletion src/I18n/languages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@
"result": "Result",
"optional": "Optional",
"defaultSettings": "Default Settings",
"notApplicable": "N/A"
"notApplicable": "N/A",
"showMore": "Show more",
"showLess": "Show less"
},
"sidebar": {
"home": "Menú principal",
Expand Down
4 changes: 3 additions & 1 deletion src/I18n/languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@
"result": "Résultat",
"optional": "Optionnel",
"defaultSettings": "Paramètres par défaut",
"notApplicable": "N/A"
"notApplicable": "N/A",
"showMore": "Voir plus",
"showLess": "Voir moins"
},
"sidebar": {
"home": "Home",
Expand Down
4 changes: 3 additions & 1 deletion src/I18n/languages/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@
"result": "Result",
"optional": "Optional",
"defaultSettings": "Default Settings",
"notApplicable": "N/A"
"notApplicable": "N/A",
"showMore": "Show more",
"showLess": "Show less"
},
"sidebar": {
"home": "Home",
Expand Down
4 changes: 3 additions & 1 deletion src/I18n/languages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@
"result": "Result",
"optional": "Optional",
"defaultSettings": "Default Settings",
"notApplicable": "N/A"
"notApplicable": "N/A",
"showMore": "Show more",
"showLess": "Show less"
},
"sidebar": {
"home": "Home",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ export default function computeStyleSheet(): StyleSheet.NamedStyles<any> {
visibleExpandedIcon: {
fontSize: '25@s',
color: commonColor.textColor
},
filterButtonText: {
fontSize: "15@s",
color: commonColor.textColor,
textAlign: 'right'
},
filterButtonContainer: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-end',
width: '100%'
},
filterButtonIcon: {
fontSize: '25@s',
color: commonColor.textColor
}
});
const portraitStyles = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { TouchableOpacity } from 'react-native-gesture-handler';

import FilterContainerComponent, { FilterContainerComponentProps, FilterContainerComponentState } from './FilterContainerComponent';
import computeStyleSheet from './FilterContainerComponentStyles';
import { Text } from 'react-native';
import I18n from 'i18n-js';

export interface Props extends FilterContainerComponentProps {
expanded?: boolean;
Expand Down Expand Up @@ -47,9 +49,15 @@ export default class FilterVisibleContainerComponent extends FilterContainerComp
{onExpand && (
<TouchableOpacity style={style.visibleExpandedContainer} onPress={this.toggleExpanded}>
{expanded ? (
<Icon style={style.visibleExpandedIcon} type="MaterialIcons" name="keyboard-arrow-up" />
<View style={style.filterButtonContainer}>
<Text style={style.filterButtonText}>{I18n.t('general.showLess')}</Text>
<Icon style={style.filterButtonIcon} type={'MaterialIcons'} name={'keyboard-arrow-up'} />
</View>
) : (
<Icon style={style.visibleExpandedIcon} type="MaterialIcons" name="keyboard-arrow-down" />
<View style={style.filterButtonContainer}>
<Text style={style.filterButtonText}>{I18n.t('general.showMore')}</Text>
<Icon style={style.filterButtonIcon} type={'MaterialIcons'} name={'keyboard-arrow-down'} />
</View>
)}
</TouchableOpacity>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/screens/charging-stations/list/ChargingStations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import LocationManager from '../../../location/LocationManager';
import computeModalStyle from '../../../ModalStyles';
import ProviderFactory from '../../../provider/ProviderFactory';
import BaseProps from '../../../types/BaseProps';
import ChargingStation, { ChargePointStatus, Connector } from '../../../types/ChargingStation';
import ChargingStation, { Connector } from '../../../types/ChargingStation';
import { DataResult } from '../../../types/DataResult';
import { GlobalFilters } from '../../../types/Filter';
import SiteArea from '../../../types/SiteArea';
Expand Down

0 comments on commit ac0f7d0

Please sign in to comment.