Skip to content

Instantly share code, notes, and snippets.

@gcmatheusj
Last active August 21, 2019 12:28
Show Gist options
  • Select an option

  • Save gcmatheusj/8e1502d912b78c66ea2e39e190bc7584 to your computer and use it in GitHub Desktop.

Select an option

Save gcmatheusj/8e1502d912b78c66ea2e39e190bc7584 to your computer and use it in GitHub Desktop.
import React from 'react';
import styled, { css } from 'styled-components';
export default function StatusProgress({ type }) {
return (
<Line type={type}>
<Circle type={type} />
<Circle type={type} />
<Circle type={type} />
<Circle type={type} />
</Line>
);
}
const colors = {
UnitPoupStandard: css`
background: #00a2ef;
`,
UnitPoupPlus: css`
background: #a78566;
`,
UnitPoupPrime: css`
background: #843f76;
`,
};
const Line = styled.div`
height: 4px;
width: 126px;
border-radius: 5px;
margin: auto;
top: 50%;
transform: translateY(-50%);
position: relative;
${props => colors[props.type]}
`;
const Circle = styled.div`
width: 12px;
height: 12px;
border-radius: 15px;
position: absolute;
top: -4px;
${props => colors[props.type]}
&:nth-child(2) {
left: 27px;
}
&:nth-child(3) {
left: 54px;
}
&:nth-child(4) {
right: 0;
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment