Error changing ActivityIndicator color
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react-native, typescript
- Lĩnh vực
- mobile
Hướng nghiên cứu
Start by reproducing the reported ActivityIndicator example through the createRestyleComponent entry point and inspect how the color prop is handled. Confirm the expected behavior when color="green1" is passed, and consider the issue done when the native indicator visibly uses the theme color.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I believe there is a bug when using the ActivityIndicator component, when using restyle the color does not change.
My Theme:
import {createTheme} from '@shopify/restyle';
const palette = {
black1: '#101010',
black2: '#2D2D2D',
black3: '#585858',
black4: '#9F9F9F',
black5: '#CFCFCF',
black6: '#E7E7E7',
green1: '#4FAF5A',
green2: '#84C78C',
green3: '#B9DFBD',
red1: '#E03F3F',
red2: '#E97979',
red3: '#F3B2B2',
background: '#F1F1F1',
white: '#FFFFFF',
};
export const theme = createTheme({
colors: {
...palette,
primary: palette.green1,
primaryContrast: palette.white,
background: palette.background,
sucess: palette.green1,
error: palette.red1,
},
spacing: {
s4: 4,
s8: 8,
s12: 12,
s16: 16,
s20: 20,
s24: 24,
s32: 32,
s40: 40,
},
textVariants: {
defaults: {},
},
borderRadii: {
br4: 4,
br8: 8,
br12: 12,
br16: 16,
br20: 20,
br24: 24,
br32: 32,
br40: 40,
},
});
export type Theme = typeof theme;
Component:
import {
createRestyleComponent,
BackgroundColorProps,
SpacingProps,
spacing,
ColorProps,
} from '@shopify/restyle';
import {
ActivityIndicatorProps as RNActivityIndicatorProps,
ActivityIndicator as RNActivityIndicator,
} from 'react-native';
import {theme, Theme} from '../../theme/theme';
interface ActIndiProps extends RNActivityIndicatorProps {
}
type ActivityIndicatorProps = BackgroundColorProps<Theme> &
ColorProps<Theme> &
SpacingProps<Theme> &
ActIndiProps;
export const ActivityIndicator = createRestyleComponent<
ActivityIndicatorProps,
Theme
>([spacing], ({color, ...rest}: ActivityIndicatorProps) => {
return <RNActivityIndicator {...rest} color={color} />;
});
Example usage:
function App() {
const [email, setEmail] = useState('');
const [error, setError] = useState(false);
return (
<ThemeProvider theme={theme}>
<TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
<SafeAreaView style={{flex: 1}}>
<View
style={{
flex: 1,
paddingHorizontal: 24,
}}>
<ActivityIndicator color="green1" size="large" />
</View>
</SafeAreaView>
</TouchableWithoutFeedback>
</ThemeProvider>
);
}
export default App;
- Ngôn ngữ chính
- TypeScript
- Star
- 3.4k
- Fork
- 154
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Shopify/restyle
-
Reanimated 4.4.x animated components conflict with Restyle themeCó thể đã có người làm @KAMRONBEK đã nhận 131 ngày trước. Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 15/100
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
-
Cannot make custom componentĐang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Tất cả issue của Shopify/restyle
Issue tương tự
-
MCP tool results drop structuredContent when text is only a summaryCó thể đã có người làm @Pankaj-bit361 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
n8n-io/nod#1474 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Clean-up indicator: two polish points from the dev look (kit clock spacing, row description)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
inblockio/siwx-oidc-matrix-server#101 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
pingdotgg/t3code#42253 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày