diff --git a/src/components/CommonHeader.tsx b/src/components/CommonHeader.tsx index e0387c1f2..b351b750f 100644 --- a/src/components/CommonHeader.tsx +++ b/src/components/CommonHeader.tsx @@ -5,7 +5,7 @@ import { Text, nullable } from '@taskany/bricks'; import { PageContent } from './Page'; interface CommonHeaderProps { - title: string; + title: React.ReactNode; preTitle?: React.ReactNode; description?: React.ReactNode; children?: React.ReactNode; diff --git a/src/components/PageTitle.tsx b/src/components/PageTitle.tsx new file mode 100644 index 000000000..08e9a874a --- /dev/null +++ b/src/components/PageTitle.tsx @@ -0,0 +1,36 @@ +import { Text } from '@taskany/bricks'; +import { gray4, gray7 } from '@taskany/colors'; +import styled from 'styled-components'; + +interface PageTitleProps { + title: string; + subtitle?: string; + onClick?: () => void; +} + +const StyledText = styled(Text)` + cursor: pointer; + + transition: color 200ms ease-in-out; + + ${({ onClick }) => + onClick && + ` + :hover { + color: ${gray7}; + } + `} +`; +export const PageTitle: React.FC = ({ title, subtitle, onClick }) => ( + <> + {title} + {subtitle && ( + <> + :{' '} + + {subtitle} + + + )} + +);