PageHeading.tsx 696 B

123456789101112131415161718192021222324252627282930313233343536
  1. import styled, { css } from 'styled-components';
  2. import React from 'react';
  3. interface Props {
  4. text: string;
  5. className?: string;
  6. }
  7. const PageHeading: React.FC<Props> = ({ text, className, children }) => {
  8. return (
  9. <div className={className}>
  10. <h1>{text}</h1>
  11. <div>{children}</div>
  12. </div>
  13. );
  14. };
  15. export default styled(PageHeading)(
  16. ({ theme }) => css`
  17. height: 56px;
  18. display: flex;
  19. justify-content: space-between;
  20. align-items: center;
  21. padding: 0px 16px;
  22. & h1 {
  23. font-size: 24px;
  24. font-weight: 500;
  25. line-height: 32px;
  26. color: ${theme.heading.h1.color};
  27. }
  28. & > div {
  29. display: flex;
  30. gap: 16px;
  31. }
  32. `
  33. );