callstack / callstack/react-native-paper
Incorrect styling on SnackBar
- 主要语言
- TypeScript
- 星标
- 14.5k
- 派生
- 2.2k
- 平均合并
- 5 天 23 小时
- 30 天内合并 PR
- 12
描述
### Current behaviour
It appears that the `IconButton` inside the snackbar is not properly styled to handle a color change of the snackbar.

### Expected behaviour

### How to reproduce?
``` tsx
return (
Snack bar message
);
```
### What have you tried so far?
I temprarily applied a patch with [patch-package](https://github.com/ds300/patch-package/issues/296).
Here is the diff that solved my problem:
```diff
diff --git a/node_modules/react-native-paper/src/components/Snackbar.tsx b/node_modules/react-native-paper/src/components/Snackbar.tsx
index 388fc48..9f53289 100644
--- a/node_modules/react-native-paper/src/components/Snackbar.tsx
+++ b/node_modules/react-native-paper/src/components/Snackbar.tsx
@@ -328,6 +328,7 @@ const Snackbar = ({
accessibilityRole="button"
borderless
onPress={onIconPress}
+ containerColor={theme.colors.inverseSurface}
iconColor={theme.colors.inverseOnSurface}
rippleColor={rippleColor}
theme={theme}
```
### Your Environment
| software | version
| --------------------- | -------
| ios | 17
| android | 13
| react-native | 0.72.3
| react-native-paper | 5.10.0
| node | 20.5.1
| npm | 9.8.1
| expo sdk | N/A
贡献指南
调研方向
从 Snackbar.tsx 开始,重点检查为 dismiss 操作渲染的 IconButton,以及提供的复现主题颜色。将其容器和图标颜色的处理方式与预期的屏幕截图进行比较,并在 iOS 或 Android 上验证复现结果。当自定义 inverseSurface 和 inverseOnSurface 后,dismiss 按钮仍保持正确样式时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- react-native, typescript
- 领域
- design, frontend
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 52/100