-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0fd7363
Showing
31 changed files
with
15,570 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
coverage | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"parser": "babel-eslint", | ||
"extends": ["react-app", "airbnb", "prettier"], | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"ecmaVersion": 12, | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["prettier"], | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"react/jsx-filename-extension": [1, {"extensions": [".js", ".jsx"]}], | ||
"react/state-in-constructor": "off", | ||
"react/react-in-jsx-scope": "off", | ||
"react/jsx-uses-react": "off", | ||
"no-console": "off", | ||
"react/prop-types": "off", | ||
"jsx-a11y/label-has-associated-control": [ | ||
2, | ||
{ | ||
"labelAttributes": ["htmlFor"] | ||
} | ||
], | ||
"jsx-a11y/click-events-have-key-events": 0, | ||
"jsx-a11y/no-noninteractive-element-interactions": [ | ||
"off", | ||
{ | ||
"handlers": ["onClick"] | ||
} | ||
], | ||
"react/prefer-stateless-function": [ | ||
0, | ||
{ | ||
"ignorePureComponents": true | ||
} | ||
], | ||
"no-unused-vars": "warn", | ||
"jsx-a11y/alt-text": 1, | ||
"react/no-unused-state": "warn", | ||
"react/button-has-type": "warn", | ||
"react/no-unescaped-entities": "warn", | ||
"react/jsx-props-no-spreading": "off", | ||
"operator-assignment": ["warn", "always"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
.idea/ | ||
.eslintcache | ||
.vscode/ | ||
.results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
registry=https://registry.npmjs.org/ | ||
package-lock=true | ||
save-exact=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
coverage | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"arrowParens": "avoid", | ||
"bracketSpacing": false, | ||
"endOfLine": "lf", | ||
"htmlWhitespaceSensitivity": "css", | ||
"insertPragma": false, | ||
"jsxBracketSameLine": false, | ||
"jsxSingleQuote": false, | ||
"printWidth": 80, | ||
"overrides": [ | ||
{ | ||
"files": "*.md", | ||
"options": { | ||
"printWidth": 1000 | ||
} | ||
} | ||
], | ||
"proseWrap": "always", | ||
"quoteProps": "as-needed", | ||
"requirePragma": false, | ||
"semi": false, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "all", | ||
"useTabs": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
In this project, let's build a **Layout Builder App** by applying the concepts we have learned till now. | ||
|
||
### Refer to the image below: | ||
|
||
<br/> | ||
<div style="text-align: center;"> | ||
<img src="https://assets.ccbp.in/frontend/content/react-js/layout-builder-output.gif" alt="Layout Builder Output" style="max-width:70%;box-shadow:0 2.8px 2.2px rgba(0, 0, 0, 0.12)"> | ||
</div> | ||
<br/> | ||
|
||
### Design Files | ||
|
||
<details> | ||
<summary>Click to view</summary> | ||
|
||
- [Extra Small (Size < 576px) and Small (Size >= 576px)](https://assets.ccbp.in/frontend/content/react-js/layout-builder-sm-output-v0.png) | ||
- [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px)](https://assets.ccbp.in/frontend/content/react-js/layout-builder-lg-output.png) | ||
|
||
</details> | ||
|
||
### Set Up Instructions | ||
|
||
<details> | ||
<summary>Click to view</summary> | ||
|
||
- Download dependencies by running `npm install` | ||
- Start up the app using `npm start` | ||
</details> | ||
|
||
### Completion Instructions | ||
|
||
<details> | ||
<summary>Functionality to be added</summary> | ||
<br/> | ||
|
||
The app must have the following functionalities | ||
|
||
- Initially, the checkboxes for Content, Left Navbar, Right Navbar should be checked and all the elements in the layout should be displayed | ||
- When the Content checkbox is unchecked, then the content element should not be displayed | ||
- When the Left Navbar checkbox is unchecked, then the Left Navbar element should not be displayed | ||
- When the Right Navbar checkbox is unchecked, then the Right Navbar element should not be displayed | ||
- When any of the checkbox is checked, then the respective element should be displayed accordingly | ||
- The Configuration Context has an object as a value with the following properties | ||
- `showContent` - this key is used to display the Content Element | ||
- `showLeftNavbar` - this key is used to display the Left Navbar Element | ||
- `showRightNavbar` - this key is used to display the Right Navbar Element | ||
- `onToggleShowContent` - this method is used to update the value of the `showContent` | ||
- `onToggleShowLeftNavbar` - this method is used to update the value of the `showLeftNavbar` | ||
- `onToggleShowRightNavbar` - this method is used to update the value of the `showRightNavbar` | ||
|
||
</details> | ||
|
||
<details> | ||
<summary>Components Structure</summary> | ||
|
||
<br/> | ||
<div style="text-align: center;"> | ||
<img src="https://assets.ccbp.in/frontend/content/react-js/layout-builder-component-breakdown-structure.png" alt="layout builder component structure breakdown" style="max-width:100%;box-shadow:0 2.8px 2.2px rgba(0, 0, 0, 0.12)"> | ||
</div> | ||
<br/> | ||
|
||
</details> | ||
|
||
<details> | ||
<summary>Implementation Files</summary> | ||
<br/> | ||
|
||
Use these files to complete the implementation: | ||
|
||
- `src/App.js` | ||
- `src/App.css` | ||
- `src/components/ConfigurationController/index.js` | ||
- `src/components/ConfigurationController/index.css` | ||
- `src/components/Layout/index.js` | ||
- `src/components/Layout/index.css` | ||
- `src/components/Header/index.js` | ||
- `src/components/Header/index.css` | ||
- `src/components/Body/index.js` | ||
- `src/components/Body/index.css` | ||
- `src/components/Footer/index.js` | ||
- `src/components/Footer/index.css` | ||
</details> | ||
|
||
### Resources | ||
|
||
<details> | ||
<summary>Colors</summary> | ||
|
||
<br/> | ||
|
||
<div style="background-color: #475569; width: 150px; padding: 10px; color: white">Hex: #475569</div> | ||
<div style="background-color: #e2e8f0; width: 150px; padding: 10px; color: black">Hex: #e2e8f0</div> | ||
<div style="background-color: #f1f5f9; width: 150px; padding: 10px; color: black">Hex: #f1f5f9</div> | ||
<div style="background-color: #64748b; width: 150px; padding: 10px; color: white">Hex: #64748b</div> | ||
<div style="background-color: #cbd5e1; width: 150px; padding: 10px; color: black">Hex: #cbd5e1</div> | ||
|
||
</details> | ||
|
||
<details> | ||
<summary>Font-families</summary> | ||
|
||
- Roboto | ||
|
||
</details> | ||
|
||
> ### _Things to Keep in Mind_ | ||
> | ||
> - All components you implement should go in the `src/components` directory. | ||
> - Don't change the component folder names as those are the files being imported into the tests. | ||
> - **Do not remove the pre-filled code** | ||
> - Want to quickly review some of the concepts you’ve been learning? Take a look at the Cheat Sheets. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"name": "layout-builder", | ||
"private": true, | ||
"version": "1.0.0", | ||
"engines": { | ||
"node": "^10.13 || 12 || 14 || 15", | ||
"npm": ">=6" | ||
}, | ||
"dependencies": { | ||
"@testing-library/jest-dom": "5.11.9", | ||
"@testing-library/react": "11.2.5", | ||
"@testing-library/user-event": "12.6.2", | ||
"chalk": "4.1.0", | ||
"react": "17.0.1", | ||
"react-dom": "17.0.1" | ||
}, | ||
"devDependencies": { | ||
"eslint-config-airbnb": "18.2.1", | ||
"eslint-config-prettier": "8.1.0", | ||
"eslint-plugin-prettier": "3.3.1", | ||
"husky": "4.3.8", | ||
"lint-staged": "10.5.4", | ||
"npm-run-all": "4.1.5", | ||
"prettier": "2.2.1", | ||
"react-scripts": "4.0.3" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint --fix src/", | ||
"format": "prettier --write \"./src\"", | ||
"run-all": "npm-run-all --parallel test lint:fix" | ||
}, | ||
"lint-staged": { | ||
"*.js": [ | ||
"npm run lint:fix" | ||
], | ||
"*.{js, jsx, json, html, css}": [ | ||
"npm run format" | ||
] | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"jest": { | ||
"collectCoverageFrom": [ | ||
"src/**/*.js" | ||
] | ||
}, | ||
"browserslist": { | ||
"development": [ | ||
"last 2 chrome versions", | ||
"last 2 firefox versions", | ||
"last 2 edge versions" | ||
], | ||
"production": [ | ||
">1%", | ||
"last 4 versions", | ||
"Firefox ESR", | ||
"not ie < 11" | ||
] | ||
} | ||
} |
Oops, something went wrong.