Skip to content

Commit

Permalink
using Platform.select for valid web/native overflow properties
Browse files Browse the repository at this point in the history
  • Loading branch information
krisbitney committed Jan 26, 2024
1 parent 7398ca9 commit 6f1d3b2
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 22 deletions.
7 changes: 5 additions & 2 deletions packages/app/src/components/DonorsList/DonorsList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StyleSheet, View } from 'react-native';
import { Platform, StyleSheet, View } from 'react-native';
import { DonorCollective } from '../../models/models';
import { DonorsListItem } from './DonorsListItem';
import { useMemo } from 'react';
Expand Down Expand Up @@ -41,7 +41,10 @@ const styles = StyleSheet.create({
width: '100%',
maxHeight: 400,
// @ts-ignore
overflow: 'auto',
overflow: Platform.select({
native: 'scroll',
default: 'auto',
}),
},
});

Expand Down
7 changes: 5 additions & 2 deletions packages/app/src/components/Dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { Image, Platform, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { useState } from 'react';
import { Colors } from '../utils/colors';
import { InterSemiBold, InterSmall } from '../utils/webFonts';
Expand Down Expand Up @@ -113,7 +113,10 @@ const styles = StyleSheet.create({
height: 'auto',
maxHeight: 400,
// @ts-ignore
overflowY: 'auto',
overflowY: Platform.select({
native: 'scroll',
default: 'auto',
}),
backgroundColor: Colors.white,
paddingTop: 10,
paddingBottom: 10,
Expand Down
7 changes: 5 additions & 2 deletions packages/app/src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ReactNode } from 'react';
import Header from '../Header/Header';
import { ScrollView, StyleSheet, useWindowDimensions, View } from 'react-native';
import { Platform, ScrollView, StyleSheet, useWindowDimensions, View } from 'react-native';
import ImpactButton from '../ImpactButton';
import { useLocation } from 'react-router-native';
import { Colors } from '../../utils/colors';
Expand Down Expand Up @@ -68,7 +68,10 @@ const styles = StyleSheet.create({
paddingBottom: 90,
height: '100vh',
// @ts-ignore
overflowY: 'auto',
overflowY: Platform.select({
native: 'scroll',
default: 'auto',
}),
},
});

Expand Down
7 changes: 5 additions & 2 deletions packages/app/src/components/StewardsList/StewardsList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Image, Text, View, StyleSheet } from 'react-native';
import { Image, Text, View, StyleSheet, Platform } from 'react-native';
import { InterRegular, InterSemiBold } from '../../utils/webFonts';
import { Colors } from '../../utils/colors';
import { StewardsListItem } from './StewardsListItem';
Expand Down Expand Up @@ -109,7 +109,10 @@ const styles = StyleSheet.create({
const overflowStyle = StyleSheet.create({
overflow: {
// @ts-ignore
overflow: 'auto',
overflow: Platform.select({
native: 'scroll',
default: 'auto',
}),
},
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Image, Text, View, StyleSheet, TouchableOpacity } from 'react-native';
import { Image, Text, View, Platform, StyleSheet, TouchableOpacity } from 'react-native';
import { InterRegular, InterSemiBold } from '../../utils/webFonts';
import { Colors } from '../../utils/colors';
import { useMediaQuery } from 'native-base';
Expand Down Expand Up @@ -150,7 +150,10 @@ const styles = StyleSheet.create({
const overflowStyle = StyleSheet.create({
overflow: {
// @ts-ignore
overflow: 'auto',
overflow: Platform.select({
native: 'scroll',
default: 'auto',
}),
},
});

Expand Down
7 changes: 5 additions & 2 deletions packages/app/src/components/modals/ApproveSwapModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Modal, StyleSheet, Text, View, Image, TouchableOpacity } from 'react-native';
import { Modal, StyleSheet, Text, View, Image, TouchableOpacity, Platform } from 'react-native';
import { InterRegular, InterSemiBold } from '../../utils/webFonts';
import { Colors } from '../../utils/colors';
import { modalStyles } from '../shared';
Expand Down Expand Up @@ -42,7 +42,10 @@ const styles = StyleSheet.create({
maxWidth: '90%',
maxHeight: '90%',
// @ts-ignore
overflowY: 'auto',
overflowY: Platform.select({
native: 'scroll',
default: 'auto',
}),
margin: 20,
backgroundColor: Colors.blue[100],
borderRadius: 20,
Expand Down
7 changes: 5 additions & 2 deletions packages/app/src/components/modals/CompleteDonationModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Modal, StyleSheet, Text, View, Image, TouchableOpacity } from 'react-native';
import { Modal, StyleSheet, Text, View, Image, TouchableOpacity, Platform } from 'react-native';
import { InterRegular, InterSemiBold } from '../../utils/webFonts';
import { Colors } from '../../utils/colors';
import { modalStyles } from '../shared';
Expand Down Expand Up @@ -40,7 +40,10 @@ const styles = StyleSheet.create({
modalView: {
maxWidth: '90%',
maxHeight: '90%',
overflowY: 'auto',
overflowY: Platform.select({
native: 'scroll',
default: 'auto',
}),
margin: 20,
backgroundColor: Colors.blue[100],
borderRadius: 20,
Expand Down
7 changes: 5 additions & 2 deletions packages/app/src/components/modals/ErrorModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Modal, StyleSheet, Text, View, Image, TouchableOpacity } from 'react-native';
import { Modal, StyleSheet, Text, View, Image, TouchableOpacity, Platform } from 'react-native';
import { InterRegular, InterSemiBold } from '../../utils/webFonts';
import { Colors } from '../../utils/colors';
import { CloseIcon, ThankYouImg } from '../../assets';
Expand Down Expand Up @@ -45,7 +45,10 @@ const styles = StyleSheet.create({
maxWidth: '90%',
maxHeight: '90%',
// @ts-ignore
overflowY: 'auto',
overflowY: Platform.select({
native: 'scroll',
default: 'auto',
}),
margin: 20,
backgroundColor: Colors.blue[100],
borderRadius: 20,
Expand Down
7 changes: 5 additions & 2 deletions packages/app/src/components/modals/StopDonationModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Modal, StyleSheet, Text, View, Image, TouchableOpacity } from 'react-native';
import { Modal, StyleSheet, Text, View, Image, TouchableOpacity, Platform } from 'react-native';
import { InterRegular, InterSemiBold } from '../../utils/webFonts';
import { Colors } from '../../utils/colors';
import { QuestionImg } from '../../assets';
Expand Down Expand Up @@ -39,7 +39,10 @@ const styles = StyleSheet.create({
maxWidth: '90%',
maxHeight: '90%',
// @ts-ignore
overflowY: 'auto',
overflowY: Platform.select({
native: 'scroll',
default: 'auto',
}),
margin: 20,
backgroundColor: Colors.blue[100],
borderRadius: 20,
Expand Down
7 changes: 5 additions & 2 deletions packages/app/src/components/modals/SwitchModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Modal, StyleSheet, Text, View, Image, TouchableOpacity } from 'react-native';
import { Modal, StyleSheet, Text, View, Image, TouchableOpacity, Platform } from 'react-native';
import { InterRegular, InterSemiBold } from '../../utils/webFonts';
import { Colors } from '../../utils/colors';

Expand Down Expand Up @@ -43,7 +43,10 @@ const styles = StyleSheet.create({
maxWidth: '90%',
maxHeight: '90%',
// @ts-ignore
overflowY: 'auto',
overflowY: Platform.select({
native: 'scroll',
default: 'auto',
}),
margin: 20,
backgroundColor: Colors.blue[100],
borderRadius: 20,
Expand Down
7 changes: 5 additions & 2 deletions packages/app/src/components/modals/ThankYouModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Modal, StyleSheet, Text, View, Image, TouchableOpacity } from 'react-native';
import { Modal, StyleSheet, Text, View, Image, TouchableOpacity, Platform } from 'react-native';
import { InterRegular, InterSemiBold } from '../../utils/webFonts';
import { Colors } from '../../utils/colors';
import { ThankYouImg } from '../../assets';
Expand Down Expand Up @@ -43,7 +43,10 @@ const styles = StyleSheet.create({
maxWidth: '90%',
maxHeight: '90%',
// @ts-ignore
overflowY: 'auto',
overflowY: Platform.select({
native: 'scroll',
default: 'auto',
}),
margin: 20,
backgroundColor: Colors.blue[100],
borderRadius: 20,
Expand Down

0 comments on commit 6f1d3b2

Please sign in to comment.