Let’s add the src/components/Buttons/Button
component.
This component should return the TouchableOpacity
element with styles:
borderRadius
- 4
, height
- 35
, width
- 120
, justifyContent
- center
,
alignItems
- center,
backgroundColor-
colors.blue3,
shadowOpacity-
0.4,
shadowRadius-
3,
shadowOffset-
{width: 0, height: 1},
shadowColor-
colors.blue,
elevation-
3,
borderWidth-
0. The
onPressproperty of the component must be forwarded to
TouchableOpacity. If the
loadingproperty is
true, there must be the
ActivityIndicatorinside the
TouchableOpacity. For ActivityIndicator, set the
sizeproperty to
small, and
colorto
colors.blue. If the
loadingproperty is
false, there must be
Textinside the
TouchableOpacity. The
Textshould display the
textproperty, with the color
colors.blue. The
TouchableOpacitymust be disabled when
loadingis
true`.
This task is part of the Full-Stack JavaScript Course.
If you have any issues with it, you can ask for community help below the post.
Feel free to help others if you’ve already solved the task.