-
-
Notifications
You must be signed in to change notification settings - Fork 76
Finish #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Finish #54
Changes from all commits
229cc11
c59b5df
71e127d
4c49784
375ed6d
0823a23
89ae681
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import React from 'react'; | ||
|
|
||
| import { Row, Col, Tabs as RBTabs, Tab as RBTab, } from 'react-bootstrap'; | ||
| import { Tab, Tabs } from '../src/components/Tabs/index' | ||
| import { Row, Col, Tabs as RBTabs, Tab as RBTab } from 'react-bootstrap'; | ||
|
|
||
| const Task04 = () => { | ||
| return ( | ||
|
|
@@ -19,7 +19,17 @@ const Task04 = () => { | |
| </RBTabs> | ||
| </Col> | ||
| <Col> | ||
| Tabs! | ||
| <Tabs> | ||
| <Tab label="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 label="Profile" active> | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| <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 label="Contact" disabled> | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ten miał być nieklikany :P |
||
| <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> | ||
| ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import React from 'react'; | ||
|
|
||
| import Card from '../src/components/Card/index'; | ||
| import { Row, Col, Card as RBCard, Button as RBButton } from 'react-bootstrap'; | ||
|
|
||
| const Task05 = () => { | ||
|
|
@@ -19,7 +19,7 @@ const Task05 = () => { | |
| </RBCard> | ||
| </Col> | ||
| <Col> | ||
| Card! | ||
| <Card/> | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| </Col> | ||
| </Row> | ||
| ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,13 @@ | ||
| import styled from 'styled-components'; | ||
|
|
||
| const StyledAlert = styled.div` | ||
| display: block; | ||
| ` | ||
| padding: 0.75rem 1.25rem; | ||
| margin-bottom: 1rem; | ||
| border: 1px solid transparent; | ||
| border-radius: 0.25rem; | ||
| color: #004085; | ||
| background-color: ${props => props.theme[props.variant] || '#cce5ff'}; | ||
| border-color: ${props => props.theme[props.variant] || '#b8daff'}; | ||
| `; | ||
|
|
||
| export { StyledAlert }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,2 @@ | ||
| import Alert from './Alert'; | ||
|
|
||
|
|
||
| export default Alert; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,24 @@ | ||
| import React from 'react'; | ||
| import { Container, Row, Col } from 'react-bootstrap'; | ||
|
|
||
| import { ThemeProvider } from 'styled-components'; | ||
| import Task01 from './../../01/Task01'; | ||
| import Task02 from './../../02/Task02'; | ||
| import Task03 from './../../03/Task03'; | ||
| import Task04 from './../../04/Task04'; | ||
| import Task05 from './../../05/Task05'; | ||
|
|
||
| const theme = { | ||
| primary: '#007bff', | ||
| primaryDark: '#0056b3', | ||
| primaryHover: '#0069d9', | ||
| secondary: '#6c757d', | ||
| secondaryDark: '#545b62', | ||
| secondaryHover: '#5a6268', | ||
| }; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
|
||
| const App = () => { | ||
| return ( | ||
| <> | ||
| <ThemeProvider theme={theme}> | ||
| <Container fluid> | ||
| <Row> | ||
| <Col> | ||
|
|
@@ -25,7 +33,7 @@ const App = () => { | |
| <Task04/> | ||
| <Task05/> | ||
| </Container> | ||
| </> | ||
| </ThemeProvider> | ||
| ) | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import React from "react"; | ||
| import {StyledBreadcrumb} from "./Breadcrumb.styled"; | ||
| import BreadcrumbItem from "./BreadcrumbItem"; | ||
|
|
||
| const Breadcrumb = ({ children }) => { | ||
| return <StyledBreadcrumb aria-label="breadcrumb"><ol>{children}</ol></StyledBreadcrumb>; | ||
| }; | ||
|
|
||
| Breadcrumb.Item = BreadcrumbItem; | ||
|
|
||
| export default Breadcrumb; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import styled from 'styled-components'; | ||
|
|
||
| const StyledBreadcrumb = styled.ol` | ||
| display: flex; | ||
| -ms-flex-wrap: wrap; | ||
| flex-wrap: wrap; | ||
| padding: 0.75rem 0; | ||
| margin-bottom: 1rem; | ||
| list-style: none; | ||
| background-color: #e9ecef; | ||
| border-radius: 0.25rem; | ||
| justify-content: flex-start; | ||
| `; | ||
|
|
||
| export { StyledBreadcrumb }; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import React from "react"; | ||
| import { StyledBreadcrumbItem } from "./BreadcrumbItem.styled"; | ||
|
|
||
| const BreadcrumbItem = ({ href, active, children }) => { | ||
| return ( | ||
| <StyledBreadcrumbItem active={active}> | ||
| {href ? <a href={href}>{children}</a> : children} | ||
| </StyledBreadcrumbItem> | ||
| ); | ||
| }; | ||
|
|
||
| export default BreadcrumbItem; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import styled from "styled-components"; | ||
|
|
||
| const StyledBreadcrumbItem = styled.li` | ||
| display: inline; | ||
| margin-right: 0.5rem; | ||
|
|
||
| & + &::before { | ||
| content: "/"; | ||
| padding-right: 0.5rem; | ||
| } | ||
|
|
||
| & a { | ||
| color: #007bff; | ||
| text-decoration: none; | ||
|
|
||
| &:hover { | ||
| color: #0056b3; | ||
| text-decoration: underline; | ||
| } | ||
| } | ||
|
|
||
| &.active { | ||
| color: #6c757d; | ||
| pointer-events: none; | ||
| } | ||
| `; | ||
|
|
||
| export { StyledBreadcrumbItem }; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| import Breadcrumb from './Breadcrumb'; | ||
| export default Breadcrumb; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import React from 'react'; | ||
| import { StyledButton } from './Button.styled'; | ||
|
|
||
| const Button = ({ variant, size, active, disabled, children }) => { | ||
| return ( | ||
| <StyledButton variant={variant} size={size} active={active} disabled={disabled}> | ||
| {children} | ||
| </StyledButton> | ||
| ); | ||
| } | ||
|
|
||
| export default Button; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import styled from 'styled-components'; | ||
|
|
||
| const StyledButton = styled.button` | ||
| padding: ${props => (props.size === 'lg' ? '0.5rem 1rem' : '0.25rem 0.5rem')}; | ||
| font-size: ${props => (props.size === 'lg' ? '1.25rem' : '1rem')}; | ||
| background-color: ${props => props.theme[props.variant] || '#007bff'}; | ||
| border: 1px solid ${props => props.theme[props.variant] || '#007bff'}; | ||
| border-radius: 0.25rem; | ||
| color: white; | ||
| opacity: ${props => (props.disabled ? 0.65 : 1)}; | ||
| pointer-events: ${props => (props.disabled ? 'none' : 'initial')}; | ||
| cursor: ${props => (props.disabled ? 'default' : 'pointer')}; | ||
|
|
||
| &:active { | ||
| background-color: ${props => props.active ? props.theme[props.variant + 'Dark'] : props.theme[props.variant]}; | ||
| } | ||
|
|
||
| &:hover { | ||
| background-color: ${props => !props.disabled && props.theme[props.variant + 'Hover']}; | ||
| } | ||
| `; | ||
|
|
||
| export { StyledButton }; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| import Button from './Button'; | ||
| export default Button; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import React from "react"; | ||
| import { StyledCard, CardImageTop, CardBody, CardTitle, CardText, Button} from "./Card.styled"; | ||
|
|
||
| const Card = () => { | ||
| return ( | ||
| <StyledCard> | ||
| <CardImageTop src="https://picsum.photos/100/80" alt="Card image cap" /> | ||
| <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> | ||
| <Button>Go somewhere</Button> | ||
| </CardBody> | ||
| </StyledCard> | ||
| ) | ||
| } | ||
|
|
||
| export default Card; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| import styled from "styled-components"; | ||
|
|
||
| const StyledCard = styled.div` | ||
| border: 1px solid rgba(0,0,0,.125); | ||
| border-radius: 0.25rem; | ||
| width: 18rem; | ||
| overflow: hidden; | ||
| `; | ||
|
|
||
| const CardImageTop = styled.img` | ||
| width: 100%; | ||
| height: auto; | ||
| `; | ||
|
|
||
| const CardBody = styled.div` | ||
| padding: 1.25rem; | ||
| `; | ||
|
|
||
| const CardTitle = styled.h5` | ||
| margin-bottom: 0.75rem; | ||
| `; | ||
|
|
||
| const CardText = styled.p` | ||
| color: #6c757d; | ||
| `; | ||
|
|
||
| const Button = styled.button` | ||
| color: #fff; | ||
| background-color: #007bff; | ||
| border-color: #007bff; | ||
| display: inline-block; | ||
| font-weight: 400; | ||
| text-align: center; | ||
| vertical-align: middle; | ||
| user-select: none; | ||
| background-clip: padding-box; | ||
| border: 1px solid transparent; | ||
| padding: 0.375rem 0.75rem; | ||
| font-size: 1rem; | ||
| line-height: 1.5; | ||
| border-radius: 0.25rem; | ||
| transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; | ||
|
|
||
| &:hover { | ||
| background-color: #0069d9; | ||
| border-color: #0062cc; | ||
| } | ||
| `; | ||
|
|
||
| export { StyledCard, CardImageTop, CardBody, CardTitle, CardText, Button }; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| import Card from './Card'; | ||
| export default Card; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