This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { ThemeProvider } from 'styled-components' | |
import theme from 'styles/theme' | |
const App = () => ( | |
<ThemeProvider theme={theme}> | |
/* your components */ | |
</ThemeProvider> | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import styled from 'styled-components' | |
const Header = styled.h1` | |
font-size: ${props => props.theme.fontSize.header}; | |
color: ${props => props.theme.color.text}; | |
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import styled from 'styled-components' | |
import theme from 'styles' | |
const Header = styled.h1` | |
font-size: ${theme.fontSize.header}; | |
color: ${theme.color.text}; | |
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import styled from 'styled-components' | |
const Header = styled.h1` | |
font-size: ${props => props.theme.fontSize.header}; | |
color: ${props => props.theme.colors.text}; | |
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import styled from 'styled-components' | |
import theme from 'styles' | |
const Header = styled.h1` | |
font-size: ${theme.fontSize.header}; | |
color: ${theme.colors.text}; | |
`; | |
// [ts] property 'colors' doesn't exist. Did you mean `color`? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import theme from 'styles' | |
export const Container = styled.div` | |
box-shadow: inset 0 6.2rem 0 0 ${theme.color.lightBackground}; | |
border: 0.1rem solid ${theme.color.border}; | |
border-radius: ${theme.borderRadius}; | |
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const Container = styled.div` | |
box-shadow: inset 0 6.2rem 0 0 ${props => props.theme.color.lightBackground}; | |
border: 0.1rem solid ${props => props.theme.color.border}; | |
border-radius: ${props => props.theme.borderRadius}; | |
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IUser { | |
firstName: string | |
lastName: string | |
} | |
interface IUser { | |
age: number | |
} | |
const user: IUser = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type CreditCard = { | |
number: string | |
expMonth: number | |
expYear: number | |
} | |
// Type with union operator | |
type Chargeable = { token: string } | { cvc: number } | |
type ChargeableCreditCard = CreditCard & Chargeable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails generate active_dynamic | |
rake db:migrate |