Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 01/Task01.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ const Task01 = () => {
return (
<Row>
<Col>
<RBAlert variant="primary">Uwaga! <em>Styled Components</em> nadchodzi!</RBAlert>
<RBAlert variant="warning">Uwaga! <em>Styled Components</em> nadchodzi!</RBAlert>
</Col>
<Col>
<Alert>Uwaga! <em>Styled Components</em> nadchodzi!</Alert>
<Alert variant="warning">Uwaga! <em>Styled Components</em> nadchodzi!</Alert>
</Col>
</Row>
)
Expand Down
2 changes: 1 addition & 1 deletion 02/Task02.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Task02 = () => {
<RBButton variant="primary" size="lg">Button!</RBButton>
</Col>
<Col>
Button!
<Button variant="primary">Button!</Button>
</Col>
</Row>
)
Expand Down
9 changes: 8 additions & 1 deletion 03/Task03.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';

import { Row, Col, Breadcrumb as RBBreadcrumb } from 'react-bootstrap';
import Breadcrumb from './../src/components/Breadcrumb'

const Task03 = () => {
return (
Expand All @@ -15,7 +16,13 @@ const Task03 = () => {
</RBBreadcrumb>
</Col>
<Col>
Breadcrumb!
<Breadcrumb>
<Breadcrumb.Item href="#">Home</Breadcrumb.Item>
<Breadcrumb.Item href="https://getbootstrap.com/docs/4.0/components/breadcrumb/">
Library
</Breadcrumb.Item>
<Breadcrumb.Item active>Data</Breadcrumb.Item>
</Breadcrumb>
</Col>
</Row>
)
Expand Down
13 changes: 12 additions & 1 deletion 04/Task04.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';

import { Row, Col, Tabs as RBTabs, Tab as RBTab, } from 'react-bootstrap';
import {Tabs, Tab} from '../src/components/Tabs'

const Task04 = () => {
return (
Expand All @@ -19,7 +20,17 @@ const Task04 = () => {
</RBTabs>
</Col>
<Col>
Tabs!
<Tabs defaultActiveKey="profile" id="uncontrolled-tab-example">
<Tab eventKey="home" title="Home">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur condimentum lacus nec ligula faucibus rhoncus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; </p>
</Tab>
<Tab eventKey="profile" title="Profile">
<p>Donec dignissim ultricies felis, eu dictum eros congue in. In gravida lobortis libero nec tempus. Cras rutrum nisl ut leo volutpat rhoncus. Nulla massa nulla, viverra hendrerit laoreet at, tincidunt eu lacus.</p>
</Tab>
<Tab eventKey="contact" title="Contact" disabled>
<p>Vivamus metus nulla, fermentum eget placerat vitae, mollis interdum elit. Pellentesque arcu augue, vulputate ut porttitor ut, suscipit non orci. Integer justo odio, suscipit eget tortor nec, molestie lobortis eros. Nullam commodo elit sit amet lacus blandit aliquet. Mauris at nibh eget nisl pulvinar dignissim.</p>
</Tab>
</Tabs>
</Col>
</Row>
)
Expand Down
14 changes: 13 additions & 1 deletion 05/Task05.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';

import { Row, Col, Card as RBCard, Button as RBButton } from 'react-bootstrap';
import Button from '../src/components/Button';
import Card from '../src/components/Card';

const Task05 = () => {
return (
Expand All @@ -19,7 +21,17 @@ const Task05 = () => {
</RBCard>
</Col>
<Col>
Card!
<Card style={{ width: '18rem' }}>
<Card.Img variant="top" src="https://picsum.photos/100/80" />
<Card.Body>
<Card.Title>Card Title</Card.Title>
<Card.Text>
Some quick example text to build on the card title and make up the bulk of
the card's content.
</Card.Text>
<Button variant="primary">Go somewhere</Button>
</Card.Body>
</Card>
</Col>
</Row>
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/Alert/Alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { StyledAlert } from './Alert.styled';

const Alert = props => {
return (
<StyledAlert>{props.children}</StyledAlert>
<StyledAlert variant={props.variant}>{props.children}</StyledAlert>
);
}

Expand Down
13 changes: 10 additions & 3 deletions src/components/Alert/Alert.styled.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import styled from 'styled-components';

const StyledAlert = styled.div`
display: block;
`
const DefaultStyledAlert = styled.div`
position: relative;
padding: 0.75rem 1.25rem;
margin-bottom: 1rem;
border: 1px solid transparent;
border-radius: 0.25rem;
`;


const StyledAlert = styled(DefaultStyledAlert)(({variant, theme}) => theme.alert[variant])

export { StyledAlert };
35 changes: 21 additions & 14 deletions src/components/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React from 'react';
import { Container, Row, Col } from 'react-bootstrap';
import { ThemeProvider } from 'styled-components';
import theme from './styled/theme'
import StyledGlobal from './styled/Global';

import Task01 from './../../01/Task01';
import Task02 from './../../02/Task02';
Expand All @@ -8,23 +11,27 @@ import Task04 from './../../04/Task04';
import Task05 from './../../05/Task05';



const App = () => {
return (
<>
<Container fluid>
<Row>
<Col>
<h2>Komponenty React Boostrap</h2></Col>
<Col>
<h2>Komponenty Twoje</h2>
</Col>
</Row>
<Task01/>
<Task02/>
<Task03/>
<Task04/>
<Task05/>
</Container>
<ThemeProvider theme={theme}>
<StyledGlobal/>
<Container fluid>
<Row>
<Col>
<h2>Komponenty React Boostrap</h2></Col>
<Col>
<h2>Komponenty Twoje</h2>
</Col>
</Row>
<Task01/>
<Task02/>
<Task03/>
<Task04/>
<Task05/>
</Container>
</ThemeProvider>
</>
)
}
Expand Down
10 changes: 10 additions & 0 deletions src/components/Breadcrumb/Breadcrumb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import StyledBreadcrumb from './Breadcrumb.styled';

const Breadcrumb = ({children}) => {
return (
<StyledBreadcrumb>{children}</StyledBreadcrumb>
);
}

export default Breadcrumb
18 changes: 18 additions & 0 deletions src/components/Breadcrumb/Breadcrumb.styled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import styled from 'styled-components';

const DefaultStyledBreadcrumb = styled.ol`
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
padding: 0.75rem 1rem;
margin-bottom: 1rem;
list-style: none;
background-color: #e9ecef;
border-radius: 0.25rem;
`;


const StyledBreadcrumb = styled(DefaultStyledBreadcrumb)(({variant, theme}) => theme.breadcrumb[variant])

export default StyledBreadcrumb;
14 changes: 14 additions & 0 deletions src/components/Breadcrumb/BreadcrumbItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';

import StyledBreadcrumbItem from './BreadcrumbItem.styled';

const BreadcrumbItem = ({active, href, children}) => {
return (
<StyledBreadcrumbItem active={active}>
{href ? <a href={href}>{children}</a> : children}
</StyledBreadcrumbItem>
);
}

export default BreadcrumbItem

19 changes: 19 additions & 0 deletions src/components/Breadcrumb/BreadcrumbItem.styled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import styled from 'styled-components';

const DefaultStyledBreadcrumbItem = styled.li`
color: ${({active}) => active ? '#6c757d' : '#212529'};
&+& {
padding-left: 0.5rem;
}
& + &::before {
display: inline-block;
padding-right: 0.5rem;
color: #6c757d;
content: "/";
}
`;

const StyledBreadcrumbItem = styled(DefaultStyledBreadcrumbItem)(({variant, theme}) => theme.breadcrumb[variant])


export default StyledBreadcrumbItem;
7 changes: 7 additions & 0 deletions src/components/Breadcrumb/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

import Breadcrumb from "./Breadcrumb";
import BreadcrumbItem from "./BreadcrumbItem";

export default Object.assign(Breadcrumb, {
Item: BreadcrumbItem
});
11 changes: 11 additions & 0 deletions src/components/Button/Button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

import { StyledButton } from './Button.styled';

const Button = ({variant, size='lg', children}) => {
return (
<StyledButton variant={variant} size={size}>{children}</StyledButton>
);
}

export default Button;
27 changes: 27 additions & 0 deletions src/components/Button/Button.styled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import styled from 'styled-components';

const DefaultStyledButton = styled.div`
display: inline-block;
font-weight: 400;
color: #212529;
text-align: center;
vertical-align: middle;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: transparent;
border: 1px solid transparent;
padding: 0.375rem 0.75rem;
font-size: 1rem;
line-height: 1.5;
border-radius: 0.25rem;
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
`;


const VariantStyledButton = styled(DefaultStyledButton)(({variant, theme}) => theme.button.variant[variant])
const SizeStyledButton = styled(VariantStyledButton)(({size, theme}) => theme.button.size[size])

export const StyledButton = SizeStyledButton;
3 changes: 3 additions & 0 deletions src/components/Button/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Button from "./Button";

export default Button
10 changes: 10 additions & 0 deletions src/components/Card/Card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'
import { StyledCard } from './Card.styled'

const Card = ({children, style}) => {
return (
<StyledCard style={style}>{children}</StyledCard>
)
}

export default Card
17 changes: 17 additions & 0 deletions src/components/Card/Card.styled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import styled from "styled-components";

const StyledCard = styled.div`
position: relative;
display: -ms-flexbox;
display: flex;
-ms-flex-direction: column;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
background-color: #fff;
background-clip: border-box;
border: 1px solid rgba(0,0,0,.125);
border-radius: 0.25rem;
`

export { StyledCard }
10 changes: 10 additions & 0 deletions src/components/Card/CardBody.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'
import { StyledCardBody } from './CardBody.styled'

const CardBody = ({children}) => {
return (
<StyledCardBody>{children}</StyledCardBody>
)
}

export default CardBody
10 changes: 10 additions & 0 deletions src/components/Card/CardBody.styled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import styled from "styled-components";

const StyledCardBody = styled.div`
-ms-flex: 1 1 auto;
flex: 1 1 auto;
min-height: 1px;
padding: 1.25rem;
`

export { StyledCardBody }
10 changes: 10 additions & 0 deletions src/components/Card/CardImg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'
import {StyledCardImg} from './CardImg.styled'

const CardImg = ({src}) => {
return (
<StyledCardImg src={src}/>
)
}

export default CardImg
11 changes: 11 additions & 0 deletions src/components/Card/CardImg.styled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import styled from "styled-components";

const StyledCardImg = styled.img`
flex-shrink: 0;
width: 100%;
border-top-left-radius: calc(0.25rem - 1px);
border-top-right-radius: calc(0.25rem - 1px);
vertical-align: middle;
border-style: none;
`
export { StyledCardImg }
Loading