Skip to content

Commit

Permalink
style(CardCollapse): 优化样式 #385 #387 #388 (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
matuancc authored Aug 20, 2022
1 parent f2364fa commit 51946fe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
18 changes: 5 additions & 13 deletions example/examples/src/routes/Divider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class DividerView extends React.Component<DividerViewProps> {
<Layout>
<Header title={title} description={description} />
<Body>
<Card title="横向分割线">
<Card title="横向分割线" style={{backgroundColor: '#ffffff'}}>
<Text>分割线</Text>
<Divider label="OR" />
<Text>分割线</Text>
Expand All @@ -28,24 +28,16 @@ export default class DividerView extends React.Component<DividerViewProps> {
<Text>分割线</Text>
</Card>

<Card title="分割线标题位置">
<Card title="分割线标题位置" style={{backgroundColor: '#ffffff'}}>
<Text>分割线</Text>
<Divider
label="left"
orientation="left"
labelStyle={{fontWeight: 'bold'}}
/>
<Divider label="left" orientation="left" labelStyle={{fontWeight: 'bold'}} />
<Text>分割线</Text>
<Divider label="center" labelStyle={{fontWeight: 'bold'}} />
<Text>分割线</Text>
<Divider
label="right"
orientation="right"
labelStyle={{fontWeight: 'bold'}}
/>
<Divider label="right" orientation="right" labelStyle={{fontWeight: 'bold'}} />
</Card>

<Card title="纵向分割线">
<Card title="纵向分割线" style={{backgroundColor: '#ffffff'}}>
<View style={{height: 200}}>
<Divider type="vertical" label="OR" />
</View>
Expand Down
12 changes: 7 additions & 5 deletions packages/core/src/CardCollapse/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,17 +231,19 @@ export default function CardCollapse(props: CardCollapseProps) {
style={[contentContainerStyle, styles.card, { borderRadius: itemBorderRadius }]}
onPress={() => disablePresses && onItemPress(index)}
>
<Animated.View style={index !== 0 ? { opacity: animatedContentOpacity } : undefined} collapsable={false}>
{item}
</Animated.View>
<TouchableOpacity onPress={close}>
<Animated.View style={index !== 0 ? { opacity: animatedContentOpacity } : undefined} collapsable={false}>
{item}
</Animated.View>
</TouchableOpacity>
</Container>
</Animated.View>
);
};
return (
<View style={containerStyle}>
<View style={{ marginBottom: PEEP * 3 }}>
<Animated.View
{/* <Animated.View
style={{
position: 'absolute',
right: 0,
Expand All @@ -254,7 +256,7 @@ export default function CardCollapse(props: CardCollapseProps) {
<Icon xml={down} size={30} />
</TouchableOpacity>
)}
</Animated.View>
</Animated.View> */}
{React.Children.map(children, (item, index) => {
return renderItem(item, index);
})}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/List/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class ListItem extends React.PureComponent<ListItemProps> {
})}
</View>
{extra && (
<View style={{ paddingRight: 10 }}>
<View style={{ paddingRight: 10, maxWidth: 50 }}>
{typeof extra === 'string' ? (
<Text style={extraStyle}>{extra}</Text>
) : (
Expand Down

0 comments on commit 51946fe

Please sign in to comment.