How to style previous siblings in react styled-components? - css

I have react component like this:
const StyledMenu = () => {
const [currentStep, setCurrentStep] = React.useState('template');
const steps = ['template', 'audience', 'demography', 'action'];
const goToNextStep = () => {
const index = steps.indexOf(currentStep);
setCurrentStep(steps[index + 1]);
};
const goToPreviousStep = () => {
const index = steps.indexOf(currentStep);
if (index === 0) {
return;
}
setCurrentStep(steps[index - 1]);
};
return(
<div>
<StepsWrapper>
{steps.map((step, index) => (
<Step key={step} active={step === currentStep} last={index === 3}>
<StepDescription>{step}</StepDescription>
</Step>
))}
</StepsWrapper>
</div>
)
}
const StepsWrapper = styled('div')`
display: grid;
grid-template-columns: repeat(4, 1fr);
width: 100%;
height: 69px;
line-height: 69px;
text-align: center;
position: relative;
top: 27px;
`;
const Step = styled('div')<{ active: boolean; last: boolean }>`
color: ${({ active }) =>
active ? '#44b3db' : '#c7e8f4'};
`;
const StepDescription = styled('div')`
width: 240px;
height: 29px;
font-family: Roboto;
font-size: 18px;
font-weight: 500;
font-style: normal;
letter-spacing: normal;
line-height: normal;
text-align: center;
text-transform: uppercase;
margin: 0 auto;
`;
and I'm trying to style the items which are before the active item. If the first item is active, then nothing will be styled. I want to achieve styles from these images:
and
and
How can I achieve this? Thanks in advance!

I achieved this by adding a new state for the active index, and to styled-component I sent a boolean if the active index is bigger than the index, so the indexes less than current active index will be styled differently as #vishnu mentioned in the comment above. The code looks now like this
const StyledMenu = () => {
const [currentStep, setCurrentStep] = React.useState('template');
const steps = ['template', 'audience', 'demography', 'action'];
//added this line of code
const [activeIndex, setActiveIndex] = React.useState(0);
const goToNextStep = () => {
const index = steps.indexOf(currentStep);
setCurrentStep(steps[index + 1]);
//set the new activeIndex
setActiveIndex(index + 1);
};
const goToPreviousStep = () => {
const index = steps.indexOf(currentStep);
if (index === 0) {
return;
}
setCurrentStep(steps[index - 1]);
//set the new activeIndex
setActiveIndex(index - 1);
};
return(
<div>
<StepsWrapper>
{steps.map((step, index) => (
//sending the checked props to the styled component
<Step key={step} active={step === currentStep} last={index
=== 3} checked={activeIndex > index}>
<StepDescription>{step}</StepDescription>
</Step>
))}
</StepsWrapper>
</div>
)
}
const StepsWrapper = styled('div')`
display: grid;
grid-template-columns: repeat(4, 1fr);
width: 100%;
height: 69px;
line-height: 69px;
text-align: center;
position: relative;
top: 27px;
`;
const Step = styled('div')<{ active: boolean; last: boolean;
checked: boolean }>`
//checking if component is marked to be styled differently
color: ${({ active, checked }) =>
active ? '#44b3db' : checked ? 'red' '#c7e8f4'};
`;
const StepDescription = styled('div')`
width: 240px;
height: 29px;
font-family: Roboto;
font-size: 18px;
font-weight: 500;
font-style: normal;
letter-spacing: normal;
line-height: normal;
text-align: center;
text-transform: uppercase;
margin: 0 auto;
`;

Related

Styled component not being respected between files?

For whatever reason, the buttons (defined by AboutItem) are displaying light blue backgrounds when I hover over them. I want to make it #282828.
In a separate file I define some styled components for Buttons:
export const Button = styled.button`
display: inline-block;
font-size: 1em;
margin: 1em;
padding: 0em 1em;
`;
export const InfoButton = styled(Button)`
color: grey;
&:hover {
background-color: lightblue;
}
`;
which I then use:
interface AboutNavProps {
selected: boolean;
}
const AboutItem = styled(InfoButton) <AboutNavProps>`
color: grey;
background-color: ${props => props.selected ? "#282828" : "transparent"};
text-align: center;
&:hover {
background-color: #282828;
}
`;
export function AboutNavbar() {
const router = useRouter()
useEffect(() => {
router.prefetch("/method");
}, [])
return (
<AboutNav aria-label="Navbar">
<AboutItem as="a" href="method" selected={router.pathname == "/method"}>How It Works</AboutItem>
<AboutItem as="a" href="about" selected={router.pathname == "/about"}>About</AboutItem>
<Logo />
</AboutNav>
);
}
Is there a reason for this? I don't understand why the light blue overrides the color I define for the hover.

