Currently struggling to update the color of a logo as I scroll. While the navigation bar successfully changes colors, the logo remains stagnant. Here is the excerpt from my existing code:
navigation.js
return (
<Nav {...this.props} scrolled={this.state.hasScrolled}>
<StyledContainer>
<Brand>
<Scrollspy offset={-64} item={["top"]} currentClassName="active">
<AnchorLink href="#top" onClick={this.closeMobileMenu}>
Brand
</AnchorLink>
</Scrollspy>
</Brand>
</StyledContainer>
</Nav>
)
style.js
export const Brand = styled.div`
font-family: ${props => props.theme.font.extrabold};
${props => props.theme.font_size.regular};
color: ${props => props.theme.color.black.regular};
text-decoration: none;
letter-spacing: 1px;
margin: 0;
ul {
list-style: none;
margin: 0;
padding: 0;
a {
color: ${props => (props.scrolled ? `black` : `white`)};
text-decoration: none;
}
}
`
If anyone has any insights or solutions, your assistance would be greatly appreciated - thank you in advance!