Skip to content

Commit 9d66c61

Browse files
committed
add admin layout
1 parent 64ef1b6 commit 9d66c61

30 files changed

+922
-42
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/components/Slider/Slider.js

package-lock.json

+109
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+9-4
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,27 @@
66
"@testing-library/jest-dom": "^4.2.4",
77
"@testing-library/react": "^9.5.0",
88
"@testing-library/user-event": "^7.2.1",
9-
"react": "^16.13.1",
10-
"react-dom": "^16.13.1",
11-
"react-scripts": "3.4.1",
129
"axios": "^0.19.2",
1310
"bootstrap": "^4.4.1",
1411
"eslint": "^6.6.0",
12+
"formik": "^2.1.4",
13+
"google-map-react": "^1.1.7",
14+
"google-maps": "^4.2.3",
15+
"google-maps-react": "^2.0.2",
1516
"hamburgers": "^1.1.3",
17+
"react": "^16.13.1",
18+
"react-dom": "^16.13.1",
1619
"react-hamburgers": "^1.0.0",
1720
"react-redux": "^7.1.3",
1821
"react-router": "^5.1.2",
1922
"react-router-dom": "^5.1.2",
23+
"react-scripts": "3.4.1",
2024
"reactstrap": "^8.4.1",
2125
"redux": "^4.0.5",
2226
"redux-thunk": "^2.3.0",
2327
"styled-components": "^5.0.1",
24-
"styled-normalize": "^8.0.7"
28+
"styled-normalize": "^8.0.7",
29+
"swiper": "^5.3.6"
2530
},
2631
"scripts": {
2732
"start": "react-scripts start",

src/assets/image/layouts/article.png

1.76 MB
Loading
1.01 MB
Loading
1.44 MB
Loading

src/assets/image/layouts/gallery.png

1.09 MB
Loading

src/assets/image/layouts/hero.png

866 KB
Loading
424 KB
Loading
183 KB
Loading

src/assets/image/layouts/slider.png

1.87 MB
Loading

src/components/Contact/Contact.js

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import styled from 'styled-components';
4+
5+
const ContactWrap = styled.div`
6+
width: 100%;
7+
background-color: var(--light);
8+
padding: 20px 40px;
9+
`;
10+
11+
const Title = styled.h1`
12+
font-weight: 700;
13+
/* text-align: center; */
14+
letter-spacing: 5px;
15+
margin-bottom: 1.5em;
16+
`;
17+
18+
const Info = styled.p`
19+
display: block;
20+
font-weight: 500;
21+
font-size: 18px;
22+
color: #000;
23+
transition: 0.3s ease;
24+
&:hover {
25+
opacity: 0.5;
26+
color: #000;
27+
text-decoration: none;
28+
}
29+
30+
& span {
31+
font-weight: 300;
32+
}
33+
`;
34+
35+
const Contact = ({ mail, phone, street, zip, city }) => (
36+
<ContactWrap>
37+
<Title>Skontaktuj się z nami!</Title>
38+
<Info as="a" href={`mailto: ${mail}`}>
39+
Email: <span>{mail}</span>
40+
</Info>
41+
<Info as="a" href={`tel: ${phone}`}>
42+
Numer telefonu: <span>{phone}</span>
43+
</Info>
44+
<Info>
45+
Adress:{' '}
46+
<span>
47+
ul.{street}, {zip} {city}
48+
</span>
49+
</Info>
50+
</ContactWrap>
51+
);
52+
53+
Contact.propTypes = {
54+
mail: PropTypes.string.isRequired,
55+
phone: PropTypes.string.isRequired,
56+
street: PropTypes.string.isRequired,
57+
zip: PropTypes.string.isRequired,
58+
city: PropTypes.string.isRequired,
59+
};
60+
61+
export default Contact;

src/components/Slider/Slider.js

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import React from 'react';
2+
import styled from 'styled-components';
3+
import PropTypes from 'prop-types';
4+
import Swiper from 'swiper';
5+
import Image from 'components/Image/Image';
6+
import 'swiper/css/swiper.css';
7+
import { Col } from 'reactstrap';
8+
9+
const SlideTitle = styled.p`
10+
color: #ffffff;
11+
font-size: 14px;
12+
background-color: #000;
13+
font-size: 700;
14+
padding: 10px 20px;
15+
`;
16+
17+
class Slider extends React.Component {
18+
componentDidMount() {
19+
// eslint-disable-next-line
20+
const mySwiper = new Swiper('.swiper-container', {
21+
direction: 'horizontal',
22+
loop: true,
23+
slidesPerView: 'auto',
24+
pagination: {
25+
el: '.swiper-pagination',
26+
clickable: true,
27+
},
28+
navigation: {
29+
nextEl: '.swiper-button-next',
30+
prevEl: '.swiper-button-prev',
31+
},
32+
});
33+
}
34+
35+
render() {
36+
const { data } = this.props;
37+
return (
38+
<div className="swiper-container">
39+
<div className="swiper-wrapper">
40+
{data.map(item => {
41+
return (
42+
<Col key={item.title} md="3" className="swiper-slide mb-5">
43+
<Image src={item.url} />
44+
<SlideTitle>{item.title}</SlideTitle>
45+
</Col>
46+
);
47+
})}
48+
</div>
49+
<div className="swiper-pagination"></div>
50+
<div className="swiper-button-prev"></div>
51+
<div className="swiper-button-next"></div>
52+
</div>
53+
);
54+
}
55+
}
56+
57+
Slider.propType = {
58+
data: PropTypes.array.isRequired,
59+
};
60+
61+
export default Slider;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import { Link } from 'react-router-dom';
4+
import styled from 'styled-components';
5+
6+
const StyledLink = styled(Link)`
7+
display: block;
8+
font-size: 1.5rem;
9+
color: var(--dark);
10+
font-weight: 500;
11+
margin-bottom: 0.7em;
12+
transition: 0.3s ease;
13+
14+
&:hover {
15+
color: var(--gray);
16+
text-decoration: none;
17+
}
18+
`;
19+
20+
const LinkAdmin = ({ children, link }) => <StyledLink to={link}>{children}</StyledLink>;
21+
22+
LinkAdmin.propTypes = {
23+
children: PropTypes.element.isRequired,
24+
link: PropTypes.string.isRequired,
25+
};
26+
27+
export default LinkAdmin;

src/components/text/MainTitle/MainTitle.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ const Wrap = styled.div`
88
text-align: center;
99
`;
1010

11-
const MainTitle = ({ children }) => (
12-
<Wrap>
11+
const MainTitle = ({ children, className }) => (
12+
<Wrap className={className}>
1313
<Title>{children}</Title>
1414
</Wrap>
1515
);
1616

1717
MainTitle.propTypes = {
1818
children: PropTypes.element.isRequired,
19+
className: PropTypes.string,
1920
};
21+
22+
MainTitle.defaultProps = {
23+
className: '',
24+
};
25+
2026
export default MainTitle;

0 commit comments

Comments
 (0)