• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CBIIT / crdc-datahub-ui / 11074479132

27 Sep 2024 04:44PM UTC coverage: 44.982% (+26.5%) from 18.435%
11074479132

Pull #479

github

web-flow
Merge a0867d25a into 3d8b55818
Pull Request #479: 3.0.0 Release

1727 of 4418 branches covered (39.09%)

Branch coverage included in aggregate %.

2612 of 5228 relevant lines covered (49.96%)

128.96 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

21.43
/src/components/Questionnaire/AddRemoveButton.tsx
1
import { Button, ButtonProps, Stack, StackProps, styled } from "@mui/material";
2
import { FC } from "react";
3

4
const ActionButton = styled(Button, {
2✔
5
  shouldForwardProp: (prop) => prop !== "textColor" && prop !== "iconColor",
2✔
6
})<Props>`
7
  font-weight: 700;
8
  font-size: 15px;
9
  font-family: "Nunito", "Rubik", sans-serif;
10
  line-height: 16px;
11
  color: ${(props) => props.textColor ?? "#000000"};
×
12
  padding: 0;
13
  justify-content: end;
14
  min-width: 143px;
15
  border: none !important;
16
  background: transparent;
17
  text-transform: none;
18
  &.Mui-disabled {
19
    cursor: not-allowed;
20
    pointer-events: auto;
21
  }
22
  & .MuiButton-startIcon {
23
    color: ${(props) => props.iconColor ?? "#44A759"};
×
24
    margin-right: 4px;
25
    & svg {
26
      font-size: 23px;
27
    }
28
  }
29
  &:hover {
30
    background: none;
31
  }
32
`;
33

34
type Props = ButtonProps & {
35
  label?: string;
36
  placement?: StackProps["justifyContent"];
37
  iconColor?: string;
38
  textColor?: string;
39
};
40

41
const AddRemoveButton: FC<Props> = ({ label, placement = "end", disabled, onClick, ...rest }) => {
2!
42
  const onClickWrapper = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
×
43
    if (disabled) {
×
44
      return;
×
45
    }
46
    if (typeof onClick === "function") {
×
47
      onClick(event);
×
48
    }
49
  };
50

51
  return (
×
52
    <Stack direction="row" justifyContent={placement} alignItems="center">
53
      <ActionButton
54
        variant="outlined"
55
        type="button"
56
        size="small"
57
        onClick={onClickWrapper}
58
        disableRipple
59
        disabled={disabled}
60
        {...rest}
61
      >
62
        {label}
63
      </ActionButton>
64
    </Stack>
65
  );
66
};
67

68
export default AddRemoveButton;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc