Skip to content

Commit 81eb8b9

Browse files
committed
Update readme'
1 parent a405577 commit 81eb8b9

File tree

18 files changed

+98
-27
lines changed

18 files changed

+98
-27
lines changed

README.md

+41-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# React App Boilerplate
1+
# React WordPress Theme 🎨
22
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
33

44
A React theme for WordPress, using Decoupled Architecture.
@@ -14,6 +14,34 @@ Backend in WordPress.
1414
|--------------------------------------------------------|-----------------|
1515
| [Imran Sayed](mailto:[email protected]) | @imranhsayed |
1616

17+
## Usage
18+
19+
1. Clone the WordPress plugin [REST API endpoints](https://github.com/imranhsayed/rest-api-endpoints) in your WordPress
20+
plugin directory and activate it.
21+
22+
2. The REST API endpoints, registers custom endpoints and also registers two menus. So please create two menus
23+
`Header Menu` and `Footer Menu` and select their respective menu location as `Travel Header Menu` and `Travel Footer Menu`
24+
as shown in the picture.
25+
26+
- Set Header menu as `Travel Header Menu`
27+
28+
![](demos/header-menu.png)
29+
30+
- Set Footer menu as `Travel Footer Menu`
31+
![](demos/footer-menu.png)
32+
33+
3. Set the siteLogo in `client-config.js`
34+
35+
```javascript
36+
const config = {
37+
siteURL: 'https://wordpressSite.com',
38+
headerMenuLocation: 'travel-menu-header', // Change this menu location name to another, if you would like a different menu to be used for header.
39+
footerMenuLocation: 'travel-menu-footer', // Change this menu location name to another, if you would like a different menu to be used for footer.
40+
siteTitle: 'React WordPress Theme', // Will be used if we don't set site title from WordPress customizer.
41+
siteDescription: 'Awesome theme', // Will be used if we don't set site description from WordPress customizer.
42+
};
43+
```
44+
1745
## Development
1846

1947
**Install**
@@ -64,6 +92,18 @@ Format code with prettier
6492
npm run format-js
6593
```
6694

95+
Run test
96+
97+
```bash
98+
npm run test
99+
```
100+
101+
Update test
102+
103+
```bash
104+
npm run test:update
105+
```
106+
67107
**precommit**
68108

69109
You should run precommit to check for any eslint, stylint errors/warnings and to ensure all tests are passing before making a PR ready for review.

__mocks__/fileMock.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = 'i-am-a-stubbed-file';

__mocks__/styleMock.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {};

client-config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const config = {
2-
siteURL: 'http://localhost:8888/newsletter',
2+
siteURL: 'https://codeytek.com/woo-next',
33
headerMenuLocation: 'travel-menu-header',
44
footerMenuLocation: 'travel-menu-footer',
55
siteTitle: 'React WordPress Theme', // Will be used if we don't set site title from WordPress customizer.
6-
siteDescription: 'Awesome theme' // Will be used if we don't set site description from WordPress customizer.
6+
siteDescription: 'Awesome theme', // Will be used if we don't set site description from WordPress customizer.
77
};
88

99
export default config;

demos/footer-menu.png

133 KB
Loading

demos/header-menu.png

132 KB
Loading

package.json

+7-13
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"prod": "webpack --mode=production",
99
"eslint": "eslint ./src/*.js ./src/**/**/**/*.js ./src/**/**/**/**/*.js",
1010
"eslint:fix": "eslint --fix ./src/*.js ./src/**/**/**/*.js ./src/**/**/**/**/*.js",
11-
"stylelint": "stylelint ./src/*.scss",
12-
"stylelint:fix": "stylelint ./src/*.scss --fix",
11+
"stylelint": "stylelint ./src/*.scss ./src/**/*.scss ./src/**/**/*.scss",
12+
"stylelint:fix": "stylelint ./src/*.scss ./src/**/*.scss ./src/**/**/*.scss --fix",
1313
"format-js": "prettier .prettierrc.js --write ./src/*.js ./src/**/**/**/*.js ./src/**/**/**/**/*.js",
1414
"precommit": "npm run format-js && npm run eslint:fix && npm run stylelint:fix && npm run test",
1515
"test": "jest --verbose",
@@ -74,20 +74,14 @@
7474
"jest": {
7575
"testMatch": [
7676
"**/test/**/*.[jt]s?(x)",
77-
"**/test/**/**/*.[jt]s?(x)"
77+
"**/**/test/**/*.[jt]s?(x)"
7878
],
7979
"testPathIgnorePatterns": [
8080
"<rootDir>/node_modules/"
8181
],
82-
"moduleNameMapper": {
83-
"^image![a-zA-Z0-9$_-]+$": "GlobalImageStub",
84-
"^[./a-zA-Z0-9$_-]+\\.png$": "<rootDir>/RelativeImageStub.js",
85-
"module_name_(.*)": "<rootDir>/substituted_module_$1.js",
86-
"assets/(.*)": [
87-
"<rootDir>/images/$1",
88-
"<rootDir>/photos/$1",
89-
"<rootDir>/recipes/$1"
90-
]
91-
}
82+
"moduleNameMapper": {
83+
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
84+
"\\.(css|scss)$": "<rootDir>/__mocks__/styleMock.js"
85+
}
9286
}
9387
}

src/components/header/test/index.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import Header from '../index';
1616

1717
describe( 'Test Header Component', () => {
1818
it( 'Should match Header snapshot and render correctly', () => {
19-
2019
const headerData = {
2120
data: {
2221
header: {
@@ -29,9 +28,11 @@ describe( 'Test Header Component', () => {
2928
},
3029
loading: false,
3130
errorMsg: '',
32-
}
31+
};
3332

34-
const component = renderer.create( <Header headerData={ headerData }/> );
33+
const component = renderer.create(
34+
<Header headerData={ headerData } />
35+
);
3536

3637
const tree = component.toJSON();
3738

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Test Layout Component Should match Layout snapshot and render correctly 1`] = `
4+
<div>
5+
6+
7+
</div>
8+
`;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Test Home Component Should match Home snapshot and render correctly 1`] = `
4+
<div>
5+
6+
Content
7+
8+
</div>
9+
`;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Test Page Component Should match Page snapshot and render correctly 1`] = `
4+
<div>
5+
6+
7+
</div>
8+
`;

