Skip to content

Commit 21d61dd

Browse files
committed
fix(Pagination):删除边框调整文字颜色
1 parent f62c8b0 commit 21d61dd

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

packages/core/src/Pagination/DirText.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React, { useRef, useState, useEffect } from 'react';
2-
import { View, ViewStyle, StyleSheet, Text } from 'react-native';
2+
import { View, ViewStyle, StyleSheet, useColorScheme } from 'react-native';
33
import Icon from '../Icon';
44
import Button from '../Button';
55
import { size } from './index';
66
import { Theme } from '../theme';
77
import { useTheme } from '@shopify/restyle';
8+
import Text from '../Typography/Text';
89

910
export enum containerSize {
1011
small = 30,
@@ -28,28 +29,29 @@ export interface DirTextProps {
2829

2930
const DirText = (props: DirTextProps) => {
3031
const theme = useTheme<Theme>();
31-
32+
const colorScheme = useColorScheme();
3233
const {
3334
size,
3435
direction,
3536
disabled,
3637
icon,
3738
onPageChange,
38-
borderColor = theme.colors.gray300 || '#8d8d8d',
39+
// borderColor = theme.colors.gray300 || '#8d8d8d',
3940
color,
4041
} = props;
4142
const dirText: '上一页' | '下一页' = useRef<'上一页' | '下一页'>(direction === 'left' ? '上一页' : '下一页').current;
4243
const [disabledStyle, setDisabledStyle] = useState(1);
4344
useEffect(() => {
4445
setDisabledStyle(disabled ? 0.4 : 1);
4546
}, [disabled]);
47+
const textColor = colorScheme === 'dark' ? '#ccc' : '#3d3d3d';
4648
return (
4749
<View
4850
style={[
4951
styles.containerStyle,
5052
{
5153
minWidth: containerSize[size],
52-
borderColor: borderColor,
54+
// borderColor: borderColor,
5355
backgroundColor: theme.colors.white || '#fff',
5456
// paddingHorizontal: icon ? 0 : 5,
5557
opacity: disabled ? disabledStyle : disabledStyle - 0.2,
@@ -65,18 +67,18 @@ const DirText = (props: DirTextProps) => {
6567
}}
6668
>
6769
{icon ? (
68-
<Icon name={direction} size={contentSize[size]} color={color || '#3d3d3d'} />
70+
<Icon name={direction} size={contentSize[size]} color={color || textColor} />
6971
) : (
70-
<Text style={{ color: color || '#3d3d3d' }}>{dirText}</Text>
72+
<Text style={{ color: color || textColor }}>{dirText}</Text>
7173
)}
7274
</Button>
7375
</View>
7476
);
7577
};
7678

7779
export const containerStyle: ViewStyle = {
78-
borderStyle: 'solid',
79-
borderWidth: 1,
80+
borderStyle: 'dashed',
81+
// borderWidth: 1,
8082
borderRadius: 6,
8183
display: 'flex',
8284
flexDirection: 'row',

0 commit comments

Comments
 (0)