Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove .isRequired from emptyColor prop #101

Merged
Show file tree
Hide file tree
Changes from 2 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
9 changes: 6 additions & 3 deletions src/SegmentedArc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Segment from './components/Segment';
import Cap from './components/Cap';
import RangesDisplay from './components/RangesDisplay';


crosenfrisk marked this conversation as resolved.
Show resolved Hide resolved
const SegmentedArcContext = createContext();

export const SegmentedArc = ({
Expand All @@ -28,7 +29,8 @@ export const SegmentedArc = ({
capInnerColor = '#28E037',
capOuterColor = '#FFFFFF',
alignRangesWithSegments = true,
children
children,
emptyColor = '#F3F3F4'
}) => {
const [arcAnimatedValue] = useState(new Animated.Value(0));
const animationRunning = useRef(false);
Expand Down Expand Up @@ -167,7 +169,8 @@ export const SegmentedArc = ({
rangesTextStyle,
capInnerColor,
capOuterColor,
alignRangesWithSegments
alignRangesWithSegments,
emptyColor
crosenfrisk marked this conversation as resolved.
Show resolved Hide resolved
}}
>
{arcs.map((arc, index) => (
Expand Down Expand Up @@ -200,7 +203,7 @@ SegmentedArc.propTypes = {
PropTypes.shape({
scale: PropTypes.number,
filledColor: PropTypes.string.isRequired,
emptyColor: PropTypes.string.isRequired,
emptyColor: PropTypes.string,
data: PropTypes.object,
arcDegreeScale: PropTypes.number
})
Expand Down
7 changes: 7 additions & 0 deletions src/__tests__/__snapshots__/SegmentedArc.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ exports[`SegmentedArc automatically increases the component's height when arcDeg
"capOuterColor": "#FFFFFF",
"center": 120,
"emptyArcWidth": 8,
"emptyColor": "#F3F3F4",
"filledArcWidth": 8,
"isAnimated": true,
"lastFilledSegment": {
Expand Down Expand Up @@ -255,6 +256,7 @@ exports[`SegmentedArc renders arc with ranges: shows ranges 1`] = `
"capOuterColor": "#FFFFFF",
"center": 120,
"emptyArcWidth": 8,
"emptyColor": "#F3F3F4",
"filledArcWidth": 8,
"isAnimated": true,
"lastFilledSegment": {
Expand Down Expand Up @@ -442,6 +444,7 @@ exports[`SegmentedArc renders default 1`] = `
"capOuterColor": "#FFFFFF",
"center": 120,
"emptyArcWidth": 8,
"emptyColor": "#F3F3F4",
"filledArcWidth": 8,
"isAnimated": true,
"lastFilledSegment": {
Expand Down Expand Up @@ -610,6 +613,7 @@ exports[`SegmentedArc renders segments with arc degree scales 1`] = `
"capOuterColor": "#FFFFFF",
"center": 120,
"emptyArcWidth": 8,
"emptyColor": "#F3F3F4",
"filledArcWidth": 8,
"isAnimated": true,
"lastFilledSegment": {
Expand Down Expand Up @@ -761,6 +765,7 @@ exports[`SegmentedArc renders with ensured arc degree scales when missing from s
"capOuterColor": "#FFFFFF",
"center": 120,
"emptyArcWidth": 8,
"emptyColor": "#F3F3F4",
"filledArcWidth": 8,
"isAnimated": true,
"lastFilledSegment": {
Expand Down Expand Up @@ -925,6 +930,7 @@ exports[`SegmentedArc renders with middle content 1`] = `
"capOuterColor": "#FFFFFF",
"center": 120,
"emptyArcWidth": 8,
"emptyColor": "#F3F3F4",
"filledArcWidth": 8,
"isAnimated": true,
"lastFilledSegment": {
Expand Down Expand Up @@ -1120,6 +1126,7 @@ exports[`SegmentedArc sets the last segment for lastFilledSegment prop when fill
"capOuterColor": "#FFFFFF",
"center": 120,
"emptyArcWidth": 8,
"emptyColor": "#F3F3F4",
"filledArcWidth": 8,
"isAnimated": true,
"lastFilledSegment": {
Expand Down
Loading