Category : styled-components

How can I rewrite this code to Switch case? export const UserCardContainer = styled(Card)<CustomCardProps>` background: ${(props) => { if (props.typeCard === ‘HOST’) { return props.theme.palette.primary.main; } if (props.typeCard === ‘TEAMPLAYER’) { return props.theme.colors.contrast.overlay.primary; } if (props.typeCard === ‘BLANK’) { return props.theme.colors.backgrounds.role; } }}; `; **i am new to javascript help rewrite this code** i write ..

Read more

I’m trying to make a dark theme button theme in react native, so I need to change the image through BackgroundImage through the theme provider, however when I try to move the props forward it just doesn’t work. index.js import { Background } from "./styles"; <Background source={props.backgroundImage} /> style.js <Background source={props.backgroundImage} /> require(props => props.theme.backgroundImage))“; ..

Read more

I’ve changed my style in StyledButton tag but it doesn’t reflect on webpage. Can you help what is wrong in this code import React, { Component } from ‘react’; import ‘./App.css’; //import Radium, {StyleRoot} from ‘radium’; import Person from ‘./Person/Person’; import { render } from ‘react-dom’; import styled from ‘styled-components’ const StyledButton = styled.button ` ..

Read more