Skip to content
Merged
Changes from all commits
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
11 changes: 6 additions & 5 deletions components/forecast/WeatherTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {isArray} from 'lodash';
import {LoggerContext, LoggerProps} from 'loggerContext';
import {usePostHog} from 'posthog-react-native';
import React, {useCallback, useEffect, useMemo, useState} from 'react';
import {RefreshControl, ScrollView} from 'react-native';
import {Platform, RefreshControl, ScrollView} from 'react-native';
import {HomeStackParamList, TabNavigationProps} from 'routes';
import {colorLookup} from 'theme';
import {
Expand Down Expand Up @@ -166,7 +166,7 @@ export const NACWeatherTab: React.FC<WeatherTabProps> = ({zone, center_id, reque
}

const adaptedWeatherForecast = center_id === 'SAC' ? adaptSierraWeatherForecast(weatherForecast) : weatherForecast;

const shouldStartCollapsed = Platform.OS === 'android';
return (
<ScrollView refreshControl={<RefreshControl refreshing={isRefreshing} onRefresh={onRefresh} />}>
<VStack space={8} backgroundColor={colorLookup('primary.background')}>
Expand Down Expand Up @@ -196,11 +196,10 @@ export const NACWeatherTab: React.FC<WeatherTabProps> = ({zone, center_id, reque
{adaptedWeatherForecast.weather_discussion && (
<CollapsibleCard
identifier={'weatherSynopsis'}
marginTop={1}
borderRadius={0}
borderColor="white"
header={<BodyBlack>Weather Discussion</BodyBlack>}
startsCollapsed={false}>
startsCollapsed={shouldStartCollapsed}>
<HTML source={{html: adaptedWeatherForecast.weather_discussion}} />
</CollapsibleCard>
)}
Expand Down Expand Up @@ -792,6 +791,8 @@ export const BTACWeatherForecast: React.FunctionComponent<{forecast: RowColumnWe
data: snowData,
};

const shouldStartCollapsed = Platform.OS === 'android';

return (
<>
<CollapsibleCard
Expand All @@ -800,7 +801,7 @@ export const BTACWeatherForecast: React.FunctionComponent<{forecast: RowColumnWe
borderRadius={0}
borderColor="white"
header={<BodyBlack>Weather Discussion</BodyBlack>}
startsCollapsed={false}>
startsCollapsed={shouldStartCollapsed}>
<Body>{forecast.data[weatherSynopsisRow][0].value}</Body>
</CollapsibleCard>
<ForecastPeriod periods={periods} />
Expand Down