Dynamic realtime profile ReadMe linked with spotify
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.

51 lines
920 B

  1. import React from "react";
  2. const sizes = {
  3. default: 14,
  4. small: 12,
  5. };
  6. const colors = {
  7. default: "#24292e",
  8. "gray-light": "#e1e4e8",
  9. gray: "#586069",
  10. "gray-dark": "#24292e",
  11. };
  12. const families = {
  13. default:
  14. "-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji",
  15. mono: "SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace",
  16. };
  17. const weights = {
  18. default: 400,
  19. bold: 600,
  20. };
  21. const Text: React.FC<any> = ({
  22. children = "",
  23. weight = "default",
  24. family = "default",
  25. color = "default",
  26. size = "default",
  27. ...props
  28. }) => {
  29. return (
  30. <p
  31. style={{
  32. whiteSpace: "pre",
  33. fontSize: `${sizes[size]}px`,
  34. lineHeight: 1.5,
  35. fontFamily: families[family],
  36. color: colors[color],
  37. fontWeight: weights[weight],
  38. }}
  39. {...props}
  40. >
  41. {children}
  42. </p>
  43. );
  44. };
  45. export default Text;