PO
Size: a a a
PO
PD
Hint.propTypes = {
/** Текст подсказки */
hint: PropTypes.string,
/** Обработчик клика */
onClick: PropTypes.func,
/** ???? */ ///////// <-- как описать?
active: PropTypes.bool,
};
S
PD
PD
const VideoInfoHint = ({
hint, //// или строка или React children элемент
}) => {
return (
<Hint
>
{(typeof hint === "string") ?
/* логика, если строка */ :
hint} // <-- React children элемент
</Hint>
);
};
const Template = args => <VideoInfoHintComponent {...args} />
export const Primary = Template.bind({});
Primary.args = {
hint: "СТРОКУ ЗДЕСЬ МОГУ ЗАДАТЬ",
};
export const Secondary = Template.bind({});
Secondary.args = {
hint: ????, <--- А КАК ЗДЕСЬ ЭЛЕМЕНТ CHILDREN задать?
};
VC
const Title = styled.h1.attrs(({ titleType }) => (titleType && { as: titleType }))`
color: #5065c8;
font-size: 19px;
letter-spacing: 1px;
line-height: 32px;
// и тд
`;
const TitleStyled = styled(TitleComponent).attrs(() => ({ as: "h2" }))`
font-size: 19px;
font-weight: 500;
text-align: center;
line-height: 1.2;
// и тд
`;
М
VC
OJ
VF
VF
VF
VF
OC
VF
VF
OC
AS
S