Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Avatar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import PropTypes from 'prop-types'
import styled from 'styled-components'
import {themeGet, space} from 'styled-system'
import {get} from './constants'
import {space} from 'styled-system'
import theme from './theme'

function borderRadius({size}) {
Expand All @@ -15,7 +16,7 @@ const Avatar = styled.img.attrs(props => ({
}))`
display: inline-block;
overflow: hidden; // Ensure page layout in Firefox should images fail to load
line-height: ${themeGet('lineHeights.condensedUltra', 1)};
line-height: ${get('lineHeights.condensedUltra')};
vertical-align: middle;
${borderRadius};
${space};
Expand Down
6 changes: 3 additions & 3 deletions src/AvatarPair.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'
import {themeGet} from 'styled-system'
import {get} from './constants'
import Avatar from './Avatar'
import theme from './theme'

const getBackgroundColor = themeGet('colors.white', '#fff')
const getBackgroundColor = get('colors.white')

const Wrapper = styled('div')`
display: inline-flex;
Expand All @@ -15,7 +15,7 @@ const Wrapper = styled('div')`
const childStyles = props => ({
display: 'inline-block',
overflow: 'hidden', // Ensure page layout in Firefox should images fail to load
lineHeight: `${themeGet('lineHeights.condensedUltra', 1)}`,
lineHeight: `${get('lineHeights.condensedUltra')}`,
verticalAlign: 'middle',
borderRadius: '2px',
position: 'absolute',
Expand Down
7 changes: 3 additions & 4 deletions src/BranchName.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import PropTypes from 'prop-types'
import styled from 'styled-components'
import {themeGet} from 'styled-system'
import theme from './theme'
import {COMMON, Base} from './constants'
import {COMMON, Base, get} from './constants'

const BranchName = styled(Base)`
display: inline-block;
padding: 2px 6px;
font-size: ${themeGet('fontSizes.0', theme.fontSizes[0])}px;
font-family: ${themeGet('fonts.mono', theme.fonts.mono)};
font-size: ${get('fontSizes.0')}px;
font-family: ${get('fonts.mono')};
color: rgba(27, 31, 35, 0.6);
background-color: #eaf5ff;
border-radius: 3px;
Expand Down
5 changes: 3 additions & 2 deletions src/Donut.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import React from 'react'
import PropTypes from 'prop-types'
import {arc as Arc, pie as Pie} from 'd3-shape'
import styled from 'styled-components'
import {themeGet, space} from 'styled-system'
import {space} from 'styled-system'
import {get} from './constants'
import theme from './theme'

const defaultColor = '#666'
const getStateColors = themeGet('colors.state', {})
const getStateColors = get('colors.state')

function DonutBase(props) {
const {className, data, children = mapData(data), size} = props
Expand Down
4 changes: 0 additions & 4 deletions src/__tests__/Donut.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ describe('Donut', () => {
expect(render(<Donut.Slice state="xyz" />).props.fill).toEqual(state.unknown)
})

it('renders the fallback color when no state color is found in the theme', () => {
expect(render(<Donut.Slice state="error" theme={{}} />).props.fill).toEqual('#666')
})

it('respects the fill attribute', () => {
expect(render(<Donut.Slice fill="pink" />).props.fill).toEqual('pink')
})
Expand Down