src/sass/base/_reset.scss

+9-2
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,20 @@ input::-moz-focus-inner {
3434
margin: 0;
3535
}
3636

37-
ul, ol, dd {
37+
ul,
38+
ol,
39+
dd {
3840
margin: 0;
3941
padding: 0;
4042
list-style: none;
4143
}
4244

43-
h1, h2, h3, h4, h5, h6 {
45+
h1,
46+
h2,
47+
h3,
48+
h4,
49+
h5,
50+
h6 {
4451
margin: 0;
4552
font-size: inherit;
4653
font-weight: inherit;

src/sass/base/_typography.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
body{
2-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
1+
body {
2+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
33
font-size: 16px;
44
font-weight: 400;
55
line-height: 1.3;

src/sass/components/_buttons.scss

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* Buttons style to be added*/

src/sass/components/_nav.scss

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
right: -100vw;
88
transition: 0.3s all;
99
background-color: $white;
10-
height: calc( 100vh - 80px );
10+
height: calc(100vh - 80px);
1111
border-top: 1px solid $color__border;
1212
width: 100vw;
1313
z-index: 1;
@@ -16,7 +16,6 @@
1616
right: 0;
1717
}
1818

19-
2019
@media only screen and ( min-width: $desktop ) {
2120
align-items: center;
2221
justify-content: flex-end;
@@ -90,7 +89,7 @@
9089
}
9190
}
9291

93-
&:hover .header-nav__submenu{
92+
&:hover .header-nav__submenu {
9493
display: block;
9594
}
9695

src/sass/general/_general.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
position: absolute;
88
left: 50%;
99
top: 50%;
10-
transform: translate(-50%,-50%);
10+
transform: translate(-50%, -50%);
1111
}

src/sass/layouts/_footer.scss

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* Buttons style to be added*/

src/sass/pages/_home.scss

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* Buttons style to be added*/

0 commit comments

Comments
 (0)