From c38788aa3ba5d107262e2251e0baaa08b93091ee Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Wed, 8 Jul 2020 20:07:28 +0530 Subject: [PATCH] - implement awards section --- package-lock.json | 84 +++++++++---------- package.json | 4 +- .../lists/double/DoubleFieldListItem.js | 4 +- .../double/DoubleFieldListItem.module.css | 2 +- .../lists/triple/TripleFieldListItem.js | 6 +- .../triple/TripleFieldListItem.module.css | 2 +- src/components/builder/sections/Awards.js | 28 +++++++ src/components/shared/Input.js | 9 +- src/constants/ModalEvents.js | 10 +++ src/contexts/ModalContext.js | 13 +-- src/data/leftSections.js | 17 +++- src/modals/ModalRegistrar.js | 2 + src/modals/ResumeModal.js | 6 +- src/modals/sections/AwardModal.js | 76 +++++++++++++++++ src/modals/sections/EducationModal.js | 9 +- src/modals/sections/SocialModal.js | 9 +- src/modals/sections/WorkModal.js | 9 +- 17 files changed, 206 insertions(+), 84 deletions(-) create mode 100644 src/components/builder/sections/Awards.js create mode 100644 src/constants/ModalEvents.js create mode 100644 src/modals/sections/AwardModal.js diff --git a/package-lock.json b/package-lock.json index 90c935ce..1142f317 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2871,9 +2871,9 @@ "integrity": "sha512-TiNg8R1kjDde5Pub9F9vCwZA/BNW9HeXP5b9j7Qucqncy/McfPZ6xze/EyBdXS5FhMIGN6Fx3vg75l5KHy3V1Q==" }, "@types/glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-VgNIkxK+j7Nz5P7jvUZlRvhuPSmsEfS03b0alKcq5V/STUKAa3Plemsn5mrQUO7am6OErJ4rhGEGJbACclrtRA==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==", "requires": { "@types/minimatch": "*", "@types/node": "*" @@ -6588,9 +6588,9 @@ } }, "devcert": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/devcert/-/devcert-1.1.1.tgz", - "integrity": "sha512-4C1y6ZP9PFE1CK/Pgks4Qf1WA4rzJOtR2RJ7mkDfiQRixDNrtCkZiWvwSKb0AN830Dp4cgb+VLLi8eVWv7cC6A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/devcert/-/devcert-1.1.2.tgz", + "integrity": "sha512-B72N5Z2Lzu11dsPvg/KD9IwQCyNg6JgsNcHw7zJ+QQN9/rusMpc0tSSOYLczmty5D7vOs94IHITPQ0uei5D3cw==", "requires": { "@types/configstore": "^2.1.1", "@types/debug": "^0.0.30", @@ -8568,9 +8568,9 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, "gatsby": { - "version": "2.23.21", - "resolved": "https://registry.npmjs.org/gatsby/-/gatsby-2.23.21.tgz", - "integrity": "sha512-oR4E+v3ilih+hQ1KyDI9N9c5OUqpNyiw93vO2YCGnpIY+q2/ldUnjWQc9FLGgMxupNs9nnTtYT/UrpePHFQvzQ==", + "version": "2.23.22", + "resolved": "https://registry.npmjs.org/gatsby/-/gatsby-2.23.22.tgz", + "integrity": "sha512-3kQUOeYZDle17tgvBD8DHIv2jjjKISV6c/+adRPxIBtcsA/zc+otrLXDD8PL77jd2xiE8X7/lMq2O4LsvOx+qQ==", "requires": { "@babel/code-frame": "^7.10.3", "@babel/core": "^7.10.3", @@ -8633,11 +8633,11 @@ "file-loader": "^1.1.11", "fs-exists-cached": "1.0.0", "fs-extra": "^8.1.0", - "gatsby-cli": "^2.12.58", + "gatsby-cli": "^2.12.59", "gatsby-core-utils": "^1.3.11", "gatsby-graphiql-explorer": "^0.4.10", "gatsby-link": "^2.4.11", - "gatsby-plugin-page-creator": "^2.3.15", + "gatsby-plugin-page-creator": "^2.3.16", "gatsby-plugin-typescript": "^2.4.13", "gatsby-react-router-scroll": "^3.0.10", "gatsby-telemetry": "^1.3.18", @@ -8721,9 +8721,9 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" }, "gatsby-cli": { - "version": "2.12.58", - "resolved": "https://registry.npmjs.org/gatsby-cli/-/gatsby-cli-2.12.58.tgz", - "integrity": "sha512-YyOaEKgbMdMZ6AcHkoSXBXyiIttYgshbToniSM0AMUZYqil/pm1V7ag+E82DMZJwjbDSiJ/WCfJ/bZeMUcsC1w==", + "version": "2.12.59", + "resolved": "https://registry.npmjs.org/gatsby-cli/-/gatsby-cli-2.12.59.tgz", + "integrity": "sha512-iQPFgBbZG1dLGtdNqB/gsnlwWu44rli/4J2VzYU3zwPguC9Zo3KMQxnrbIRY6CB1ryWQl+m/FZxO4umkEk8IUg==", "requires": { "@babel/code-frame": "^7.10.3", "@babel/runtime": "^7.10.3", @@ -8740,7 +8740,7 @@ "fs-exists-cached": "^1.0.0", "fs-extra": "^8.1.0", "gatsby-core-utils": "^1.3.11", - "gatsby-recipes": "^0.1.49", + "gatsby-recipes": "^0.1.50", "gatsby-telemetry": "^1.3.18", "hosted-git-info": "^3.0.4", "ink": "^2.7.1", @@ -8813,14 +8813,6 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" }, - "webpack-merge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", - "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", - "requires": { - "lodash": "^4.17.15" - } - }, "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", @@ -8870,9 +8862,9 @@ } }, "gatsby-page-utils": { - "version": "0.2.15", - "resolved": "https://registry.npmjs.org/gatsby-page-utils/-/gatsby-page-utils-0.2.15.tgz", - "integrity": "sha512-Kbrs/K/wFLEiMfNG/ZNFYEM1oftSqUVJReC1CvwRsPE2T1iU/LiiubWRlOpAAEw3iuAHToasfwcJfv0T98u5/A==", + "version": "0.2.16", + "resolved": "https://registry.npmjs.org/gatsby-page-utils/-/gatsby-page-utils-0.2.16.tgz", + "integrity": "sha512-9z+M8AS2YmSf5iw0AA+WuNeIgFpswbHRlV3K0BCfEIV7AZUKIW1oa7f7oWT3GRnN3r0Km/GfEgKQzQs81jX26g==", "requires": { "@babel/runtime": "^7.10.3", "bluebird": "^3.7.2", @@ -8948,14 +8940,14 @@ } }, "gatsby-plugin-page-creator": { - "version": "2.3.15", - "resolved": "https://registry.npmjs.org/gatsby-plugin-page-creator/-/gatsby-plugin-page-creator-2.3.15.tgz", - "integrity": "sha512-+Q4r6Fg5hBW+Iz8iqZ7H9cm62IBdgUc4UBJeJbGyKL1pifSpVPMwSDv0VxiNinZDjA/GW6u7lB4dEdRBDsX16A==", + "version": "2.3.16", + "resolved": "https://registry.npmjs.org/gatsby-plugin-page-creator/-/gatsby-plugin-page-creator-2.3.16.tgz", + "integrity": "sha512-3HK0K+9yotRypNSeM/d2PlhW3YnFrQQ7MKF79sGSEM5x++9RiXYB1YbjibNw5rsM0SI/YCQqAAJi86kNU0B3SQ==", "requires": { "@babel/runtime": "^7.10.3", "bluebird": "^3.7.2", "fs-exists-cached": "^1.0.0", - "gatsby-page-utils": "^0.2.15", + "gatsby-page-utils": "^0.2.16", "glob": "^7.1.6", "lodash": "^4.17.15", "micromatch": "^3.1.10" @@ -9190,9 +9182,9 @@ } }, "gatsby-recipes": { - "version": "0.1.49", - "resolved": "https://registry.npmjs.org/gatsby-recipes/-/gatsby-recipes-0.1.49.tgz", - "integrity": "sha512-p+pRxZAlt6Kwfc8JolwkHu6O/QWDMMpDepS7a41N+H8CVju6EDNweMfvI1/hedcJ93nactUj6tsyxyyV/xMhFA==", + "version": "0.1.50", + "resolved": "https://registry.npmjs.org/gatsby-recipes/-/gatsby-recipes-0.1.50.tgz", + "integrity": "sha512-z+a3a1g+zxZ1skYzLdhHJBQt02nfL+VIpGTXqryrvofA9V5cfZJ2INkgj6nebcB3atQjZxA33xq5GOwmOQi93Q==", "requires": { "@babel/core": "^7.10.3", "@babel/generator": "^7.10.3", @@ -9286,9 +9278,9 @@ } }, "execa": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.2.tgz", - "integrity": "sha512-QI2zLa6CjGWdiQsmSkZoGtDx2N+cQIGb3yNolGTdjSQzydzLgYYf8LRuagp7S7fPimjcrzUDSUFd/MgzELMi4Q==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.3.tgz", + "integrity": "sha512-WFDXGHckXPWZX19t1kCsXzOpqX9LWYNqn4C+HqZlk/V0imTkzJZqf87ZBhvpHaftERYknpk0fjSylnXVlVgI0A==", "requires": { "cross-spawn": "^7.0.0", "get-stream": "^5.0.0", @@ -9871,9 +9863,9 @@ "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" }, "graphql": { - "version": "14.6.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.6.0.tgz", - "integrity": "sha512-VKzfvHEKybTKjQVpTFrA5yUq2S9ihcZvfJAtsDBBCuV6wauPu1xl/f9ehgVf0FcEJJs4vz6ysb/ZMkGigQZseg==", + "version": "14.7.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.7.0.tgz", + "integrity": "sha512-l0xWZpoPKpppFzMfvVyFmp9vLN7w/ZZJPefUicMCepfJeQ8sMcztloGYY9DfjVPo6tIUDzU5Hw3MUbIjj9AVVA==", "requires": { "iterall": "^1.2.2" } @@ -12260,9 +12252,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.17", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.17.tgz", + "integrity": "sha512-/B2DjOphAoqi5BX4Gg2oh4UR0Gy/A7xYAMh3aSECEKzwS3eCDEpS0Cals1Ktvxwlal3bBJNc+5W9kNIcADdw5Q==" }, "lodash-es": { "version": "4.17.15", @@ -19724,6 +19716,14 @@ } } }, + "webpack-merge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", + "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", + "requires": { + "lodash": "^4.17.15" + } + }, "webpack-sources": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", diff --git a/package.json b/package.json index 285bb821..e649ae6c 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "classnames": "^2.2.6", "firebase": "^7.15.5", "formik": "^2.1.4", - "gatsby": "^2.23.21", + "gatsby": "^2.23.22", "gatsby-image": "^2.4.12", "gatsby-plugin-create-client-paths": "^2.3.9", "gatsby-plugin-firebase": "^0.2.0-beta.4", @@ -33,7 +33,7 @@ "gatsby-source-filesystem": "^2.3.18", "gatsby-source-gravatar": "^1.0.0", "gatsby-transformer-sharp": "^2.5.10", - "lodash": "^4.17.15", + "lodash": "^4.17.17", "moment": "^2.27.0", "nanoevents": "^5.1.8", "react": "^16.13.1", diff --git a/src/components/builder/lists/double/DoubleFieldListItem.js b/src/components/builder/lists/double/DoubleFieldListItem.js index bb66d733..6ffa2d9d 100644 --- a/src/components/builder/lists/double/DoubleFieldListItem.js +++ b/src/components/builder/lists/double/DoubleFieldListItem.js @@ -65,8 +65,8 @@ const DoubleFieldListItem = ({ return (
- {title} - {subtitle} + {title} + {subtitle}
diff --git a/src/components/builder/lists/double/DoubleFieldListItem.module.css b/src/components/builder/lists/double/DoubleFieldListItem.module.css index 699169ec..85034a75 100644 --- a/src/components/builder/lists/double/DoubleFieldListItem.module.css +++ b/src/components/builder/lists/double/DoubleFieldListItem.module.css @@ -1,5 +1,5 @@ .container { - @apply flex items-center justify-between border-t border-secondary px-8 py-5; + @apply flex items-center justify-between border-t border-secondary px-6 py-5; } .container:first-child { diff --git a/src/components/builder/lists/triple/TripleFieldListItem.js b/src/components/builder/lists/triple/TripleFieldListItem.js index 9f0bc11d..b57d7ae6 100644 --- a/src/components/builder/lists/triple/TripleFieldListItem.js +++ b/src/components/builder/lists/triple/TripleFieldListItem.js @@ -66,10 +66,10 @@ const TripleFieldListItem = ({ return (
- {title} - {subtitle} + {title} + {subtitle} - {text} + {text}
diff --git a/src/components/builder/lists/triple/TripleFieldListItem.module.css b/src/components/builder/lists/triple/TripleFieldListItem.module.css index 699169ec..85034a75 100644 --- a/src/components/builder/lists/triple/TripleFieldListItem.module.css +++ b/src/components/builder/lists/triple/TripleFieldListItem.module.css @@ -1,5 +1,5 @@ .container { - @apply flex items-center justify-between border-t border-secondary px-8 py-5; + @apply flex items-center justify-between border-t border-secondary px-6 py-5; } .container:first-child { diff --git a/src/components/builder/sections/Awards.js b/src/components/builder/sections/Awards.js new file mode 100644 index 00000000..45f8efe3 --- /dev/null +++ b/src/components/builder/sections/Awards.js @@ -0,0 +1,28 @@ +import { get } from "lodash"; +import React from "react"; +import Heading from "../../shared/Heading"; +import List from "../lists/List"; +import TripleFieldListItem from "../lists/triple/TripleFieldListItem"; + +const Awards = ({ id, name, event, state }) => { + const path = `${id}.items`; + const items = get(state, path, []); + + return ( +
+ {name} + + +
+ ); +}; + +export default Awards; diff --git a/src/components/shared/Input.js b/src/components/shared/Input.js index 7c1b690f..e110318b 100644 --- a/src/components/shared/Input.js +++ b/src/components/shared/Input.js @@ -18,6 +18,7 @@ const Input = ({ checked, onChange, className, + isRequired, placeholder, onDeleteItem, showDeleteItemButton, @@ -42,7 +43,13 @@ const Input = ({ return (