Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update eslint + prettier rules #254

Merged
merged 18 commits into from
Oct 10, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
style: fixing code format (prettier/eslint rules) and merge conflicts
  • Loading branch information
ftonato committed Oct 9, 2019
commit 4ecdf3413aa7f650fc3f85bee584882e892f251e
3 changes: 2 additions & 1 deletion App/Screens/About/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ export function About(props: AboutProps) {
</Text>
.{'\n'}
{'\n'}
Sh**t! I Smoke v{Constants.manifest.revisionId || Constants.manifest.version}.
Sh**t! I Smoke v
{Constants.manifest.revisionId || Constants.manifest.version}.
</Text>
{/* Add languages https://github.com/amaurymartiny/shoot-i-smoke/issues/73 */}
</View>
Expand Down
4 changes: 3 additions & 1 deletion App/Screens/Details/Distance/Distance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import React from 'react';
import { StyleSheet, Text } from 'react-native';
import { Banner } from '../../../components';
import { i18n } from '../../../localization';
import { useDistanceUnit } from '../../../stores/distanceUnit';
import * as theme from '../../../util/theme';

interface DistanceProps {
Expand All @@ -36,7 +37,8 @@ const styles = StyleSheet.create({
});

export function Distance(props: DistanceProps) {
const distanceUnit = i18n.t('distance_unit');
const { localizedDistanceUnit } = useDistanceUnit();
const distanceUnit = localizedDistanceUnit('short');

return (
<Banner elevated shadowPosition="top" style={styles.banner}>
Expand Down
20 changes: 5 additions & 15 deletions App/Screens/Home/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ import { scale } from 'react-native-size-matters';
import alert from '../../../../assets/images/alert.png';
import { ChangeLocation, CurrentLocation } from '../../../components';
import { i18n } from '../../../localization';
import {
ApiContext,
CurrentLocationContext,
DistanceUnit
} from '../../../stores';
import { ApiContext, CurrentLocationContext } from '../../../stores';
import { useDistanceUnit } from '../../../stores/distanceUnit';
import { distanceToStation, isStationTooFar } from '../../../util/station';
import * as theme from '../../../util/theme';

Expand Down Expand Up @@ -67,12 +64,10 @@ const styles = StyleSheet.create({
export function Header(props: HeaderProps) {
const { api } = useContext(ApiContext);
const { currentLocation, isGps } = useContext(CurrentLocationContext);
const { distanceUnit, localizedDistanceUnit } = useDistanceUnit();
const { onChangeLocationClick } = props;

const distanceUnit = i18n.t('distance_unit');
const haversineDistanceUnit = i18n.t(
'haversine_distance_unit'
) as DistanceUnit;
const shortDistanceUnit = localizedDistanceUnit('short');

if (!currentLocation) {
throw new Error(
Expand All @@ -84,12 +79,7 @@ export function Header(props: HeaderProps) {
);
}

const distance = distanceToStation(
currentLocation,
api,
haversineDistanceUnit
);

const distance = distanceToStation(currentLocation, api, distanceUnit);
const isTooFar = isStationTooFar(currentLocation, api);

return (
Expand Down
1 change: 1 addition & 0 deletions App/util/amplitude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export function setupAmplitude() {
Amplitude.setUserProperties({
sisReleaseChannel:
Constants.manifest.releaseChannel || 'development',
sisRevisionId: Constants.manifest.revisionId || 'development',
sisVersion: Constants.manifest.version
});
}
Expand Down