Styled component generate same css class with different conditions

I have these styles:-
import styled, { css } from "styled-components";
const H4 = css`
font-family: "Futura";
font-style: normal;
font-weight: 500;
font-size: 20px;
line-height: 140%;
color: #3a786a;
`;
const H3 = css`
font-size: 24px;
`;
const Span = css`
font-size: 16px;
`;
export const Typography = styled.div`
#widgetStyles & {
${(props) => {
switch (props.variant) {
case "h4":
return H4;
case "h3":
return H3;
case "body1":
return Span;
default:
return css`
font-size: 14px;
color: #010101;
`;
}
}}
}
`;
Whenever i tried calling the Typography component with different variations Styled-components generate same css class. Which creates confliction between styles.
This is how i am calling the above defined component with different variations:-
<Typography variant="h4">{label}</Typography>
<Typography variant="h3">{label}</Typography>
But it generates the output with same class:-
Basically styled-components generates different classes but the first class is same and other class are different, as you can see in h4 and h3 tag, could you please change #widgetStyles & to #widgetStyles &&, as you can see the below code.
import styled, { css } from "styled-components";
const H4 = css`
font-family: "Futura";
font-style: normal;
font-weight: 500;
font-size: 20px;
line-height: 140%;
color: #3a786a;
`;
const H3 = css`
font-size: 24px;
`;
const Span = css`
font-size: 16px;
`;
export const Typography = styled.div`
#widgetStyles && {
${(props) => {
switch (props.variant) {
case "h4":
return H4;
case "h3":
return H3;
case "body1":
return Span;
default:
return css`
font-size: 14px;
color: #010101;
`;
}
}}
}
`;

Can't get the bottom-margin to work on my App in react

As stated I have tried adding margin-bottom to the css file tha the App consumes and I have tried adding it to the inline app called pagination, but it's not working. How do I get the offset?
Here's my app component. I believe the problem stems somewhere along the bottom of the render() method.
import React, { Component } from 'react';
import styles from './App.module.css';
import { Card } from 'react-bootstrap';
import dateFormat from 'dateformat';
import 'bootstrap/dist/css/bootstrap.min.css'
class App extends Component {
state = {
results: null,
total: null,
total_pages: null,
per_page: null,
current_page: 1
}
componentDidMount() {
this.makeHttpRequestWithPage(1);
}
makeHttpRequestWithPage = async pageNumber => {
const response = await fetch(`http://127.0.0.1:8000/cfdilist/?page=${pageNumber}`, {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
});
const data = await response.json();
this.setState({
results: data.results,
total: data.total,
total_pages: data.total_pages,
per_page: data.page_size,
current_page: data.page
});
}
render() {
console.dir(this.state.results)
let results, renderPageNumbers;
if (this.state.results !== null) {
results = this.state.results.map(result => (
<Card>
<Card.Title>entry: {result.id}</Card.Title>
<Card.Text><b>Name:</b> {result.issuer_name}</Card.Text>
<Card.Text><b>Date:</b> {dateFormat(result.date_issued, "mmmm dS, yyyy")}</Card.Text>
<Card.Text><b>RFC:</b> {result.issuer_rfc}</Card.Text>
<Card.Text><b>Amount:</b> {result.total_amount}$</Card.Text>
<Card.Text><b>cfdi XML:</b></Card.Text>
<textarea>{result.cfdi_xml}</textarea>
</Card>
));
}
const pageNumbers = [];
if (this.state.total !== null) {
for (let i = 1; i <= this.state.total_pages; i++) {
pageNumbers.push(i);
}
renderPageNumbers = pageNumbers.map(number => {
let classes = this.state.current_page === number ? styles.active : '';
if (number === 1 || number === this.state.total || (number >= this.state.current_page - 2 && number <= this.state.current_page + 2)) {
return (
<span key={number} className={classes} onClick={() => this.makeHttpRequestWithPage(number)}>{number}</span>
);
}
});
}
return (
<div className={styles.app}>
<div className={styles.header}>
<h1>CFDI Page</h1>
</div>
{results}
<div className={styles.pagination}>
<span onClick={() => this.makeHttpRequestWithPage(1)}>«</span>
{renderPageNumbers}
<span onClick={() => this.makeHttpRequestWithPage(1)}>»</span>
</div>
</div>
);
}
}
export default App;
And here's my App.module.css
.app {
width: 70%;
margin: 0 auto;
margin-bottom: 50px auto;
}
.Header {
width: 70%;
text-align: center;
margin: 0 auto;
margin-bottom: 50px;
}
.pagination {
margin-top: 25px;
margin-bottom: 40px;
}
.pagination span {
cursor: pointer;
color: black;
float: left;
padding: 8px 16px;
text-decoration: none;
transition: background-color .3s;
border: 1px solid #ddd;
}
.pagination span.active {
background-color: #0099FF;
color: white;
border: 1px solid #0099FF;
}
There is an error in your css:
.app {
width: 70%;
margin: 0 auto;
margin-bottom: 50px auto;
}
Should be:
.app {
width: 70%;
margin: 0 auto;
margin-bottom: 50px; <-remove auto
}
Is your class being triggered if you inspect elements on your app?
EG: <div className="app">

