(#1) Добил вёрстку центральных блоков landing
This commit is contained in:
49
src/components/card/card.tsx
Normal file
49
src/components/card/card.tsx
Normal file
@@ -0,0 +1,49 @@
|
||||
import React from "react";
|
||||
|
||||
import { landing } from "../../assets/images";
|
||||
import { Link } from "../link";
|
||||
|
||||
import {
|
||||
Header,
|
||||
Wrapper,
|
||||
SubHeader,
|
||||
Content,
|
||||
CardImage,
|
||||
Text,
|
||||
} from "./card.style";
|
||||
|
||||
export const Card = ({
|
||||
title,
|
||||
subTitle,
|
||||
children,
|
||||
image,
|
||||
link,
|
||||
directionReverse,
|
||||
}) => (
|
||||
<Wrapper>
|
||||
<Header>
|
||||
{title && (
|
||||
<h1 className="h1">
|
||||
<Link inheritColor href={link}>
|
||||
{title}
|
||||
</Link>
|
||||
</h1>
|
||||
)}
|
||||
{subTitle && <SubHeader>{subTitle}</SubHeader>}
|
||||
</Header>
|
||||
<Content directionReverse={directionReverse}>
|
||||
{image && (
|
||||
<CardImage directionReverse={directionReverse} src={landing[image]} />
|
||||
)}
|
||||
<Text>{children}</Text>
|
||||
</Content>
|
||||
</Wrapper>
|
||||
);
|
||||
|
||||
Card.defaultProps = {
|
||||
title: void 0,
|
||||
subTitle: void 0,
|
||||
image: void 0,
|
||||
link: void 0,
|
||||
directionReverse: false,
|
||||
};
|
||||
Reference in New Issue
Block a user