mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
[rebass] add ExtendedBox to test, add prop to CustomComponent example
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
import * as React from "react";
|
||||
import styled from "styled-components";
|
||||
import { Box, Flex, Text, Heading, Button, Link, Image, Card } from "rebass";
|
||||
|
||||
const CustomComponent: React.FunctionComponent = ({ children }) => {
|
||||
return <div>{children}</div>;
|
||||
};
|
||||
|
||||
const ExtendedBox = styled(Box)`
|
||||
color: red;
|
||||
`;
|
||||
|
||||
ExtendedBox.defaultProps = {
|
||||
p: 3
|
||||
};
|
||||
|
||||
() => (
|
||||
<Box width={1} css={{ height: "100vh" }} py={[1, 2, 3]} ml="1em">
|
||||
<Flex width={1} alignItems="center" justifyContent="center">
|
||||
@@ -33,10 +42,13 @@ const CustomComponent: React.FunctionComponent = ({ children }) => {
|
||||
<Link href="https://rebassjs.org" title="Rebass" target="_blank">
|
||||
Link
|
||||
</Link>
|
||||
<Box as={CustomComponent}>CustomComponent</Box>
|
||||
<Button bg="magenta" border="1em" borderRadius="1em">
|
||||
Button
|
||||
</Button>
|
||||
<Box as={CustomComponent} bg="red">
|
||||
CustomComponent
|
||||
</Box>
|
||||
<ExtendedBox m={2}>ExtendedBox</ExtendedBox>
|
||||
</Flex>
|
||||
</Box>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user