Skip to content

Commit

Permalink
chore: android victory native fix
Browse files Browse the repository at this point in the history
  • Loading branch information
noahbrandyberry committed Jul 16, 2024
1 parent eedaf58 commit 504b3e3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/src/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function AppWrapper() {
}, [config, account]);

useEffect(() => {
if (account) {
if (Platform.OS === 'ios' && account) {
const activity = new LiveActivity();
activity.emitter.addListener<{ token: string }>('onTokenChanged', async ({ token }) => {
console.log('onActivityStarted', account.id, token);
Expand Down
6 changes: 3 additions & 3 deletions app/src/app/statistics/winrates/[name].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ProgressBar } from '@app/components/progress-bar';
import { ScrollView } from '@app/components/scroll-view';
import { Text } from '@app/components/text';
import { getCivHistoryImage, getCivIconLocal } from '@app/helper/civs';
import { VictoryChart, VictoryTheme, VictoryBar, VictoryAxis, VictoryArea, VictoryLine } from '@app/helper/victory';
import { VictoryChart, VictoryTheme, VictoryBar, VictoryAxis, VictoryArea, VictoryLine, LineSegment } from '@app/helper/victory';
import { useSelector } from '@app/redux/reducer';
import tw from '@app/tailwind';
import { Slider } from '@app/view/components/slider';
Expand Down Expand Up @@ -138,7 +138,7 @@ const StatsByRatingSlider: React.FC<{ width: number; grouping: WinrateGroupingRe
<VictoryAxis dependentAxis crossAxis tickFormat={tickFormat} />
<VictoryAxis
crossAxis
gridComponent={<View />}
gridComponent={<LineSegment active={false} style={{ stroke: 'transparent' }} />}
tickFormat={(x) => grouping.elo_groupings.find((eg) => eg.name === x)?.label.replace(/ *\([^)]*\) */g, '') ?? ''}
/>

Expand Down Expand Up @@ -190,7 +190,7 @@ const StatsByPatchSlider: React.FC<{ width: number; breakdown: WinrateBreakdown;
theme={colorScheme === 'dark' ? VictoryTheme.customDark : VictoryTheme.custom}
>
<VictoryAxis dependentAxis crossAxis tickFormat={tickFormat} />
<VictoryAxis crossAxis gridComponent={<View />} tickFormat={(x) => format(new Date(x), 'M/d')} />
<VictoryAxis crossAxis tickFormat={(x) => format(new Date(x), 'M/d')} />

{domain[0] > domain[1] ? (
<VictoryLine
Expand Down
2 changes: 1 addition & 1 deletion app/src/helper/victory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import tw from '@app/tailwind';
import { cloneDeep, merge } from 'lodash';
import { VictoryTheme } from 'victory-native';

export { VictoryAxis, VictoryChart, VictoryLine, VictoryScatter, VictoryBar, VictoryArea } from 'victory-native';
export { VictoryAxis, VictoryChart, VictoryLine, VictoryScatter, VictoryBar, VictoryArea, LineSegment } from 'victory-native';

function replaceRobotoWithSystemFont(obj: any) {
const keys = Object.keys(obj);
Expand Down
2 changes: 1 addition & 1 deletion app/src/helper/victory.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import tw from '@app/tailwind';
import { cloneDeep, merge } from 'lodash';
import { VictoryTheme } from 'victory-native';

export { VictoryAxis, VictoryChart, VictoryLine, VictoryScatter, VictoryBar, VictoryArea } from 'victory';
export { VictoryAxis, VictoryChart, VictoryLine, VictoryScatter, VictoryBar, VictoryArea, LineSegment } from 'victory';

function replaceRobotoWithSystemFont(obj: any) {
const keys = Object.keys(obj);
Expand Down

0 comments on commit 504b3e3

Please sign in to comment.