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

IQSS / dataverse-frontend / 4820973537

27 Apr 2023 02:28PM UTC coverage: 99.752% (+0.3%) from 99.494%
4820973537

push

github

MellyGray
fix(Buttons): add border to buttons to differenciate them in a ButtonGroup

49 of 50 branches covered (98.0%)

Branch coverage included in aggregate %.

353 of 353 relevant lines covered (100.0%)

2.88 hits per line

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

98.04
/src/sections/ui/dropdown-button/DropdownButton.tsx
1
import { DropdownButton as DropdownButtonBS } from 'react-bootstrap'
1✔
2
import { ReactNode } from 'react'
1✔
3
import styles from './DropdownButton.module.scss'
1✔
4
import { Icon } from '../icon.enum'
1✔
5
import { ButtonGroup } from '../button-group/ButtonGroup'
1✔
6

1✔
7
type DropdownButtonVariant = 'primary' | 'secondary'
1✔
8

1✔
9
interface DropdownButtonProps {
1✔
10
  id: string
1✔
11
  title: string
1✔
12
  variant?: DropdownButtonVariant
1✔
13
  icon?: Icon
1✔
14
  withSpacing?: boolean
1✔
15
  asButtonGroup?: boolean
1✔
16
  children: ReactNode
1✔
17
}
1✔
18

1✔
19
export function DropdownButton({
1✔
20
  id,
4✔
21
  title,
4✔
22
  variant = 'primary',
4✔
23
  icon,
4✔
24
  withSpacing,
4✔
25
  asButtonGroup,
4✔
26
  children
4✔
27
}: DropdownButtonProps) {
4✔
28
  const spacingClass = withSpacing ? styles.spacing : ''
4!
29

4✔
30
  return (
4✔
31
    <DropdownButtonBS
4✔
32
      className={`${spacingClass} ${styles.border}`}
4✔
33
      id={id}
4✔
34
      title={
4✔
35
        <>
4✔
36
          {icon && <span className={`${styles.icon} ${icon}`} role="img" aria-label={icon}></span>}
4✔
37
          {title}
4✔
38
        </>
4✔
39
      }
4✔
40
      variant={variant}
4✔
41
      as={asButtonGroup ? ButtonGroup : undefined}>
4✔
42
      {children}
4✔
43
    </DropdownButtonBS>
4✔
44
  )
4✔
45
}
4✔
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

© 2025 Coveralls, Inc