fix card list layout

This commit is contained in:
balzack 2024-11-12 21:37:26 -08:00
parent 43daaabcb1
commit e41d1faad7
4 changed files with 11 additions and 3 deletions

View File

@ -60,4 +60,9 @@ export const styles = StyleSheet.create({
overflow: 'hidden',
fontWeight: 'bold',
},
actions: {
display: 'flex',
flexDirection: 'row',
flexShrink: 0,
},
});

View File

@ -31,7 +31,7 @@ export function Card({
{!name && <Text numberOfLines={1} style={styles.nameUnset}>{placeholder}</Text>}
<Text numberOfLines={1} style={styles.handle}>{node ? `${handle}/${node}` : handle}</Text>
</View>
<View>
<View style={styles.actions}>
{actions}
</View>
</SafeAreaView>

View File

@ -149,6 +149,9 @@ export const styles = StyleSheet.create({
transform: [{scaleX: 0.7}, {scaleY: 0.7}],
flexGrow: 1,
},
memberSwitch: {
transform: [{scaleX: 0.7}, {scaleY: 0.7}],
},
addControls: {
display: 'flex',
flexDirection: 'row',
@ -186,7 +189,7 @@ export const styles = StyleSheet.create({
paddingVertical: 6,
},
members: {
height: 256,
height: 200,
},
membersContainer: {
},

View File

@ -155,7 +155,7 @@ export function Content({select}: {select: (focus: Focus) => void}) {
data={cards}
initialNumToRender={32}
renderItem={({item}) => {
const enable = (<Switch key="enable" style={styles.sealSwitch} value={Boolean(members.find(cardId => cardId === item.cardId))} onValueChange={flag => {
const enable = (<Switch key="enable" style={styles.memberSwitch} value={Boolean(members.find(cardId => cardId === item.cardId))} onValueChange={flag => {
if (flag) {
setMembers([ item.cardId, ...members ]);
} else {