Fretboard component written in React.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

26 lines
507 B

  1. import * as React from 'react'
  2. import * as PropTypes from 'prop-types'
  3. const propTypes = {
  4. stringNumber: PropTypes.number.isRequired,
  5. }
  6. type Props = PropTypes.InferProps<typeof propTypes>
  7. const FretboardString: React.FC<Props> = ({
  8. stringNumber,
  9. }) => (
  10. <span
  11. style={{
  12. display: 'block',
  13. width: '100%',
  14. height: `${0.03125 + stringNumber * 0.03125}rem`,
  15. backgroundColor: 'currentColor',
  16. }}
  17. />
  18. )
  19. FretboardString.propTypes = propTypes
  20. export default FretboardString