From b82c790c384c2331c548df069c31355ff7349f36 Mon Sep 17 00:00:00 2001 From: fanny Date: Sat, 12 Oct 2019 00:01:31 -0300 Subject: [PATCH 1/6] Render mentors --- data/getMentors.js | 5 ++ data/repositories.json | 80 ++++++++++++++++++++++++---- src/components/app/App.js | 1 + src/components/app/Routes.js | 2 + src/components/mentors/MentorCard.js | 14 +---- src/components/mentors/MentorGrid.js | 27 +++++----- src/components/mentors/mentor.js | 2 - 7 files changed, 94 insertions(+), 37 deletions(-) create mode 100644 data/getMentors.js diff --git a/data/getMentors.js b/data/getMentors.js new file mode 100644 index 0000000..8004dd8 --- /dev/null +++ b/data/getMentors.js @@ -0,0 +1,5 @@ +import projects from './repositories.json'; + +const mentors = projects.repositories.map(obj => obj.mentors); + +export default mentors; diff --git a/data/repositories.json b/data/repositories.json index 3b2bbb4..0f4e79a 100644 --- a/data/repositories.json +++ b/data/repositories.json @@ -3,39 +3,101 @@ "repositories": [ { "name": "calluswhatyouwant/spotify-web-sdk", - "difficulty": "avancado" + "difficulty": "avancado", + "mentors": [ + { + "name": "Jose Robson", + "imgUrl": "https://avatars1.githubusercontent.com/u/20714148?s=460&v=4" + }, + { + "name": "Jose Renan", + "imgUrl": "https://avatars3.githubusercontent.com/u/11728746?s=460&v=4" + } + ] }, { "name": "calluswhatyouwant/musicritic", - "difficulty": "avancado" + "difficulty": "avancado", + "mentors": [ + { + "name": "Jose Robson", + "imgUrl": "https://avatars1.githubusercontent.com/u/20714148?s=460&v=4" + } + ] }, { "name": "paulojbleitao/pokedex", - "difficulty": "intermediario" + "difficulty": "intermediario", + "mentors": [ + { + "name": "Paulo Leitao", + "imgUrl": "https://avatars3.githubusercontent.com/u/25506387?s=460&v=4" + }, + { + "name": "Jose Robson", + "imgUrl": "https://avatars1.githubusercontent.com/u/20714148?s=460&v=4" + } + ] }, { "name": "SubmiBot/SubmiBot", - "difficulty": "intermediario" + "difficulty": "intermediario", + "mentors": [ + { + "name": "Hericles Emanuel", + "imgUrl": "https://avatars1.githubusercontent.com/u/30700596?s=460&v=4" + } + ] }, { "name": "marianabianca/pomodoro", - "difficulty": "iniciante" + "difficulty": "iniciante", + "mentors": [ + { + "name": "Mariana Bianca", + "imgUrl": "https://avatars0.githubusercontent.com/u/23522997?s=460&v=4" + } + ] }, { "name": "P-Sync/P-Sync", - "difficulty": "intermediario" + "difficulty": "intermediario", + "mentors": [ + { + "name": "Hericles Emanuel", + "imgUrl": "https://avatars1.githubusercontent.com/u/30700596?s=460&v=4" + } + ] }, { "name": "FelipeMarinho97/iskra-webkit-greeter", - "difficulty": "intermediario" + "difficulty": "intermediario", + "mentors": [ + { + "name": "Felipe Marinho", + "imgUrl": "https://avatars2.githubusercontent.com/u/20695061?s=460&v=4" + } + ] }, { "name": "Rickecr/PyGraph", - "difficulty": "intermediario" + "difficulty": "intermediario", + "mentors": [ + { + "name": "Ricke", + "imgUrl": "https://avatars1.githubusercontent.com/u/25726888?s=400&v=4" + } + ] }, { "name": "Rickecr/CamaraDosDeputados", - "difficulty": "iniciante" + "difficulty": "iniciante", + "mentors": [ + { + "name": "Ricke", + "imgUrl": "https://avatars1.githubusercontent.com/u/25726888?s=400&v=4" + } + ] } ] } diff --git a/src/components/app/App.js b/src/components/app/App.js index 2525728..8004dc7 100644 --- a/src/components/app/App.js +++ b/src/components/app/App.js @@ -19,6 +19,7 @@ const AppHeader = () => ( Quem Somos? Junte-se! + Mentores ); diff --git a/src/components/app/Routes.js b/src/components/app/Routes.js index 3d2c6cc..d8d3483 100644 --- a/src/components/app/Routes.js +++ b/src/components/app/Routes.js @@ -4,12 +4,14 @@ import { Switch, Route } from 'react-router-dom'; import ProjectsPage from '../projects/ProjectsPage'; import JoinUsPage from '../joinus/JoinUsPage'; import TeamPage from '../team/TeamPage'; +import MentorGrid from '../mentors/MentorGrid'; const Routes = () => ( + ); diff --git a/src/components/mentors/MentorCard.js b/src/components/mentors/MentorCard.js index ab8eafd..0190002 100644 --- a/src/components/mentors/MentorCard.js +++ b/src/components/mentors/MentorCard.js @@ -1,24 +1,14 @@ // @flow import React from 'react'; -import type { Repository } from '../commons/repository/repository'; import type { Mentor as MentorCardProps } from './mentor'; import './MentorCard.css'; -const renderRepositories = (repositoriesList: Repository[]) => - repositoriesList.map(repository => ( -
  • - {repository.nameWithOwner} -
  • - )); - -const MentorCard = ({ name, imgUrl, repositoriesList }: MentorCardProps) => ( +const MentorCard = ({ name, imgUrl }: MentorCardProps) => (
    + {name} {name}
    {name}
    -
    ); diff --git a/src/components/mentors/MentorGrid.js b/src/components/mentors/MentorGrid.js index 2c7a5cb..f5ee220 100644 --- a/src/components/mentors/MentorGrid.js +++ b/src/components/mentors/MentorGrid.js @@ -3,22 +3,21 @@ import React from 'react'; import type { Mentor } from './mentor'; import MentorCard from './MentorCard'; +import mentors from '../../../data/getMentors'; -type MentorGridProps = { - mentorsList: Mentor[], +const renderMentors = (mentorsList: Mentor[]) => { + console.log(mentorsList.flat()); + return mentorsList + .flat() + .map((mentor, i) => ( + + )); }; -const renderMentors = (mentorsList: Mentor[]) => - mentorsList.map(mentor => ( - - )); - -const MentorGrid = ({ mentorsList }: MentorGridProps) => ( -
      {renderMentors(mentorsList)}
    -); +const MentorGrid = () =>
      {renderMentors(mentors)}
    ; export default MentorGrid; diff --git a/src/components/mentors/mentor.js b/src/components/mentors/mentor.js index 77a6210..633292a 100644 --- a/src/components/mentors/mentor.js +++ b/src/components/mentors/mentor.js @@ -1,8 +1,6 @@ // @flow -import type { Repository } from '../commons/repository/repository'; export type Mentor = { name: string, imgUrl: string, - repositoriesList: Repository[], }; From a3475e832b64c6689bae0f987594fdcf7de19ca4 Mon Sep 17 00:00:00 2001 From: fanny Date: Sat, 12 Oct 2019 10:53:15 -0300 Subject: [PATCH 2/6] Get unique mentors --- data/data.js | 11 +++++++++ data/getMentors.js | 5 ---- data/repositories.json | 4 ---- package.json | 1 + .../mentors/{MentorCard.css => Mentor.css} | 5 ++++ src/components/mentors/MentorCard.js | 3 +-- src/components/mentors/MentorGrid.js | 24 +++++++++---------- yarn.lock | 9 ++----- 8 files changed, 32 insertions(+), 30 deletions(-) create mode 100644 data/data.js delete mode 100644 data/getMentors.js rename src/components/mentors/{MentorCard.css => Mentor.css} (95%) diff --git a/data/data.js b/data/data.js new file mode 100644 index 0000000..1a0d8fd --- /dev/null +++ b/data/data.js @@ -0,0 +1,11 @@ +import { pluck, flatten, uniqWith, eqProps } from 'ramda'; +import projects from './repositories.json'; + +const getMentors = () => { + const mentors = flatten(pluck('mentors', projects.repositories)); + const uniqueMentors = uniqWith(eqProps('name'))(mentors); + + return uniqueMentors; +}; + +export default getMentors; diff --git a/data/getMentors.js b/data/getMentors.js deleted file mode 100644 index 8004dd8..0000000 --- a/data/getMentors.js +++ /dev/null @@ -1,5 +0,0 @@ -import projects from './repositories.json'; - -const mentors = projects.repositories.map(obj => obj.mentors); - -export default mentors; diff --git a/data/repositories.json b/data/repositories.json index 0f4e79a..751c7a1 100644 --- a/data/repositories.json +++ b/data/repositories.json @@ -32,10 +32,6 @@ { "name": "Paulo Leitao", "imgUrl": "https://avatars3.githubusercontent.com/u/25506387?s=460&v=4" - }, - { - "name": "Jose Robson", - "imgUrl": "https://avatars1.githubusercontent.com/u/20714148?s=460&v=4" } ] }, diff --git a/package.json b/package.json index 2505699..d609486 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "mini-css-extract-plugin": "^0.4.4", "prettier": "^1.14.3", "pretty-quick": "^1.8.0", + "ramda": "^0.26.1", "react-dev-utils": "^6.1.1", "style-loader": "^0.23.1", "url-loader": "^2.2.0", diff --git a/src/components/mentors/MentorCard.css b/src/components/mentors/Mentor.css similarity index 95% rename from src/components/mentors/MentorCard.css rename to src/components/mentors/Mentor.css index 2b665c3..facc880 100644 --- a/src/components/mentors/MentorCard.css +++ b/src/components/mentors/Mentor.css @@ -54,3 +54,8 @@ visibility: visible; opacity: 1; } + +.mentors { + display: flex; + flex-wrap: wrap; +} diff --git a/src/components/mentors/MentorCard.js b/src/components/mentors/MentorCard.js index 0190002..4ecd71f 100644 --- a/src/components/mentors/MentorCard.js +++ b/src/components/mentors/MentorCard.js @@ -2,11 +2,10 @@ import React from 'react'; import type { Mentor as MentorCardProps } from './mentor'; -import './MentorCard.css'; +import './Mentor.css'; const MentorCard = ({ name, imgUrl }: MentorCardProps) => (
    - {name} {name}
    {name}
    diff --git a/src/components/mentors/MentorGrid.js b/src/components/mentors/MentorGrid.js index f5ee220..d5941d3 100644 --- a/src/components/mentors/MentorGrid.js +++ b/src/components/mentors/MentorGrid.js @@ -3,21 +3,21 @@ import React from 'react'; import type { Mentor } from './mentor'; import MentorCard from './MentorCard'; -import mentors from '../../../data/getMentors'; +import getMentors from '../../../data/data'; +import './Mentor.css'; const renderMentors = (mentorsList: Mentor[]) => { - console.log(mentorsList.flat()); - return mentorsList - .flat() - .map((mentor, i) => ( - - )); + return mentorsList.map((mentor, i) => ( + + )); }; -const MentorGrid = () =>
      {renderMentors(mentors)}
    ; +const MentorGrid = () => ( +
      {renderMentors(getMentors())}
    +); export default MentorGrid; diff --git a/yarn.lock b/yarn.lock index 5ac78e4..e720660 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4629,7 +4629,7 @@ querystringify@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e" -ramda@^0.26: +ramda@^0.26, ramda@^0.26.1: version "0.26.1" resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06" integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ== @@ -4712,12 +4712,7 @@ react-error-overlay@^5.1.0: version "5.1.6" resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-5.1.6.tgz#0cd73407c5d141f9638ae1e0c63e7b2bf7e9929d" -react-is@^16.8.1: - version "16.10.2" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.10.2.tgz#984120fd4d16800e9a738208ab1fba422d23b5ab" - integrity sha512-INBT1QEgtcCCgvccr5/86CfD71fw9EPmDxgiJX4I2Ddr6ZsV6iFXsuby+qWJPtmNuMY0zByTsG4468P7nHuNWA== - -react-is@^16.8.6: +react-is@^16.8.1, react-is@^16.8.6: version "16.10.2" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.10.2.tgz#984120fd4d16800e9a738208ab1fba422d23b5ab" integrity sha512-INBT1QEgtcCCgvccr5/86CfD71fw9EPmDxgiJX4I2Ddr6ZsV6iFXsuby+qWJPtmNuMY0zByTsG4468P7nHuNWA== From 55dc8a5ca8d370ab19cd64cdd1dcf8fe6dd8ec96 Mon Sep 17 00:00:00 2001 From: fanny Date: Sat, 12 Oct 2019 10:56:48 -0300 Subject: [PATCH 3/6] Rename file --- data/{data.js => index.js} | 0 data/repositories.json | 4 ++++ 2 files changed, 4 insertions(+) rename data/{data.js => index.js} (100%) diff --git a/data/data.js b/data/index.js similarity index 100% rename from data/data.js rename to data/index.js diff --git a/data/repositories.json b/data/repositories.json index 751c7a1..e702831 100644 --- a/data/repositories.json +++ b/data/repositories.json @@ -22,6 +22,10 @@ { "name": "Jose Robson", "imgUrl": "https://avatars1.githubusercontent.com/u/20714148?s=460&v=4" + }, + { + "name": "Jose Renan", + "imgUrl": "https://avatars3.githubusercontent.com/u/11728746?s=460&v=4" } ] }, From ff973e500601e178aab4e0aa7546a050a79267c4 Mon Sep 17 00:00:00 2001 From: fanny Date: Sat, 12 Oct 2019 10:59:30 -0300 Subject: [PATCH 4/6] Update import --- src/components/mentors/MentorGrid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/mentors/MentorGrid.js b/src/components/mentors/MentorGrid.js index d5941d3..72d093a 100644 --- a/src/components/mentors/MentorGrid.js +++ b/src/components/mentors/MentorGrid.js @@ -3,7 +3,7 @@ import React from 'react'; import type { Mentor } from './mentor'; import MentorCard from './MentorCard'; -import getMentors from '../../../data/data'; +import getMentors from '../../../data'; import './Mentor.css'; const renderMentors = (mentorsList: Mentor[]) => { From 5ac89c1d171286d1e40b1b21e6fac64538cace4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Ferr=C3=A3o?= Date: Sat, 12 Oct 2019 14:59:30 -0300 Subject: [PATCH 5/6] Cria grid para pagina de mentores --- src/components/commons/header/Header.css | 1 + src/components/mentors/Mentor.css | 47 +++++++++++++++++++++--- src/components/mentors/MentorGrid.js | 2 +- 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/src/components/commons/header/Header.css b/src/components/commons/header/Header.css index 2605a84..3db5409 100644 --- a/src/components/commons/header/Header.css +++ b/src/components/commons/header/Header.css @@ -14,6 +14,7 @@ box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2); display: flex; justify-content: center; + z-index: 1; } /* Class used to keep the header at the top of the page even when it is rolled */ diff --git a/src/components/mentors/Mentor.css b/src/components/mentors/Mentor.css index facc880..c549199 100644 --- a/src/components/mentors/Mentor.css +++ b/src/components/mentors/Mentor.css @@ -1,6 +1,46 @@ +.mentor-grid { + display: grid; + width: 100%; +} + +/* Extra small devices (phones, 600px and down) */ +@media only screen and (max-width: 600px) { + .mentor-grid { + grid-template-columns: 1fr; + } +} + +/* Small devices (portrait tablets and large phones, 600px and up) */ +@media only screen and (min-width: 600px) { + .mentor-grid { + grid-template-columns: repeat(2, 1fr); + } +} + +/* Medium devices (landscape tablets, 768px and up) */ +@media only screen and (min-width: 768px) { + .mentor-grid { + grid-template-columns: repeat(2, 1fr); + } +} + +/* Large devices (laptops/desktops, 992px and up) */ +@media only screen and (min-width: 992px) { + .mentor-grid { + grid-template-columns: repeat(4, 1fr); + } +} + +/* Extra large devices (large laptops and desktops, 1200px and up) */ +@media only screen and (min-width: 1200px) { + .mentor-grid { + grid-template-columns: repeat(4, 1fr); + } +} + .img-mentor { border-radius: 100%; - width: 200px; + width: 100%; filter: grayscale(100%); transition: all 0.7s ease; } @@ -54,8 +94,3 @@ visibility: visible; opacity: 1; } - -.mentors { - display: flex; - flex-wrap: wrap; -} diff --git a/src/components/mentors/MentorGrid.js b/src/components/mentors/MentorGrid.js index 72d093a..8d847a6 100644 --- a/src/components/mentors/MentorGrid.js +++ b/src/components/mentors/MentorGrid.js @@ -17,7 +17,7 @@ const renderMentors = (mentorsList: Mentor[]) => { }; const MentorGrid = () => ( -
      {renderMentors(getMentors())}
    +
    {renderMentors(getMentors())}
    ); export default MentorGrid; From 7feb707589363a288a61935445c34a631397bc60 Mon Sep 17 00:00:00 2001 From: fanny Date: Fri, 18 Oct 2019 14:10:04 -0300 Subject: [PATCH 6/6] Update mentors page --- data/repositories.json | 44 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/data/repositories.json b/data/repositories.json index e702831..5dcc207 100644 --- a/data/repositories.json +++ b/data/repositories.json @@ -6,12 +6,12 @@ "difficulty": "avancado", "mentors": [ { - "name": "Jose Robson", - "imgUrl": "https://avatars1.githubusercontent.com/u/20714148?s=460&v=4" + "name": "JRobsonJr", + "imgUrl": "https://github.com/jrobsonjr.png" }, { - "name": "Jose Renan", - "imgUrl": "https://avatars3.githubusercontent.com/u/11728746?s=460&v=4" + "name": "JoseRenan", + "imgUrl": "https://github.com/joserenan.png" } ] }, @@ -20,12 +20,12 @@ "difficulty": "avancado", "mentors": [ { - "name": "Jose Robson", - "imgUrl": "https://avatars1.githubusercontent.com/u/20714148?s=460&v=4" + "name": "JRobsonJr", + "imgUrl": "https://github.com/jrobsonjr.png" }, { - "name": "Jose Renan", - "imgUrl": "https://avatars3.githubusercontent.com/u/11728746?s=460&v=4" + "name": "JoseRenan", + "imgUrl": "https://github.com/joserenan.png" } ] }, @@ -34,8 +34,8 @@ "difficulty": "intermediario", "mentors": [ { - "name": "Paulo Leitao", - "imgUrl": "https://avatars3.githubusercontent.com/u/25506387?s=460&v=4" + "name": "PauloJBLeitao", + "imgUrl": "https://github.com/paulojbleitao.png" } ] }, @@ -44,8 +44,8 @@ "difficulty": "intermediario", "mentors": [ { - "name": "Hericles Emanuel", - "imgUrl": "https://avatars1.githubusercontent.com/u/30700596?s=460&v=4" + "name": "HericlesMe", + "imgUrl": "https://github.com/hericlesme.png" } ] }, @@ -54,8 +54,8 @@ "difficulty": "iniciante", "mentors": [ { - "name": "Mariana Bianca", - "imgUrl": "https://avatars0.githubusercontent.com/u/23522997?s=460&v=4" + "name": "MarianaBianca", + "imgUrl": "https://github.com/marianabianca.png" } ] }, @@ -64,8 +64,8 @@ "difficulty": "intermediario", "mentors": [ { - "name": "Hericles Emanuel", - "imgUrl": "https://avatars1.githubusercontent.com/u/30700596?s=460&v=4" + "name": "HericlesMe", + "imgUrl": "https://github.com/hericlesme.png" } ] }, @@ -74,8 +74,8 @@ "difficulty": "intermediario", "mentors": [ { - "name": "Felipe Marinho", - "imgUrl": "https://avatars2.githubusercontent.com/u/20695061?s=460&v=4" + "name": "FelipeMarinho97", + "imgUrl": "https://github.com/FelipeMarinho97.png" } ] }, @@ -84,8 +84,8 @@ "difficulty": "intermediario", "mentors": [ { - "name": "Ricke", - "imgUrl": "https://avatars1.githubusercontent.com/u/25726888?s=400&v=4" + "name": "Rickecr", + "imgUrl": "https://github.com/Rickecr.png" } ] }, @@ -94,8 +94,8 @@ "difficulty": "iniciante", "mentors": [ { - "name": "Ricke", - "imgUrl": "https://avatars1.githubusercontent.com/u/25726888?s=400&v=4" + "name": "Rickecr", + "imgUrl": "https://github.com/Rickecr.png" } ] }