Skip to content

Commit 51946fe

Browse files
authored
style(CardCollapse): 优化样式 #385 #387 #388 (#390)
1 parent f2364fa commit 51946fe

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

example/examples/src/routes/Divider/index.tsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default class DividerView extends React.Component<DividerViewProps> {
1818
<Layout>
1919
<Header title={title} description={description} />
2020
<Body>
21-
<Card title="横向分割线">
21+
<Card title="横向分割线" style={{backgroundColor: '#ffffff'}}>
2222
<Text>分割线</Text>
2323
<Divider label="OR" />
2424
<Text>分割线</Text>
@@ -28,24 +28,16 @@ export default class DividerView extends React.Component<DividerViewProps> {
2828
<Text>分割线</Text>
2929
</Card>
3030

31-
<Card title="分割线标题位置">
31+
<Card title="分割线标题位置" style={{backgroundColor: '#ffffff'}}>
3232
<Text>分割线</Text>
33-
<Divider
34-
label="left"
35-
orientation="left"
36-
labelStyle={{fontWeight: 'bold'}}
37-
/>
33+
<Divider label="left" orientation="left" labelStyle={{fontWeight: 'bold'}} />
3834
<Text>分割线</Text>
3935
<Divider label="center" labelStyle={{fontWeight: 'bold'}} />
4036
<Text>分割线</Text>
41-
<Divider
42-
label="right"
43-
orientation="right"
44-
labelStyle={{fontWeight: 'bold'}}
45-
/>
37+
<Divider label="right" orientation="right" labelStyle={{fontWeight: 'bold'}} />
4638
</Card>
4739

48-
<Card title="纵向分割线">
40+
<Card title="纵向分割线" style={{backgroundColor: '#ffffff'}}>
4941
<View style={{height: 200}}>
5042
<Divider type="vertical" label="OR" />
5143
</View>

packages/core/src/CardCollapse/index.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,17 +231,19 @@ export default function CardCollapse(props: CardCollapseProps) {
231231
style={[contentContainerStyle, styles.card, { borderRadius: itemBorderRadius }]}
232232
onPress={() => disablePresses && onItemPress(index)}
233233
>
234-
<Animated.View style={index !== 0 ? { opacity: animatedContentOpacity } : undefined} collapsable={false}>
235-
{item}
236-
</Animated.View>
234+
<TouchableOpacity onPress={close}>
235+
<Animated.View style={index !== 0 ? { opacity: animatedContentOpacity } : undefined} collapsable={false}>
236+
{item}
237+
</Animated.View>
238+
</TouchableOpacity>
237239
</Container>
238240
</Animated.View>
239241
);
240242
};
241243
return (
242244
<View style={containerStyle}>
243245
<View style={{ marginBottom: PEEP * 3 }}>
244-
<Animated.View
246+
{/* <Animated.View
245247
style={{
246248
position: 'absolute',
247249
right: 0,
@@ -254,7 +256,7 @@ export default function CardCollapse(props: CardCollapseProps) {
254256
<Icon xml={down} size={30} />
255257
</TouchableOpacity>
256258
)}
257-
</Animated.View>
259+
</Animated.View> */}
258260
{React.Children.map(children, (item, index) => {
259261
return renderItem(item, index);
260262
})}

packages/core/src/List/Item.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default class ListItem extends React.PureComponent<ListItemProps> {
5959
})}
6060
</View>
6161
{extra && (
62-
<View style={{ paddingRight: 10 }}>
62+
<View style={{ paddingRight: 10, maxWidth: 50 }}>
6363
{typeof extra === 'string' ? (
6464
<Text style={extraStyle}>{extra}</Text>
6565
) : (

0 commit comments

Comments
 (0)