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
31 changes: 20 additions & 11 deletions 01/Task01.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
import React from 'react';
import { ThemeProvider } from 'styled-components';

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

import themeSettings from '../src/components/styled/theme';

const Task01 = () => {
return (
<Row>
<Col>
<RBAlert variant="primary">Uwaga! <em>Styled Components</em> nadchodzi!</RBAlert>
</Col>
<Col>
<Alert>Uwaga! <em>Styled Components</em> nadchodzi!</Alert>
</Col>
</Row>
)
}
return (
<Row>
<Col>
<RBAlert variant='primary'>
Uwaga! <em>Styled Components</em> nadchodzi!
</RBAlert>
</Col>
<Col>
<ThemeProvider theme={themeSettings}>
<Alert variant='primary'>
Uwaga! <em>Styled Components</em> nadchodzi!
</Alert>
</ThemeProvider>
</Col>
</Row>
);
};

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


export default Task01;

30 changes: 19 additions & 11 deletions 02/Task02.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
import React from 'react';
import { ThemeProvider } from 'styled-components';

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

const Task02 = () => {
return (
<Row>
<Col>
<RBButton variant="primary" size="lg">Button!</RBButton>
</Col>
<Col>
Button!
</Col>
</Row>
)
}
return (
<Row>
<Col>
<RBButton variant='primary' size='lg'>
Button!
</RBButton>
</Col>
<Col>
<ThemeProvider theme={buttonSettings}>
<Button variant='primary' size='lg'>
Button!
</Button>
</ThemeProvider>
</Col>
</Row>
);
};

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


export default Task02;

37 changes: 20 additions & 17 deletions 03/Task03.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
import React from 'react';
import Breadcrumb from '../src/components/Breadcrumb';

import { Row, Col, Breadcrumb as RBBreadcrumb } from 'react-bootstrap';

const Task03 = () => {
return (
<Row>
<Col>
<RBBreadcrumb>
<RBBreadcrumb.Item href="#">Home</RBBreadcrumb.Item>
<RBBreadcrumb.Item href="https://getbootstrap.com/docs/4.0/components/breadcrumb/">
Library
</RBBreadcrumb.Item>
<RBBreadcrumb.Item active>Data</RBBreadcrumb.Item>
</RBBreadcrumb>
</Col>
<Col>
Breadcrumb!
</Col>
</Row>
)
}
return (
<Row>
<Col>
<RBBreadcrumb>
<RBBreadcrumb.Item href='#'>Home</RBBreadcrumb.Item>
<RBBreadcrumb.Item href='https://getbootstrap.com/docs/4.0/components/breadcrumb/'>Library</RBBreadcrumb.Item>
<RBBreadcrumb.Item active>Data</RBBreadcrumb.Item>
</RBBreadcrumb>
</Col>
<Col>
<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>
);
};

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


export default Task03;

79 changes: 57 additions & 22 deletions 04/Task04.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,64 @@
import React from 'react';
import Tabs from '../src/components/Tabs/Tabs';
import Tab from '../src/components/Tabs/Tab';

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

const Task04 = () => {
return (
<Row>
<Col>
<RBTabs defaultActiveKey="profile" id="uncontrolled-tab-example">
<RBTab 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>
</RBTab>
<RBTab 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>
</RBTab>
<RBTab 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>
</RBTab>
</RBTabs>
</Col>
<Col>
Tabs!
</Col>
</Row>
)
}
return (
<Row>
<Col>
<RBTabs defaultActiveKey='profile' id='uncontrolled-tab-example'>
<RBTab 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>
</RBTab>
<RBTab 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>
</RBTab>
<RBTab 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>
</RBTab>
</RBTabs>
</Col>
<Col>
<Tabs defaultActiveKey='profile'>
<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>
);
};

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


export default Task04;

56 changes: 35 additions & 21 deletions 05/Task05.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,43 @@
import React from 'react';
import Card from '../src/components/Card/Card';
import { ThemeProvider } from 'styled-components';
import Button from '../src/components/Button/Button';
import buttonSettings from '../src/components/Button/theme';

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

const Task05 = () => {
return (
<Row>
<Col>
<RBCard style={{ width: '18rem' }}>
<RBCard.Img variant="top" src="https://picsum.photos/100/80" />
<RBCard.Body>
<RBCard.Title>Card Title</RBCard.Title>
<RBCard.Text>
Some quick example text to build on the card title and make up the bulk of
the card's content.
</RBCard.Text>
<RBButton variant="primary">Go somewhere</RBButton>
</RBCard.Body>
</RBCard>
</Col>
<Col>
Card!
</Col>
</Row>
)
}
return (
<Row>
<Col>
<RBCard style={{ width: '18rem' }}>
<RBCard.Img variant='top' src='https://picsum.photos/100/80' />
<RBCard.Body>
<RBCard.Title>Card Title</RBCard.Title>
<RBCard.Text>
Some quick example text to build on the card title and make up the bulk of the card's content.
</RBCard.Text>
<RBButton variant='primary'>Go somewhere</RBButton>
</RBCard.Body>
</RBCard>
</Col>
<Col>
<Card width='18rem'>
<Card.Img 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>
<ThemeProvider theme={buttonSettings}>
<Button variant='primary' $padding="6px 12px" $fontSize='16px'>Go somewhere</Button>
</ThemeProvider>
</Card.Body>
</Card>
</Col>
</Row>
);
};

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


export default Task05;

8 changes: 3 additions & 5 deletions src/components/Alert/Alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import React from 'react';

import { StyledAlert } from './Alert.styled';

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

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

const defaultTheme = {
color: '#000',
bg: '#f8f9fa',
border: '#dcdcdc',
};

const StyledAlert = styled.div`
display: block;
`
display: block;
border-radius: 4px;
color: var(--color-alfa);
padding: 12px 16px;

${({ theme, variant }) => {
const themeVariant = theme?.[variant];
const final = themeVariant || defaultTheme;

return `
--color-alfa: ${final.color};
background-color: ${final.bg};
border: 1px solid ${final.border};
`;
}}
`;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


export { StyledAlert };
17 changes: 17 additions & 0 deletions src/components/Breadcrumb/Breadcrumb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import BreadcrumbItem from './BreadcrumbItem';
import { BreadcrumbNav, BreadcrumbList } from './Breadcrumb.styled';

const Breadcrumb = ({children}) => {
return (
<BreadcrumbNav>
<BreadcrumbList>
{children}
</BreadcrumbList>
</BreadcrumbNav>
)
}

export default Object.assign(Breadcrumb, {
Item: BreadcrumbItem,
});

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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

const BreadcrumbNav = styled.nav`
font-size: 16px;
line-height: 1.5;
color: #212529;
text-align: left;
`
const BreadcrumbList = styled.ol`
display: flex;
list-style: none;
padding: 12px 16px;
margin-bottom: 16px;
background-color: #e9ecef;
border-radius: 4px;
`
const BreadcrumbListItem = styled.li`
& + &::before {
content: "/";
padding: 0 8px;
color: #6c757d;
}

a {
text-decoration: none;
color: #007bff;
background-color: transparent;
}

&.active {
color: #6c757d;
}
`

export {BreadcrumbNav, BreadcrumbList, BreadcrumbListItem}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Loading