Error changing ActivityIndicator color
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- react-native, typescript
- Área
- mobile
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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;
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.4k
- Forks
- 154
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Shopify/restyle
-
Reanimated 4.4.x animated components conflict with Restyle themePosiblemente ocupada @KAMRONBEK la tomó hace 131 días. Abiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 15/100
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
-
Cannot make custom componentAbiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Todos los issues de Shopify/restyle
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
testing-library/jest-dom#749 ·
-
Duplicate "./pack-settings" export in packages/workflows/package.json makes `bun install` failAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
zed-industries/delta-claude#50 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
CDLUC3/dmptool-doc#660 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
stripe/stripe-terminal-react-native#1162 ·
Los mantenedores suelen responder en 1 día