Invisible Home Button

I am new to CSS and I am trying to get my home button to work. It seems like the CSS for the home button is conflicting with the code for the other buttons. My CSS for the button is at the bottom of this code and I kept the rest incase I missed something that could possibly conflict with the button:
.game {
min-height: 100vh;
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
background: lightblue;
h1 {
text-align: center;
display: block;
margin: 2rem;
font-family: "Caveat", cursive;
font-size: 3rem;
}
h2 {
margin: 1rem;
}
img {
width: 10%;
border-radius: 20px;
border: 5px solid black;
margin: 1rem;
}
}
.main-body {
font-family: "Lato", sans-serif;
text-align: center;
}
//Temporary style. Will need to do this properly later
body {
text-align: center;
font-family: -apple-system, sans-serif;
}
.container {
width: 1060px;
margin: 0 auto;
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 20px;
}
button {
background-color: rgb(64, 154, 184);
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
border-radius: 25px;
outline: none;
margin: 2rem;
transition: 0.3s ease-in-out;
cursor: pointer;
&:hover {
background: rgb(47, 120, 144);
}
}
button:focus {
outline: 0;
}
#cards {
width: 1060px;
margin: 0 auto;
display: flex;
flex-wrap: wrap;
}
.card {
width: 160px;
height: 160px;
margin-bottom: 20px;
}
.card:not(:nth-child(6n)) {
margin-right: 20px;
}
.c {
position: absolute;
max-width: 160px;
max-height: 160px;
width: 50ch;
height: 50ch;
cursor: pointer;
will-change: transform, opacity;
}
.front,
.back {
background-size: cover;
}
.back {
background-image: url("../img/CardBackBlue.png");
border: 5px solid rgb(58, 138, 165);
border-radius: 20px;
}
.front {
border: 5px solid rgb(58, 138, 165);
border-radius: 20px;
}
.home-button1 {
.home-button {
margin: 1rem;
border: none;
height: 4rem;
width: 4rem;
position: absolute;
top: 0;
right: 0;
background: lightblue;
outline: none;
padding: auto;
cursor: pointer;
& :hover {
background: rgb(83, 147, 168);
}
}
.home-pic {
margin: auto;
width: 90%;
border: none;
}
}
Here is the HTML:
// import React from "react";
import React, { useState, useEffect } from "react";
import { useSpring, animated as a } from "react-spring";
import HomeButton from "../img/home-button.svg";
import Background1 from "../img/cartoon-animals/card-1.png";
import Background13 from "../img/cartoon-animals/card-13.png";
import Background3 from "../img/cartoon-animals/card-3.png";
import Background4 from "../img/cartoon-animals/card-4.png";
import Background5 from "../img/cartoon-animals/card-5.png";
import Background6 from "../img/cartoon-animals/card-6.png";
import Background7 from "../img/cartoon-animals/card-7.png";
import Background8 from "../img/cartoon-animals/card-8.png";
import Background9 from "../img/cartoon-animals/card-9.png";
import Background14 from "../img/cartoon-animals/card-14.png";
import Background11 from "../img/cartoon-animals/card-11.png";
import Background12 from "../img/cartoon-animals/card-12.png";
export default function Game({ setPageStatus, pageStatus }) {
const [options, setOptions] = useState(null);
const [highScore, setHighScore] = useState(0);
//This will check to see if new score is high score
useEffect(() => {
const json = localStorage.getItem("memorygamehighscore");
const savedScore = JSON.parse(json);
if (savedScore) {
setHighScore(savedScore);
}
}, []);
return (
<div className={`game ${pageStatus ? "active-game" : ""}`}>
<div className="home-button1">
<button onClick={() => setPageStatus(0)} class="home-button">
<img className="home-pic" src={HomeButton} alt="Home Button" />
</button>
</div>
<h1>EduMemory</h1>
<h2>Memory Game</h2>
<div className="container">
<div>
<h4>High Score: {highScore}</h4>
</div>
<div>
{options === null ? (
<>
<button onClick={() => setOptions(12)}>Easy</button>
<button onClick={() => setOptions(18)}>Medium</button>
<button onClick={() => setOptions(24)}>Hard</button>
</>
) : (
<>
<button
onClick={() => {
const prevOptions = options;
setOptions(null);
setTimeout(() => {
setOptions(prevOptions);
}, 5);
}}
>
Start Over
</button>
<button onClick={() => setOptions(null)}>Main Menu</button>
</>
)}
</div>
</div>
{options ? (
<MemoryGame
options={options}
setOptions={setOptions}
highScore={highScore}
setHighScore={setHighScore}
/>
) : (
<h2>Choose a difficulty to begin!</h2>
)}
</div>
);
}
//Game Board. Put in another file
function MemoryGame({ options, setOptions, highScore, setHighScore }) {
const [game, setGame] = useState([]);
const [flippedCount, setFlippedCount] = useState(0);
const [flippedIndexes, setFlippedIndexes] = useState([]);
const colors = [
`url(${Background1})`,
`url(${Background13})`,
`url(${Background3})`,
`url(${Background4})`,
`url(${Background5})`,
`url(${Background6})`,
`url(${Background7})`,
`url(${Background8})`,
`url(${Background9})`,
`url(${Background14})`,
`url(${Background11})`,
`url(${Background12})`,
];
useEffect(() => {
const newGame = [];
for (let i = 0; i < options / 2; i++) {
const firstOption = {
id: 2 * i,
colorId: i,
color: colors[i],
flipped: false,
};
const secondOption = {
id: 2 * i + 1,
colorId: i,
color: colors[i],
flipped: false,
};
newGame.push(firstOption);
newGame.push(secondOption);
}
const shuffledGame = newGame.sort(() => Math.random() - 0.5);
setGame(shuffledGame);
}, []);
//Section that shows high score. Maybe change later as is a little confusing
useEffect(() => {
const finished = !game.some((card) => !card.flipped);
if (finished && game.length > 0) {
setTimeout(() => {
const bestPossible = game.length;
let multiplier;
if (options === 12) {
multiplier = 5;
} else if (options === 18) {
multiplier = 2.5;
} else if (options === 24) {
multiplier = 1;
}
const pointsLost = multiplier * (0.66 * flippedCount - bestPossible);
let score;
if (pointsLost < 100) {
score = 100 - pointsLost;
} else {
score = 0;
}
if (score > highScore) {
setHighScore(score);
const json = JSON.stringify(score);
localStorage.setItem("memorygamehighscore", json);
}
//was getting error "Unexpected use of 'confirm' no-restricted-globals". Just needed to add "window."below
const newGame = window.confirm(
"You Win!, SCORE: " + score + " New Game?"
);
if (newGame) {
const gameLength = game.length;
setOptions(null);
setTimeout(() => {
setOptions(gameLength);
}, 5);
} else {
setOptions(null);
}
}, 500);
}
}, [game]);
// Runs if two cards have been flipped
if (flippedIndexes.length === 2) {
const match =
game[flippedIndexes[0]].colorId === game[flippedIndexes[1]].colorId;
if (match) {
const newGame = [...game];
newGame[flippedIndexes[0]].flipped = true;
newGame[flippedIndexes[1]].flipped = true;
setGame(newGame);
const newIndexes = [...flippedIndexes];
newIndexes.push(false);
setFlippedIndexes(newIndexes);
} else {
const newIndexes = [...flippedIndexes];
newIndexes.push(true);
setFlippedIndexes(newIndexes);
}
}
if (game.length === 0) return <div>loading...</div>;
else {
return (
<div id="cards">
{game.map((card, index) => (
<div className="card" key={index}>
<Card
id={index}
color={card.color}
game={game}
flippedCount={flippedCount}
setFlippedCount={setFlippedCount}
flippedIndexes={flippedIndexes}
setFlippedIndexes={setFlippedIndexes}
/>
</div>
))}
</div>
);
}
}
//Card setup. should be in a separate file eventually
function Card({
id,
color,
game,
flippedCount,
setFlippedCount,
flippedIndexes,
setFlippedIndexes,
}) {
const [flipped, set] = useState(false);
const { transform, opacity } = useSpring({
opacity: flipped ? 1 : 0,
transform: `perspective(600px) rotateX(${flipped ? 180 : 0}deg)`,
config: { mass: 5, tension: 500, friction: 80 },
});
//Set timer, then flip the cards back
useEffect(() => {
if (flippedIndexes[2] === true && flippedIndexes.indexOf(id) > -1) {
setTimeout(() => {
set((state) => !state);
setFlippedCount(flippedCount + 1);
setFlippedIndexes([]);
}, 1000);
} else if (flippedIndexes[2] === false && id === 0) {
setFlippedCount(flippedCount + 1);
setFlippedIndexes([]);
}
}, [flippedIndexes]);
const onCardClick = () => {
if (!game[id].flipped && flippedCount % 3 === 0) {
set((state) => !state);
setFlippedCount(flippedCount + 1);
const newIndexes = [...flippedIndexes];
newIndexes.push(id);
setFlippedIndexes(newIndexes);
} else if (
flippedCount % 3 === 1 &&
!game[id].flipped &&
flippedIndexes.indexOf(id) < 0
) {
set((state) => !state);
setFlippedCount(flippedCount + 1);
const newIndexes = [...flippedIndexes];
newIndexes.push(id);
setFlippedIndexes(newIndexes);
}
};
return (
<div onClick={onCardClick}>
<a.div
className="c back"
style={{
opacity: opacity.interpolate((o) => 1 - o),
transform,
}}
/>
<a.div
className="c front"
style={{
opacity,
transform: transform.interpolate((t) => `${t} rotateX(180deg)`),
backgroundImage: color,
}}
/>
</div>
);
}
//export default Game;

