[ABANDONED] React/Redux front end for the Flexor social network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.2 KiB

5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
  1. import React, { FC } from 'react'
  2. import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
  3. import { IconDefinition } from '@fortawesome/free-solid-svg-icons'
  4. import { useTheme } from '../../hooks'
  5. import FieldLabel from '../../components/controls/field-label'
  6. interface Props {
  7. label: string
  8. value?: string
  9. icon?: IconDefinition
  10. }
  11. const StaticField: FC<Props> = ({ label, value, icon }) => {
  12. const theme = useTheme()
  13. return (
  14. <div className="field">
  15. <FieldLabel>{label}</FieldLabel>
  16. <div className="control-container">
  17. {icon &&
  18. <div className="control-icon" style={{ backgroundColor: theme.primary, color: theme.primaryAlternate }}>
  19. <FontAwesomeIcon icon={icon} />
  20. </div>
  21. }
  22. <div className="control">
  23. <input
  24. style={{ backgroundColor: theme.backgroundSecondary, borderColor: theme.secondary, color: theme.text }}
  25. type="text"
  26. value={value}
  27. readOnly />
  28. </div>
  29. </div>
  30. </div>
  31. )
  32. }
  33. export default StaticField