diff --git a/.gitignore b/.gitignore index 4d29575..3a1bea6 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +.idea diff --git a/package.json b/package.json index 4a6bf29..c4acab4 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "@types/node": "^12.0.0", "@types/react": "^16.9.0", "@types/react-dom": "^16.9.0", + "js-yaml": "^4.1.0", "react": "^16.14.0", "react-dom": "^16.14.0", "react-scripts": "3.4.3", @@ -36,6 +37,8 @@ ] }, "devDependencies": { - "gh-pages": "^3.1.0" + "@types/js-yaml": "^4.0.4", + "gh-pages": "^3.1.0", + "raw.macro": "^0.4.2" } } diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx index 399f7e0..75fb61c 100644 --- a/src/components/Dashboard.tsx +++ b/src/components/Dashboard.tsx @@ -1,11 +1,11 @@ import React from "react"; -import { createStyles, Theme, makeStyles } from "@material-ui/core/styles"; +import { createStyles, makeStyles } from "@material-ui/core/styles"; import List from "@material-ui/core/List"; import ListItem from "@material-ui/core/ListItem"; -import contributors from "./contributors.json"; import ContributorCard from "./Contributor"; +import useContributors from './useContributors'; -const useStyles = makeStyles((theme: Theme) => +const useStyles = makeStyles(() => createStyles({ root: { width: "100%", @@ -21,11 +21,15 @@ const useStyles = makeStyles((theme: Theme) => export default function Dashboard() { const classes = useStyles(); + const contributors = useContributors(); + if (!contributors) { + return null; + } return ( {contributors.map((contributor) => ( - + ))} diff --git a/src/components/contributors.json b/src/components/contributors.json deleted file mode 100644 index 7f33f70..0000000 --- a/src/components/contributors.json +++ /dev/null @@ -1,300 +0,0 @@ -[{ - "github": "Kabi4", - "name": "Kushagra Singh", - "organization": "d3cod3m3", - "college": "B.T. Kumaon Institute of Technology", - "city": "Haldwani", - "avatar": "kabi4.png", - "quote": "It's a run for life either run and code or suffer and die" - }, - { - "github": "mukarramali", - "name": "Mukarram Ali", - "organization": "SchmiedeONE", - "college": "B.T. Kumaon Institute of Technology", - "city": "Dusseldorf", - "avatar": "mukarramali.jpg", - "quote": "Be water" - }, - { - "github": "gothicprakhar", - "name": "Prakhar Agrawal", - "organization": "Kilobyte Tech", - "college": "B.T. Kumaon Institute of Technology", - "avatar": "prakharagrawal.jpeg", - "city": "Delhi", - "quote": "Be water" - }, - { - "github": "Yathartha22", - "name": "Yathartha Joshi", - "college": "B.T. Kumaon Institute of Technology", - "avatar": "yathartha.jpeg", - "city": "Delhi", - "quote": "Be water" - }, - { - "github": "rukshanuddin", - "name": "Rukshan Uddin", - "organization": "Trilogy Education", - "college": "Flatiron School", - "avatar": "rukshanuddin.JPG", - "city": "Palm Beach Gardens", - "quote": "Change things" - }, - { - "github": "vnmrsharma", - "name": "Vinamra sharma", - "organization": "BTKIT", - "college": "BTKIT", - "avatar": "2994C3F2-9651-4FD6-BFED-E7CFDC292CB2.jpeg", - "city": "Haridwar", - "quote": "Be the change" - }, - { - "github": "vaibhav15400", - "name": "Vaibhav Mishra", - "organization": "Student 3rd year", - "college": "BTKIT", - "avatar": "vaibhav.jpeg", - "city": "BANARASI", - "quote": "First PR Looks Cool" - }, - { - "github": "gurtejsingh2001", - "name": "Gurtej Singh Talwar", - "organization": "2nd Year Student", - "college": "Chandigarh University", - "avatar": "gurtej2.png", - "city": "Chandigarh", - "quote": "May the source be with you!" - }, - { - "github": "Kriti7744", - "name": "Kriti", - "organization": "B.T. Kumaon Institute of Technology", - "avatar": "Kriti.jpeg", - "city": "Kashipur", - "quote": "Tackling life with a smile :)" - }, - { - "github": "maniSHarma7575", - "name": "Manish Sharma", - "organization": "BTKIT Coding Club", - "college": "Bipin Tripathi Kumaon Institute of Technology", - "avatar": "manishsharma.jpeg", - "city": "Bhimtal, Nainital", - "quote": "Don't make me thing! Keep it simple" - }, - { - "github": "bitsapien", - "name": "Rahul C", - "organization": "Thoughtworks", - "avatar": "rahul.png", - "city": "Hyderabad", - "quote": "Change things" - }, - { - "github": "mathpalvipin", - "name": "Vipin Mathpal", - "organization": "Macco Robotics", - "avatar": "vipin.jpeg", - "city": "Hisar", - "quote": "You aRe ImPorTant" - }, - { - "github": "suraj-negi", - "name": "Suraj Singh Negi", - "organization": "BTKIT", - "avatar": "surajnegi.jpg", - "city": "haldwani", - "quote": "small changes brings big differences" - }, - { - "github": "prashantpandey9", - "name": "Prashant Pandey", - "organization": "BTKIT", - "avatar": "circle-cropped.png", - "city": "Ranikhet", - "quote": "Believe in Yourself!!" - }, - { - "github": "Yakshit310", - "name": "Yakshit Pant", - "college": "Bipin Tripathi Kumaon Institute of Technology", - "avatar": "Yakshit.jpeg", - "city": "Haldwani", - "quote": "Change things" - }, - { - "github": "shobhit-bhatt-14", - "name": "Shobhit Bhatt", - "organization": "Bipin Tripathi Kumaon Institute of Technology", - "avatar": "shobhit.jpg", - "city": "Khatima" - }, - { - "github": "ANkurNagila", - "name": "ANkur", - "organization": "Thoughtworks", - "avatar": "", - "city": "Haldwani" - }, - { - "github": "Kaushal196", - "name": "Kaushal Pandey", - "organization": "Replicon", - "avatar": "Kaushal196.jpeg", - "city": "Bangalore" - }, - { - "github": "mohdanash", - "name": "Mohd Anas", - "organization": "BTKIT", - "avatar": "IMG_20180405_151727.jpg", - "city": "Bazpu", - "quote": "Change things" - }, - { - "github": "nitesh9390", - "name": "Nitesh Shahu", - "organization": "Student", - "avatar": "nitesh pic.JPG", - "city": "Rudrapur" - }, - { - "github": "Divyanshu", - "name": "Divyanshu", - "organization": "Thoughtworks", - "avatar": "IMG_20190916_082733_936.jpg", - "city": "Dehradun" - }, - { - "github": "akashpant", - "name": "Akash Pant", - "organization": "Student", - "avatar": "1.jpeg", - "city": "Bhimtal", - "quote": "Change is the only Constant" - }, - { - "github": "wannabecoder21", - "name": "Adeeba Shaheen", - "organization": "Student", - "city": "Pantnagar", - "quote": "Change is the only Constant" - }, - { - "github": "Kaushal196", - "name": "Kaushal Pandey", - "organization": "Replicon", - "avatar": "Kaushal196.jpeg", - "city": "Bangalore", - "quote": "Change things" - }, - { - "github": "Wraithh00", - "name": "Gurpreet Singh", - "organization": "Bipin Tripathi Kumaon Institute of Technology", - "avatar": "gurpreet.png", - "city": "Sitarganj", - "quote": "Change things" - }, - { - "github": "DhavalPandey05", - "name": "Dhaval Pandey", - "organization": "BTKIT", - "avatar": "Dhaval.jpg", - "city": "Ghaziabad", - "quote": "Be Happy" - }, - { - "github": "ChAmPiOn49", - "name": "Shivam Bhadula", - "avatar": "6d4dd67c070b320645f47cd5809855e6.jpg", - "college": "B.T. Kumaon Institute of Technology", - "city": "Kotdwara", - "quote": "Change things" - }, - { - "github": "bitsapein", - "name": "Shubham chaturvedi", - "organization": "BTKIT, Dwarahat", - "city": "Haldwani", - "quote": "Change things" - }, - { - "github": "mdwaqaransari", - "name": "Waqar Ansari", - "organization": "MMM University of Technology", - "avatar": "waqar.jpg", - "city": "Gorakhpur", - "quote": "Practice and Practice" - }, - { - "github": "bitsapien", - "name": "Ashutoshu11", - "organization": "Nil", - "avatar": "Ashutoshu11.jpg", - "city": "Patna", - "quote": "Change things" - }, - { - "github": "ayushbisht2001", - "name": "Ayush Bisht", - "organization": "Bipin Tripathi Kumaon Institute of technology", - "avatar": "AyushBisht.jpg", - "city": "Kotdwara", - "quote": "Talk is cheap , show me the code" - }, - { - "github": "ali-anas", - "name": "Anas Ali", - "college": "BTKIT, Dwarahat", - "avatar": "anas-img.png", - "city": "Almora", - "quote": "Wohooo" - }, - { - "github": "Jaishree-19", - "name": "Jaishree Tewari", - "organization": "none", - "avatar": "DSC_1170.jpg", - "city": "Nainital", - "quote": "Better an oops,than a what if!" - }, - { - "github": "skandraturi", - "name": "Skand Raturi", - "organization": "Adrikyo Infotech", - "college": "BTKIT", - "avatar": "skand.jpg", - "city": "Karanprayag", - "quote": "Simplicity is the greatest decoration" - }, - { - "github": "harnirvair", - "name": "Harnirvair Singh", - "organization": "None", - "avatar": "hsingh.jpg", - "city": "New Delhi", - "quote": "Programming isn't about what you know; it's about what you can figure out." - }, - { - "github": "Harsh-Vrdhn", - "name": "Harsh Vardhan", - "college": "BTKIT, Dwarahat", - "avatar": "harsh.jpg", - "city": "Bhimtal", - "quote": "Fix the cause, not the symptom." - }, - { - "github": "Gujjar1998", - "name": "Deepak kumar", - "organization": "None", - "college": "BTKIT", - "avatar": "", - "city": "Roorkee", - "quote": "be brave" - } -] diff --git a/src/components/contributors.yaml b/src/components/contributors.yaml new file mode 100644 index 0000000..a574087 --- /dev/null +++ b/src/components/contributors.yaml @@ -0,0 +1,225 @@ +- github: Kabi4 + name: Kushagra Singh + organization: d3cod3m3 + college: B.T. Kumaon Institute of Technology + city: Haldwani + avatar: kabi4.png + quote: It's a run for life either run and code or suffer and die +- github: mukarramali + name: Mukarram Ali + organization: SchmiedeONE + college: B.T. Kumaon Institute of Technology + city: Dusseldorf + avatar: mukarramali.jpg + quote: Be water +- github: gothicprakhar + name: Prakhar Agrawal + organization: Kilobyte Tech + college: B.T. Kumaon Institute of Technology + avatar: prakharagrawal.jpeg + city: Delhi + quote: Be water +- github: Yathartha22 + name: Yathartha Joshi + college: B.T. Kumaon Institute of Technology + avatar: yathartha.jpeg + city: Delhi + quote: Be water +- github: rukshanuddin + name: Rukshan Uddin + organization: Trilogy Education + college: Flatiron School + avatar: rukshanuddin.JPG + city: Palm Beach Gardens + quote: Change things +- github: vnmrsharma + name: Vinamra sharma + organization: BTKIT + college: BTKIT + avatar: 2994C3F2-9651-4FD6-BFED-E7CFDC292CB2.jpeg + city: Haridwar + quote: Be the change +- github: vaibhav15400 + name: Vaibhav Mishra + organization: Student 3rd year + college: BTKIT + avatar: vaibhav.jpeg + city: BANARASI + quote: First PR Looks Cool +- github: gurtejsingh2001 + name: Gurtej Singh Talwar + organization: 2nd Year Student + college: Chandigarh University + avatar: gurtej2.png + city: Chandigarh + quote: May the source be with you! +- github: Kriti7744 + name: Kriti + organization: B.T. Kumaon Institute of Technology + avatar: Kriti.jpeg + city: Kashipur + quote: Tackling life with a smile :) +- github: maniSHarma7575 + name: Manish Sharma + organization: BTKIT Coding Club + college: Bipin Tripathi Kumaon Institute of Technology + avatar: manishsharma.jpeg + city: Bhimtal, Nainital + quote: Don't make me thing! Keep it simple +- github: bitsapien + name: Rahul C + organization: Thoughtworks + avatar: rahul.png + city: Hyderabad + quote: Change things +- github: mathpalvipin + name: Vipin Mathpal + organization: Macco Robotics + avatar: vipin.jpeg + city: Hisar + quote: You aRe ImPorTant +- github: suraj-negi + name: Suraj Singh Negi + organization: BTKIT + avatar: surajnegi.jpg + city: haldwani + quote: small changes brings big differences +- github: prashantpandey9 + name: Prashant Pandey + organization: BTKIT + avatar: circle-cropped.png + city: Ranikhet + quote: Believe in Yourself!! +- github: Yakshit310 + name: Yakshit Pant + college: Bipin Tripathi Kumaon Institute of Technology + avatar: Yakshit.jpeg + city: Haldwani + quote: Change things +- github: shobhit-bhatt-14 + name: Shobhit Bhatt + organization: Bipin Tripathi Kumaon Institute of Technology + avatar: shobhit.jpg + city: Khatima +- github: ANkurNagila + name: ANkur + organization: Thoughtworks + avatar: '' + city: Haldwani +- github: Kaushal196 + name: Kaushal Pandey + organization: Replicon + avatar: Kaushal196.jpeg + city: Bangalore +- github: mohdanash + name: Mohd Anas + organization: BTKIT + avatar: IMG_20180405_151727.jpg + city: Bazpu + quote: Change things +- github: nitesh9390 + name: Nitesh Shahu + organization: Student + avatar: nitesh pic.JPG + city: Rudrapur +- github: Divyanshu + name: Divyanshu + organization: Thoughtworks + avatar: IMG_20190916_082733_936.jpg + city: Dehradun +- github: akashpant + name: Akash Pant + organization: Student + avatar: 1.jpeg + city: Bhimtal + quote: Change is the only Constant +- github: wannabecoder21 + name: Adeeba Shaheen + organization: Student + city: Pantnagar + quote: Change is the only Constant +- github: Kaushal196 + name: Kaushal Pandey + organization: Replicon + avatar: Kaushal196.jpeg + city: Bangalore + quote: Change things +- github: Wraithh00 + name: Gurpreet Singh + organization: Bipin Tripathi Kumaon Institute of Technology + avatar: gurpreet.png + city: Sitarganj + quote: Change things +- github: DhavalPandey05 + name: Dhaval Pandey + organization: BTKIT + avatar: Dhaval.jpg + city: Ghaziabad + quote: Be Happy +- github: ChAmPiOn49 + name: Shivam Bhadula + avatar: 6d4dd67c070b320645f47cd5809855e6.jpg + college: B.T. Kumaon Institute of Technology + city: Kotdwara + quote: Change things +- github: bitsapein + name: Shubham chaturvedi + organization: BTKIT, Dwarahat + city: Haldwani + quote: Change things +- github: mdwaqaransari + name: Waqar Ansari + organization: MMM University of Technology + avatar: waqar.jpg + city: Gorakhpur + quote: Practice and Practice +- github: bitsapien + name: Ashutoshu11 + organization: Nil + avatar: Ashutoshu11.jpg + city: Patna + quote: Change things +- github: ayushbisht2001 + name: Ayush Bisht + organization: Bipin Tripathi Kumaon Institute of technology + avatar: AyushBisht.jpg + city: Kotdwara + quote: Talk is cheap , show me the code +- github: ali-anas + name: Anas Ali + college: BTKIT, Dwarahat + avatar: anas-img.png + city: Almora + quote: Wohooo +- github: Jaishree-19 + name: Jaishree Tewari + organization: none + avatar: DSC_1170.jpg + city: Nainital + quote: Better an oops,than a what if! +- github: skandraturi + name: Skand Raturi + organization: Adrikyo Infotech + college: BTKIT + avatar: skand.jpg + city: Karanprayag + quote: Simplicity is the greatest decoration +- github: harnirvair + name: Harnirvair Singh + organization: None + avatar: hsingh.jpg + city: New Delhi + quote: Programming isn't about what you know; it's about what you can figure out. +- github: Harsh-Vrdhn + name: Harsh Vardhan + college: BTKIT, Dwarahat + avatar: harsh.jpg + city: Bhimtal + quote: Fix the cause, not the symptom. +- github: Gujjar1998 + name: Deepak kumar + organization: None + college: BTKIT + avatar: '' + city: Roorkee + quote: be brave diff --git a/src/components/useContributors.ts b/src/components/useContributors.ts new file mode 100644 index 0000000..b0058f9 --- /dev/null +++ b/src/components/useContributors.ts @@ -0,0 +1,26 @@ +import raw from 'raw.macro'; +import { useEffect, useState } from 'react'; +import yaml from 'js-yaml' + +type Contributor = { + github: string; + name: string; + organization: string; + college: string; + avatar: string; + city: string; + quote: string; +} + +const useContributors = () => { + const [contributors, setContributors] = useState(null); + useEffect(() => { + const contributorsContent = raw(`./contributors.yaml`); + + setContributors(yaml.load(contributorsContent, { json: true }) as Contributor[]); + }, []) + + return contributors; +} + +export default useContributors; diff --git a/tsconfig.json b/tsconfig.json index f2850b7..351ffc8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,6 +20,7 @@ "jsx": "react" }, "include": [ - "src" + "src", + "types" ] } diff --git a/types/yaml.d.ts b/types/yaml.d.ts new file mode 100644 index 0000000..2a4e822 --- /dev/null +++ b/types/yaml.d.ts @@ -0,0 +1,4 @@ +declare module '*.yaml' { + const data: string; + export default data; +} diff --git a/yarn.lock b/yarn.lock index e31e233..fae2718 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1529,6 +1529,11 @@ "@types/istanbul-lib-coverage" "*" "@types/istanbul-lib-report" "*" +"@types/js-yaml@^4.0.4": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.4.tgz#cc38781257612581a1a0eb25f1709d2b06812fce" + integrity sha512-AuHubXUmg0AzkXH0Mx6sIxeY/1C110mm/EkE/gB1sTRz3h2dao2W/63q42SlVST+lICxz5Oki2hzYA6+KnnieQ== + "@types/json-schema@^7.0.3": version "7.0.4" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339" @@ -2007,6 +2012,11 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + aria-query@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc" @@ -2276,7 +2286,7 @@ babel-plugin-jest-hoist@^24.9.0: dependencies: "@types/babel__traverse" "^7.0.6" -babel-plugin-macros@2.8.0: +babel-plugin-macros@2.8.0, babel-plugin-macros@^2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz#0f958a7cc6556b1e65344465d99111a1e5e10138" integrity sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg== @@ -6178,6 +6188,13 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -8606,6 +8623,13 @@ raw-body@2.4.0: iconv-lite "0.4.24" unpipe "1.0.0" +raw.macro@^0.4.2: + version "0.4.2" + resolved "https://registry.yarnpkg.com/raw.macro/-/raw.macro-0.4.2.tgz#1954f9a36465d9400a76b8b68438e4ec8582acd6" + integrity sha512-Z+zKtCweyJ3lGYdUNq/BQwfzqQE2wrXjz0RNEes5nDniPpjvBw64sKYFXStJSfmZUmiBxv4DsN1lto982UAhFQ== + dependencies: + babel-plugin-macros "^2.8.0" + react-app-polyfill@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/react-app-polyfill/-/react-app-polyfill-1.0.6.tgz#890f8d7f2842ce6073f030b117de9130a5f385f0"