Skip to content

Commit a72904e

Browse files
author
hy
committed
fix(ButtonGroup):优化ButtonGroup组件展示问题和文档示例
1 parent e0fd493 commit a72904e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/core/src/ButtonGroup/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import React, { Component } from 'react';
22
import { StyleSheet } from 'react-native';
33
import { ButtonProps } from '../Button';
44
import Flex, { FlexProps } from '../Flex';
5+
import { useTheme } from '@shopify/restyle';
6+
import { Theme } from '../theme';
57

68
const styles = StyleSheet.create({
79
default: {
@@ -43,6 +45,7 @@ export default function ButtonGroup(props: ButtonGroupProps) {
4345
const porps = { color, type, bordered, disabled, textStyle };
4446
const flexProps = { direction, justify, align, wrap };
4547
const childs = React.Children.toArray(children);
48+
const theme = useTheme<Theme>();
4649

4750
if (inline) {
4851
flexProps.direction = 'row';
@@ -77,9 +80,11 @@ export default function ButtonGroup(props: ButtonGroupProps) {
7780
if (bordered && !gutter) {
7881
if ((idx > 0 && idx < (children as ButtonProps[]).length - 1) || idx === 0) {
7982
childStyle.borderRightWidth = StyleSheet.hairlineWidth;
83+
childStyle.borderColor = theme.colors.text_active;
8084
}
8185
if (idx > 0 && idx < (children as ButtonProps[]).length) {
8286
childStyle.borderLeftWidth = StyleSheet.hairlineWidth;
87+
childStyle.borderColor = theme.colors.text_active;
8388
}
8489
}
8590
if (gutter && inline) {

0 commit comments

Comments
 (0)