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

feat: Replace share text with an image on iOS #242

Merged
merged 17 commits into from
Oct 3, 2019
Merged
Prev Previous commit
Next Next commit
Made frequency terms global (not screen specific)
  • Loading branch information
James Pearson committed Oct 3, 2019
commit 27b107db866f75bab95630c64ac6ba0413ce5331
10 changes: 5 additions & 5 deletions App/Screens/Home/SelectFrequency/SelectFrequency.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ interface SelectFrequencyProps extends ScrollViewProps {
onChangeFrequency: (frequency: Frequency) => void;
}

export function SelectFrequency (props: SelectFrequencyProps) {
export function SelectFrequency(props: SelectFrequencyProps) {
const scroll = useRef<ScrollView>(null);
const [dailyWidth, setDailyWidth] = useState(0); // Width of the daily button

const { frequency, onChangeFrequency, style, ...rest } = props;

function handleChangeFrequency (f: Frequency) {
function handleChangeFrequency(f: Frequency) {
setTimeout(() => {
onChangeFrequency(f);
}, 400);
Expand Down Expand Up @@ -62,7 +62,7 @@ export function SelectFrequency (props: SelectFrequencyProps) {
}}
style={styles.boxButton}
>
{i18n.t('home_frequency_daily')}
{i18n.t('frequency_daily')}
</BoxButton>
<BoxButton
active={frequency === 'weekly'}
Expand All @@ -78,7 +78,7 @@ export function SelectFrequency (props: SelectFrequencyProps) {
}}
style={styles.boxButton}
>
{i18n.t('home_frequency_weekly')}
{i18n.t('frequency_weekly')}
</BoxButton>

<BoxButton
Expand All @@ -93,7 +93,7 @@ export function SelectFrequency (props: SelectFrequencyProps) {
}}
style={styles.boxButton}
>
{i18n.t('home_frequency_monthly')}
{i18n.t('frequency_monthly')}
</BoxButton>
</ScrollView>
);
Expand Down
8 changes: 4 additions & 4 deletions App/localization/languages/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"error_screen_choose_other_location": "Choose other location",
"error_screen_error_description": "There's either a problem with our databases, or you don't have any Air Monitoring Stations near you. Try again later!",
"error_screen_error_message": "Error: {{errorText}}",
"frequency_daily": "daily",
"frequency_weekly": "weekly",
"frequency_monthly": "monthly",
"home_station_too_far_message": "We couldn’t find a closer station to you.\nResults may be inaccurate at this distance.",
"home_beta_not_accurate": "Numbers may not be 100% accurate.",
"home_share_title": "Did you know that you may be smoking up to 20 cigarettes per day, just for living in a big city?",
Expand All @@ -17,9 +20,6 @@
"home_btn_more_details": "More details",
"home_btn_faq_about": "Faq/About",
"home_btn_share": "Share",
"home_frequency_daily": "daily",
"home_frequency_weekly": "weekly",
"home_frequency_monthly": "monthly",
"home_common_you_smoke": "You smoke",
"home_common_you_d_smoke": "You'd smoke",
"home_common_you_ll_smoke": "You'll smoke",
Expand Down Expand Up @@ -83,4 +83,4 @@
"about_credits_available_github": "available on Github",
"about_language": "Language",
"current_location_unknown_station": "Unknown AQI station"
}
}
8 changes: 4 additions & 4 deletions App/localization/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"error_screen_choose_other_location": "Choose other location",
"error_screen_error_description": "There's either a problem with our databases, or you don't have any Air Monitoring Stations near you. Try again later!",
"error_screen_error_message": "Error: {{errorText}}",
"frequency_daily": "daily",
"frequency_weekly": "weekly",
"frequency_monthly": "monthly",
"home_station_too_far_message": "We couldn’t find a closer station to you.\nResults may be inaccurate at this distance.",
"home_beta_not_accurate": "Numbers may not be 100% accurate.",
"home_share_title": "Did you know that you may be smoking up to 20 cigarettes per day, just for living in a big city?",
Expand All @@ -17,9 +20,6 @@
"home_btn_more_details": "More details",
"home_btn_faq_about": "Faq/About",
"home_btn_share": "Share",
"home_frequency_daily": "daily",
"home_frequency_weekly": "weekly",
"home_frequency_monthly": "monthly",
"home_common_you_smoke": "You smoke",
"home_common_you_d_smoke": "You'd smoke",
"home_common_you_ll_smoke": "You'll smoke",
Expand Down Expand Up @@ -83,4 +83,4 @@
"about_credits_available_github": "available on Github",
"about_language": "Language",
"current_location_unknown_station": "Unknown AQI station"
}
}