Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 9 additions & 8 deletions app/components/UI/SRPList/SRPList.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ import { Theme } from '../../../util/theme/models';
*
* @returns StyleSheet object.
*/
const styleSheet = (params: { theme: Theme }) => {
const { theme } = params;
const styleSheet = (params: { theme: Theme; vars: { maxHeight: number } }) => {
const {
theme,
vars: { maxHeight },
} = params;
const { colors } = theme;

return StyleSheet.create({
base: {
display: 'flex',
alignItems: 'flex-start',
justifyContent: 'center',
flexShrink: 1,
paddingVertical: 16,
paddingHorizontal: 16,
backgroundColor: colors.background.default,
margin: 8,
maxHeight,
},
accountInputContainer: {
width: '100%',
Expand Down Expand Up @@ -69,11 +69,12 @@ const styleSheet = (params: { theme: Theme }) => {
gap: 16,
},
srpListContentContainer: {
display: 'flex',
maxWidth: '100%',
paddingVertical: 4,
rowGap: 16,
},
flatList: {
flexGrow: 0,
},
});
};

Expand Down
8 changes: 6 additions & 2 deletions app/components/UI/SRPList/SRPList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { FlatList, View } from 'react-native';
import { useWindowDimensions, View } from 'react-native';
import { FlatList } from 'react-native-gesture-handler';
import { strings } from '../../../../locales/i18n';
import { SRPListProps } from './SRPList.types';
import { useStyles } from '../../hooks/useStyles';
Expand All @@ -19,7 +20,9 @@ const SRPList = ({
// trigger sync SRP when SRP list is shown
useSyncSRPs();

const { styles } = useStyles(styleSheet, {});
const { height: windowHeight } = useWindowDimensions();
const maxHeight = windowHeight * 0.7;
const { styles } = useStyles(styleSheet, { maxHeight });
const hdKeyringsWithSnapAccounts = useHdKeyringsWithSnapAccounts();
const { trackEvent, createEventBuilder } = useMetrics();

Expand All @@ -29,6 +32,7 @@ const SRPList = ({
testID={SRPListSelectorsIDs.SRP_LIST}
>
<FlatList
style={styles.flatList}
data={hdKeyringsWithSnapAccounts}
contentContainerStyle={styles.srpListContentContainer}
renderItem={({ item, index }) => (
Expand Down
Loading