"auth/network-request-failed" when attempt to sign-in with firebase in react native app

I'm facing an issue when I try to sign-in with Firebase (v6) in my react native app.
this is the issue :
this is my code :
Firebase.js
this is the function which allow us to initialize app with firebaseConfig
import {firebase} from '#react-native-firebase/auth';
const firebaseConfig = {
apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
authDomain: 'xxxxxxxx.firebaseapp.com',
databaseURL: 'https://xxxxxxxx.firebaseio.com',
projectId: 'xxxxxxxxx',
storageBucket: 'xxxxxxxxx.appspot.com',
messagingSenderId: 'xxxxxxxxxx',
appId: 'xxxxxxxxxxx'
};
firebase.initializeApp(firebaseConfig);
export default firebase;
ModalLogin.js
this is the main code from where the sign-in is checked.
import React from 'react';
import styled from 'styled-components';
import {
TouchableOpacity,
Alert,
Dimensions,
Animated,
TouchableWithoutFeedback,
Keyboard,
} from 'react-native';
import {BlurView, VibrancyView} from '#react-native-community/blur';
import {connect} from 'react-redux';
import Success from './Success';
import Loading from './Loading';
import firebase from './Firebase';
import auth from '#react-native-firebase/auth';
const screenHeight = Dimensions.get('window').height;
function mapStateToProps(state) {
return {action: state.action};
}
function mapDispatchToProps(dispatch) {
return {
closeLogin: () =>
dispatch({
type: 'CLOSE_LOGIN',
}),
};
}
class ModalLogin extends React.Component {
state = {
email: '',
password: '',
iconEmail: require('../Images/icon-email.png'),
iconPassword: require('../Images/icon-password.png'),
isSuccessful: false,
isLoading: false,
scale: new Animated.Value(1),
translateY: new Animated.Value(0),
top: new Animated.Value(screenHeight),
};
componentDidUpdate() {
if (this.props.action == 'openLogin') {
Animated.timing(this.state.top, {
toValue: 0,
duration: 0,
}).start();
Animated.spring(this.state.scale, {toValue: 1}).start();
Animated.timing(this.state.translateY, {
toValue: 0,
duration: 0,
}).start();
}
if (this.props.action == 'closeLogin') {
setTimeout(() => {
Animated.timing(this.state.top, {
toValue: screenHeight,
duration: 0,
}).start();
Animated.spring(this.state.scale, {toValue: 1.3}).start();
}, 500);
Animated.timing(this.state.translateY, {
toValue: 1000,
duration: 500,
}).start();
}
}
handleLogin = () => {
this.setState({isLoading: true});
const email = this.state.email;
const password = this.state.password;
firebase
.auth()
.signInWithEmailAndPassword(email, password)
.catch(function(error) {
Alert.alert('Error', error.message);
})
.then(response => {
console.log(response);
this.setState({isLoading: false});
if (response) {
// Successful
this.setState({isSuccessful: false});
//storage
//this.storeName(response.user.email);
this.fetchUser();
this.props.updateName(response.user.email);
//
Alert.alert('Congrats', "You've logged in successfully!");
setTimeout(() => {
Keyboard.dismiss();
this.props.closeLogin();
this.setState({isSuccessful: false});
}, 1000);
console.log(response.user);
}
});
};
// change the image on tape
focusEmail = () => {
this.setState({
iconEmail: require('../Images/icon-email-animated.gif'),
iconPassword: require('../Images/icon-password.png'),
});
};
focusPassword = () => {
this.setState({
iconEmail: require('../Images/icon-email.png'),
iconPassword: require('../Images/icon-password-animated.gif'),
});
};
tapBackground = () => {
Keyboard.dismiss();
this.props.closeLogin();
};
render() {
return (
<AnimatedContainer style={{top: this.state.top}}>
<TouchableWithoutFeedback onPress={this.tapBackground}>
<BlurView
tint="default"
intensity={100}
style={{position: 'absolute', width: '100%', height: '100%'}}
/>
</TouchableWithoutFeedback>
<AnimatedModal
style={{
transform: [
{scale: this.state.scale},
{translateY: this.state.translateY},
],
}}>
<Logo source={require('../Images/Film.png')} />
<Text> Enjoy watching.</Text>
<TextInput
onChangeText={email => this.setState({email})}
placeholder="Email"
value={this.state.email}
keyboardType="email-address"
onFocus={this.focusEmail}
/>
<TextInput
onChangeText={password => this.setState({password})}
placeholder="Password"
value={this.state.password}
secureTextEntry={true}
onFocus={this.focusPassword}
/>
<IconEmail source={this.state.iconEmail} />
<IconPassword source={this.state.iconPassword} />
<TouchableOpacity onPress={this.handleLogin}>
<ButtonView>
<ButtonText>Log in</ButtonText>
</ButtonView>
</TouchableOpacity>
</AnimatedModal>
<Success isActive={this.state.isSuccessful} />
<Loading isActive={this.state.isLoading} />
</AnimatedContainer>
);
}
}
export default connect(mapStateToProps, mapDispatchToProps)(ModalLogin);
const Container = styled.View`
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.75);
justify-content: center;
align-items: center;
`;
const AnimatedContainer = Animated.createAnimatedComponent(Container);
const TextInput = styled.TextInput`
border: 1px solid #dbdfea;
width: 295px;
height: 44px;
border-radius: 10px;
font-size: 17px;
color: #3c4560;
padding-left: 44px;
margin-top: 20px;
`;
const Modal = styled.View`
width: 335px;
height: 370px;
border-radius: 20px;
background: white;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
align-items: center;
`;
const AnimatedModal = Animated.createAnimatedComponent(Modal);
const Logo = styled.Image`
width: 44px;
height: 44px;
margin-top: 50px;
`;
const Text = styled.Text`
margin-top: 20px;
font-size: 13px;
font-weight: 600;
text-transform: uppercase;
width: 160px;
color: #b8bece;
text-align: center;
`;
const ButtonView = styled.View`
background: #5263ff;
width: 295px;
height: 50px;
justify-content: center;
align-items: center;
border-radius: 10px;
margin-top: 20px;
box-shadow: 0 10px 20px #c2cbff;
`;
const ButtonText = styled.Text`
color: white;
text-transform: uppercase;
font-weight: 600;
font-size: 20px;
`;
const IconEmail = styled.Image`
width: 24px;
height: 22px;
position: absolute;
top: 160px;
left: 31px;
`;
const IconPassword = styled.Image`
width: 28px;
height: 28px;
position: absolute;
top: 229px;
left: 30px;
`;
Normally, it should work. I don't know where is the problem.
Can you help me with a solution please?
thank you
You need to stop Remote JS Debugging, and then run again:react-native run-ios
There is a problem in debugging since >0.6.
You can try with: react-native log-ios for debugging or use a bunch of Alerts.

Resources