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

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

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>
<RBAlert variant='success'>
Uwaga! <em>Styled Components</em> nadchodzi!
</RBAlert>
</Col>
<Col>
<ThemeProvider theme={themeSettings}>
<Alert variant={themeSettings.primary}>
Uwaga! <em>Styled Components</em> nadchodzi!
</Alert>
</ThemeProvider>
<Alert>Uwaga! <em>Styled defaultTheme Components</em> nadchodzi!</Alert>
</Col>
</Row>
);
};
Copy link
Owner

Choose a reason for hiding this comment

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

👍

export default Task01;


42 changes: 30 additions & 12 deletions 02/Task02.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
import React from 'react';

import { ThemeProvider } from 'styled-components';
import { theme } from './../src/components/Button/Button.styled';

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

const Task02 = () => {
return (
<Row>
<Col>
<RBButton variant="primary" size="lg">Button!</RBButton>
</Col>
<Col>
Button!
</Col>
</Row>
)
}
return (
<Row>
<Col>
<RBButton variant='secondary' size='lg'>
Button!
</RBButton>
<RBButton active variant='secondary' size='sm'>
Button!
</RBButton>
<RBButton disabled variant='secondary'>
Button!
</RBButton>
<RBButton variant='primary'>Button!</RBButton>
</Col>
<Col>
<ThemeProvider theme={theme}>
<Button size='lg' variant='secondary'>
Button!
</Button>
<Button size='sm' active variant={'secondary'}>Button!</Button>
<Button disabled variant={'secondary'}>Button!</Button>
<Button variant={'primary'}>Button!</Button>
</ThemeProvider>
</Col>
</Row>
);
};
Copy link
Owner

Choose a reason for hiding this comment

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

👍


export default Task02;

41 changes: 22 additions & 19 deletions 03/Task03.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
import React from 'react';

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

import Breadcrumb from '../src/components/Breadcrumb';
import BreadcrumbItem from '../src/components/Breadcrumb/Bredcrumb.Item';

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>
<BreadcrumbItem href='#'>Home</BreadcrumbItem>
<BreadcrumbItem href='https://getbootstrap.com/docs/4.0/components/breadcrumb/'>Library</BreadcrumbItem>
<BreadcrumbItem active={true}>Data</BreadcrumbItem>
</Breadcrumb>
</Col>
</Row>
);
};
Copy link
Owner

Choose a reason for hiding this comment

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

👍


export default Task03;

81 changes: 57 additions & 24 deletions 04/Task04.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,62 @@
import React from 'react';

import { Row, Col, Tabs as RBTabs, Tab as RBTab, } from 'react-bootstrap';
import Tabs from '../src/components/Tab/Tabs';
import Tab from '../src/components/Tab/Tab';
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>
)
}

export default 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 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 disabled eventKey='contact' title='Contact'>
<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>
);
};

export default Task04;
Copy link
Owner

Choose a reason for hiding this comment

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

👍

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

import Button from './../src/components/Button';

import { Card, CardBody, CardImg, CardText, CardTitle } from '../src/components/Card';

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 style={{ width: '18rem' }}>
<CardImg src='https://picsum.photos/100/80' />
<CardBody>
<CardTitle>Card Title</CardTitle>
<CardText>
Some quick example text to build on the card title and make up the bulk of the card's content.
</CardText>
<ThemeProvider theme={theme}>
Copy link
Owner

Choose a reason for hiding this comment

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

Pamiętaj, że theme zazwyczaj jest jeden dla wszystkich komponentów :)
Oczywiście teraz nie ma co tego zmieniać, ale warto pamiętać przy projekcie ;)

<Button variant={'primary'}>Go somewhere</Button>
</ThemeProvider>
</CardBody>
</Card>
</Col>
</Row>
);
};

export default Task05;

1 change: 1 addition & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react';
import { createRoot } from 'react-dom/client';

import App from './components/App';
import Task01 from '../01/Task01';


const root = createRoot(document.querySelector('#root'));
Expand Down
6 changes: 2 additions & 4 deletions src/components/Alert/Alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import React from 'react';
import { StyledAlert } from './Alert.styled';

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

export default Alert;
29 changes: 26 additions & 3 deletions src/components/Alert/Alert.styled.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
import styled from 'styled-components';

const StyledAlert = styled.div`
display: block;
`
padding: 12px 20px;
border-radius: 4px;
margin: 0 0 16px;
border: 1px solid transparent;
color: ${props => props.theme.color};
background-color: ${props => props.theme.backgroundColor};
`;

export { StyledAlert };
StyledAlert.defaultProps = {
theme: {
color: 'black',
backgroundColor: 'aquamarine',
},
};

const themeSettings = {
primary: {
color: '#004085',
backgroundColor: '#CCE5FF',
},
secondary: {
color: '#383D41',
backgroundColor: '#E2E3E5',
},
};

export { StyledAlert, themeSettings };
Copy link
Owner

Choose a reason for hiding this comment

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

👎

12 changes: 12 additions & 0 deletions src/components/Breadcrumb/Breadcrumb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import { StyledBreadCrumb, StyledNav } from './Breadcrumb.styled';

const Breadcrumb = props => {
return (
<StyledNav>
<StyledBreadCrumb>{props.children}</StyledBreadCrumb>
</StyledNav>
);
};

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

const StyledNav = styled.nav``;

const StyledBreadCrumb = styled.ul`
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
padding: 0.75rem 1rem;
margin-bottom: 1rem;
list-style: none;
background-color: #e9ecef;
border-radius: 0.25rem;
`;

const StyledItem = styled.li`
color: #6c757d;
&:not(:last-child):after {
content: '/';
display: inline-block;
padding-left: 0.5rem;
padding-right: 0.5rem;
}
`;

const StyledLink = styled.a`
color: ${props => (props.active ? '#6c757d' : '#007bff')};
`;
export { StyledNav, StyledBreadCrumb, StyledItem, StyledLink };
Copy link
Owner

Choose a reason for hiding this comment

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

👍

Loading