mirror of
https://github.com/IT4Change/ohmyform-ui.git
synced 2025-12-13 01:35:51 +00:00
19 lines
512 B
TypeScript
19 lines
512 B
TypeScript
import React from 'react'
|
|
import styled from 'styled-components'
|
|
import { FormDesignFragment } from '../../graphql/fragment/form.fragment'
|
|
|
|
interface Props {
|
|
type: 'question' | 'answer'
|
|
design: FormDesignFragment
|
|
}
|
|
const Header = styled.h2`
|
|
color: ${(props: Props) =>
|
|
props.type === 'question'
|
|
? props.design.colors.questionColor
|
|
: props.design.colors.answerColor};
|
|
`
|
|
|
|
export const StyledH2: React.FC<Props> = ({ children, ...props }) => {
|
|
return <Header {...props}>{children}</Header>
|
|
}
|