13 | );
14 | }
15 | }
16 | export default Footer;
17 |
--------------------------------------------------------------------------------
/readme-translations/README-hi.md:
--------------------------------------------------------------------------------
1 | Coding-AI
2 | Coding-AI एक संरक्षक को खोजने में मदद करता है जो आपकी प्रौद्योगिकियों से संबंधित है।
3 |
4 | HacktoberFest 2019 में आपका स्वागत है!
5 |
6 | अपना पहला पुल अनुरोध बनाने के लिए इन चरणों का पालन करें:
7 | 1. इस कोष को उप-विभाजित करें।
8 | 2. अपने कंप्यूटर में इस कोष का एक क्लोन बनाएं।
9 | 3. मुद्दों की सूची से किसी भी मुद्दे को लें और पीआर बनाएं
10 | 4. अपने टर्मिनल पर ये कमांड लिखें:
11 |
12 | git add -A
13 | git commit -m "your name"
14 | git push origin master
15 |
16 | 5. फिर अपने पुल अनुरोध बनाएँ
17 | 6. आपको मेरा कोष पसंद आया तो स्टार पर क्लिक करें
18 | 7. बधाई हो!! आपने सफलतापूर्वक अपना पुल अनुरोध बना लिया है।
19 | 8. यहां अपनी प्रगति की जांच करें और अपनी शर्ट की प्रतीक्षा करें।
20 |
--------------------------------------------------------------------------------
/src/components/Router.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import { Route, Switch } from "react-router-dom";
3 | //import logo from "./logo.svg";
4 |
5 | import Home from "../components/Home";
6 | import About from "../components/About";
7 | import Topics from "../components/Topics";
8 | import Topic from "../components/Topic";
9 |
10 | class Router extends Component {
11 | render() {
12 | return (
13 |
14 |
15 |
16 |
17 |
18 |
19 | );
20 | }
21 | }
22 | export default Router;
23 |
--------------------------------------------------------------------------------
/readme-translations/README-kr.md:
--------------------------------------------------------------------------------
1 | # Coding-AI
2 | Coding-AI는 기술 스택과 관련된 멘토와 연결해 드립니다. [](https://app.netlify.com/sites/mentors/deploys)
3 |
4 |
5 | # 웰컴투 HacktoberFest 2019!
6 | 첫 풀리퀘스트 (Pull Request, PR) 가이드:
7 |
8 | 1. 본 저장소를 포크한다.
9 |
10 | 2. 포크후 로컬 저장소를 내려받는다. (Clone)
11 |
12 | 3. 이슈목록을 살펴 이슈를 택한후 작업한다.
13 |
14 | 4. 터미널의 다음 명령어를 실행한다
15 | ```
16 | git add -A
17 | git commit -m "your name"
18 | git push origin master
19 | ```
20 |
21 | 5. 풀리퀘스트를 한다. (PR)
22 |
23 | 6. 본 저장소에 별(Star)을 달아준다.
24 |
25 | 7. 축하합니다!! 성공적으로 첫 풀리퀘스트를 하였습니다
26 |
27 | 8. [여기](https://hacktoberfest.digitalocean.com/profile)에서 핵토버페스트 프로필을 확인하고 셔츠를 기다린다!
--------------------------------------------------------------------------------
/readme-translations/README-zh.md:
--------------------------------------------------------------------------------
1 | # Coding-AI
2 | Coding-AI 能帮助你找到与你技术栈有关的导师。 [](https://app.netlify.com/sites/mentors/deploys)
3 |
4 |
5 | # 欢迎参加 HacktoberFest 2019!
6 |
7 | 请按照以下步骤来提交你的第一个pull request:
8 |
9 | 1. Fork这个项目。
10 |
11 | 2. 把这个项目clone到你你的电脑上。
12 |
13 | 3. 从话题(issues)中选择其中一个,然后提交PR。
14 |
15 | 4. 在terminal中输入以下命令:
16 | ```
17 | git add -A
18 | git commit -m "your name"
19 | git push origin master
20 | ```
21 | 5. 提交pull request。
22 |
23 | 6. Star这个项目。
24 |
25 | 7. 恭喜!!你已成功创造你的PR。
26 |
27 | 8. 查看你的[进展](https://hacktoberfest.digitalocean.com/profile)等待免费T恤。
28 |
29 | Original English version of the README.md file [here](../README.md)!
30 |
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import "./styles.css";
3 |
4 | import Header from "./components/Header";
5 | import Router from "./components/Router";
6 | import Mentor from "./components/Mentor";
7 | import Footer from "./components/Footer";
8 |
9 | class App extends Component {
10 | constructor(props) {
11 | super(props);
12 | this.state = {
13 | search: ""
14 | };
15 | }
16 |
17 | search = val => {
18 | this.setState({ search: val });
19 | };
20 |
21 | render() {
22 | return (
23 |
24 |
25 |
26 |
27 |
28 |
29 | );
30 | }
31 | }
32 | export default App;
33 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Coding-AI",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "all-contributors-cli": "^6.16.1",
7 | "bootstrap": "^4.5.0",
8 | "devicon": "^2.2.0",
9 | "font-mfizz": "^2.4.1",
10 | "react": "^16.6.0",
11 | "react-blink-text": "^1.0.3",
12 | "react-dom": "^16.13.0",
13 | "react-icons": "^3.9.0",
14 | "react-image-fallback": "^8.0.0",
15 | "react-router-dom": "^5.2.0",
16 | "react-scripts": "^3.3.1"
17 | },
18 | "scripts": {
19 | "start": "react-scripts start",
20 | "build": "react-scripts build",
21 | "test": "react-scripts test",
22 | "eject": "react-scripts eject"
23 | },
24 | "eslintConfig": {
25 | "extends": "react-app"
26 | },
27 | "browserslist": [
28 | ">0.2%",
29 | "not dead",
30 | "not ie <= 11",
31 | "not op_mini all"
32 | ]
33 | }
34 |
--------------------------------------------------------------------------------
/readme-translations/README-fr.md:
--------------------------------------------------------------------------------
1 | # Coding-AI
2 | Coding-AI vous aidez à rencontrer un mentor qui connaît vos langues technologique. [](https://app.netlify.com/sites/mentors/deploys)
3 |
4 |
5 | # Bienvenue à HacktoberFest 2020!
6 | Veuillez suivre ces étapes pour faire votre première pull request:
7 |
8 | 1. Faites une copie (Fork) de ce dépôt.
9 |
10 | 2. Clonez le dépôt copié à votre machine locale.
11 |
12 | 3. Prenez n'importe qu'elle issue de la liste des issues et créez le PR (pull request).
13 |
14 | 4. Écrivez ces commandes dans votre terminal:
15 | ```
16 | git add -A
17 | git commit -m "your name"
18 | git push origin master
19 | ```
20 | 5. Ensuite créez votre PR (pull request).
21 |
22 | 6. Mettez l'étoile sur ce dépôt.
23 |
24 | 7. Féliciations! Vous avez crée votre pull request.
25 |
--------------------------------------------------------------------------------
/readme-translations/README-ar.md:
--------------------------------------------------------------------------------
1 | # Coding-AI
2 | يساعد Coding-AI على إيجاد مرشد مرتبط بتقنياتك [](https://app.netlify.com/sites/mentors/deploys)
3 |
4 | # مرحبا بكم الى Hacktoberfest 2019 !
5 | اتبع هذه الخطوات لتقديم أول pull request:
6 |
7 | 1. Fork هذا المستودع.
8 |
9 | 2. استنسخ المستودع إلى جهاز الخاص بك.
10 |
11 | 3. تأخذ أي مشكلة من قائمة المشاكل وإنشاء pull request.
12 |
13 | 4. اكتب هذه الأوامر في الTerminal:
14 | ```
15 | git add -A
16 | git commit -m "your name"
17 | git push origin master
18 | ```
19 | 5. ثم قم بإنشاء ال pull request الخاص بك.
20 |
21 | 6. اعطني نجمة.
22 |
23 | 7. مبروك! لقد قمت بإنشاء pull request بنجاح.
24 |
25 | 8. تحقق من تقدمك [هنا](https://hacktoberfest.digitalocean.com/profile) وانتظر قميصك.
26 |
27 | النسخة البرتغالية البرازيلية من الملف README.md [هنا](/README-ptbr.md)!
28 |
--------------------------------------------------------------------------------
/readme-translations/README-ms.md:
--------------------------------------------------------------------------------
1 | # Coding-AI
2 | Coding-AI membantu mencari mentor yang berkaitan dengan teknologi anda. [](https://app.netlify.com/sites/mentors/deploys)
3 |
4 |
5 | # Selamat datang ke HacktoberFest 2019!
6 | Ikuti langkah berikut untuk membuat pull request pertama anda:
7 |
8 | 1. Fork repositori ini.
9 |
10 | 2. Klon repositori yang anda fork ke mesin anda.
11 |
12 | 3. Ambil sebarang isu daripada senarai isu dan buat PR.
13 |
14 | 4. Tulis arahan ini di terminal anda:
15 | ```
16 | git add -A
17 | git commit -m "your name"
18 | git push origin master
19 | ```
20 | 5. Kemudian buat pull request anda.
21 |
22 | 6. Tanda bintang pada repositori ini.
23 |
24 | 7. Tahniah!! Anda berjaya membuat pull request anda.
25 |
26 | 8. Semak perkembangan anda [di sini](https://hacktoberfest.digitalocean.com/profile) dan tunggu baju anda.
--------------------------------------------------------------------------------
/readme-translations/README-dk.md:
--------------------------------------------------------------------------------
1 | # Kodning-AI
2 | Kodning AI hjælper med at finde en mentor relateret til din teknologi tilbage. [](https://app.netlify.com/sites/mentors/deploys)
3 |
4 |
5 | # Velkommen till HacktoberFest 2019!
6 | Følg disse trin for at fremsætte din første pull-anmodning:
7 |
8 | 1. Kopier (fork) dette depot.
9 |
10 | 2. Klon dit kopierede lager til din lokale maskine.
11 |
12 | 3. Tag ethvert spørgsmål fra listen over emner og opret PR.
13 |
14 | 4. Skriv disse kommandoer på din terminal:
15 | ```
16 | git add -A
17 | git commit -m "your name"
18 | git push origin master
19 | ```
20 | 5. Opret derefter din pull-anmodning.
21 |
22 | 6. Stjerner mit depot.
23 |
24 | 7. Tillykke!! Du har oprettet din pull-anmodning.
25 |
26 | 8. Tjek din fremgang [her](https://hacktoberfest.digitalocean.com/profile) og vent på din skjorte.
27 |
--------------------------------------------------------------------------------
/readme-translations/README-swe.md:
--------------------------------------------------------------------------------
1 | # Coding-AI
2 | Coding-AI hjälper dig att hitta en mentor releaterat till din teknik stack. [](https://app.netlify.com/sites/mentors/deploys)
3 |
4 | # Välkommen till HacktoberFest 2019!
5 | Följ dessa steg för att göra din första pull request:
6 |
7 | 1. Kopiera (forka) detta repository.
8 |
9 | 2. Klona ditt kopierade repository till din lokala maskin.
10 |
11 | 3. Ta något problem från problem listan and skapa ett PR.
12 |
13 | 4. Skriv dessa kommandon i din terminal:
14 | ```
15 | git add -A
16 | git commit -m "ditt namn"
17 | git push origin master
18 | ```
19 | 5. Sen skapar du din pull request.
20 |
21 | 6. Stjärnmärk mitt repository.
22 |
23 | 7. Grattis!! Du har lyckats skapa ditt pull request.
24 |
25 | 8. Kolla dina framsteg [här](https://hacktoberfest.digitalocean.com/profile) och vänta på din tröja.
26 |
--------------------------------------------------------------------------------
/readme-translations/README-es.md:
--------------------------------------------------------------------------------
1 | # Coding-AI
2 | Coding-AI te ayuda a encontrar un mentor relacionado con tu stack de tecnologías. [](https://app.netlify.com/sites/mentors/deploys)
3 |
4 |
5 | # Bienvenido a HacktoberFest 2019!
6 | Sigue estos pasos para realizar su primer pull request:
7 |
8 | 1. Realiza una copia (Fork) de este repositorio.
9 |
10 | 2. Clona el repositorio bifurcado en tu maquina local.
11 |
12 | 3. Elije algún tarea de la lista de problemas y haz un PR.
13 |
14 | 4. Escribe estos comandos en tu terminal:
15 | ```
16 | git add -A
17 | git commit -m "your name"
18 | git push origin master
19 | ```
20 | 5. Entonces crea tu pull request.
21 |
22 | 6. Destaca mi repositorio.
23 |
24 | 7. Enhorabuena!! Has creado un pull request con éxito.
25 |
26 | 8. Revisa tu progreso [aquí](https://hacktoberfest.digitalocean.com/profile) y espera por tu camiseta.
--------------------------------------------------------------------------------
/readme-translations/README.nl.md:
--------------------------------------------------------------------------------
1 | # Coding-AI
2 | Coding-AI helpt bij het vinden van een mentor gerelateerd aan jouw technologie stack. [](https://app.netlify.com/sites/mentors/deploys)
3 |
4 |
5 | # Welkom bij HacktoberFest 2019!
6 | Volg deze stappen bij het maken van jouw eerste pull request:
7 |
8 | 1. Fork deze repository
9 |
10 | 2. Clone jouw geforkte repository naar je lokale machine.
11 |
12 | 3. Kies een issue van de issue lijst en maak de PR.
13 |
14 | 4. Schrijft deze commands in je terminal:
15 |
16 | ```
17 | git add -A
18 | git commit -m "jouw naam"
19 | git push origin master
20 | ```
21 | 5. Maak vervolgens jouw pull request.
22 |
23 | 6. Star mijn repository.
24 |
25 | 7. Gefeliciteerd!! Je hebt succesvol een pull request gemaakt!
26 |
27 | 8. Kijk naar jouw voortgang [hier](https://hacktoberfest.digitalocean.com/profile) en wacht op jouw shirt.
--------------------------------------------------------------------------------
/readme-translations/README-ptbr.md:
--------------------------------------------------------------------------------
1 | # Coding-AI
2 | O Coding-AI te ajuda a achar um mentor relacionado às suas stacks de tecnologia. [](https://app.netlify.com/sites/mentors/deploys)
3 |
4 |
5 | # Bem-vindo ao HacktoberFest 2019!
6 | Siga estes passos para realizar sua primeira pull-request:
7 |
8 | 1. Faça um fork deste repositório.
9 |
10 | 2. Clone o repositório localmente na sua máquina.
11 |
12 | 3. Escolha alguma issue da lista de issues e faça as alterações.
13 |
14 | 4. Escreva estes comandos no seu terminal:
15 | ```
16 | git add -A
17 | git commit -m "seu nome"
18 | git push origin master
19 | ```
20 | 5. Crie a pull request.
21 |
22 | 6. Favorite meu repositório.
23 |
24 | 7. Parabéns! Você acabou de criar sua primeira pull request.
25 |
26 | 8. Confira seu progresso [aqui](https://hacktoberfest.digitalocean.com/profile) e aguarde pela sua camiseta!
27 |
--------------------------------------------------------------------------------
/readme-translations/README-no.md:
--------------------------------------------------------------------------------
1 | # Coding-AI
2 | Coding-AI hjelper deg med å finne en mentor som er relatert til din teknologi-stack. [](https://app.netlify.com/sites/mentors/deploys)
3 |
4 |
5 | # Velkommen til HacktoberFest 2019!
6 | Følg disse stegene for å lage din første pull request:
7 |
8 | 1. Fork dette repositoriet.
9 |
10 | 2. Klon ditt forka repository til din lokale maskin.
11 |
12 | 3. Ta et hvilket som helst issue fra issue-listen, og lag PR-et.
13 |
14 | 4. Skriv inn disse kommandoene i terminalen din:
15 | ```
16 | git add -A
17 | git commit -m "navnet ditt"
18 | git push origin master
19 | ```
20 | 5. Opprett deretter PR-et ditt.
21 |
22 | 6. Sett repositoriet mitt som favoritt.
23 |
24 | 7. Gratulerer!! Du har opprettet pull requestet ditt.
25 |
26 | 8. Sjekk fremgangen din [her] (https://hacktoberfest.digitalocean.com/profile) og vent på T-skjorten din.
--------------------------------------------------------------------------------
/src/components/Heart.js:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from 'react';
2 |
3 | function Heart (props) {
4 | const [ likeCount, setLikeCount ] = useState(0);
5 |
6 | useEffect(() => {
7 | getLikeCountForMentor(props.name);
8 | // eslint-disable-next-line
9 | }, []);
10 |
11 | function getLikeCountForMentor (mentorName) {
12 | const mentorLikeCount = localStorage.getItem(`${mentorName}_likeCount`);
13 | if (mentorLikeCount) {
14 | setLikeCount(parseInt(mentorLikeCount));
15 | }
16 | }
17 |
18 | function setLikeCountToLocalStorage () {
19 | setLikeCount(likeCount + 1)
20 | localStorage.setItem(`${props.name}_likeCount`, likeCount + 1);
21 | }
22 |
23 | return (
24 |
25 |
♥
26 |
{likeCount}
27 |
28 | );
29 | }
30 |
31 | export default Heart;
--------------------------------------------------------------------------------
/readme-translations/README-hu.md:
--------------------------------------------------------------------------------
1 | # Coding-AI
2 | A Coding-AI segít a te technológiai vermedben jártas mentort találni. [](https://app.netlify.com/sites/mentors/deploys)
3 |
4 |
5 | # Üdvözöl a HacktoberFest 2019!
6 | Hogy létrehozd az első pull requestedet, kövesd az itt leírt lépéseket:
7 |
8 | 1. Forkold ezt a repository-t.
9 |
10 | 2. Clone-old a forkolt repositorydat a helyi készülékedre.
11 |
12 | 3. Válassz ki egy issue-t az issue listárol, és hozd létre a PR-t (pull request).
13 |
14 | 4. Írd be ezeket az utasításokat a terminal-odba:
15 | ```
16 | git add -A
17 | git commit -m "your name"
18 | git push origin master
19 | ```
20 | 5. Ezután menj a 'Pull requests' részre a repository-d github oldalán, és hozd létre a PR-t.
21 |
22 | 6. Csillagozd be a repository-mat.
23 |
24 | 7. Szép munka! Sikeresen elkészítetted a pull request-et.
25 |
26 | 8. Kövesd, hogy mennyi van még hátra a kihívásbol [itt](https://hacktoberfest.digitalocean.com/profile), és várd a pólódat!
27 |
--------------------------------------------------------------------------------
/readme-translations/README-ta.md:
--------------------------------------------------------------------------------
1 | # Coding-AI
2 | Coding-AI உங்கள் தொழில்நுட்பங்களின் அடுக்கு தொடர்பான வழிகாட்டியைக் கண்டுபிடிக்க உதவுகிறது. [](https://app.netlify.com/sites/mentors/deploys)
3 |
4 |
5 | # HacktoberFest 2019க்கு வரவேற்கிறோம்!
6 | உங்கள் முதல் இழுப்பு கோரிக்கையை செய்ய இந்த படிகளைப் பின்பற்றவும்:
7 |
8 | 1. இந்த களஞ்சியத்தை நகலெடுக்கவும்
9 |
10 | 2. உங்கள் நகலெடுக்கப்பட்ட களஞ்சியத்தை உங்கள் கணினியில் குளோன் செய்யுங்கள்.
11 |
12 | 3. சிக்கல்கள் பட்டியலிலிருந்து எந்தவொரு சிக்கலையும் எடுத்து PR ஐ உருவாக்கவும்.
13 |
14 | 4. இந்த கட்டளைகளை உங்கள் முனையத்தில் எழுதுங்கள்:
15 | ```
16 | git add -A
17 | git commit -m "your name"
18 | git push origin master
19 | ```
20 | 5. உங்கள் இழுப்பு கோரிக்கையை உருவாக்கவும்.
21 |
22 | 6. எனது களஞ்சியத்தை நட்சத்திரமிடுங்கள்.
23 |
24 | 7. வாழ்த்துக்கள் !! உங்கள் இழுத்தல் கோரிக்கையை வெற்றிகரமாக உருவாக்கியுள்ளீர்கள்.
25 |
26 | 8. உங்கள் முன்னேற்றத்தை [இங்கே](https://hacktoberfest.digitalocean.com/profile) சரிபார்த்து, உங்கள் சட்டைக்காக காத்திருங்கள்.
27 |
--------------------------------------------------------------------------------
/readme-translations/README-de.md:
--------------------------------------------------------------------------------
1 | # Coding-AI
2 | Coding-AI hilft Ihnen, einen Mentor zu finden, der mit Ihren Technologiestacks zu tun hat. [](https://app.netlify.com/sites/mentors/deploys)
3 |
4 |
5 | # Willkommen beim HacktoberFest 2019!
6 | Folge diesen Schritten um deine erste Pull Request zu machen:
7 |
8 | 1. Fork dieses Repository
9 |
10 | 2. Klone dein Fork Repository auf deinen lokalen Computer.
11 |
12 | 3. Suche dir ein Problem (`issue`) aus der Problemliste (`Issues`) und erstelle deine Pull Request (PR).
13 |
14 | 4. Schreibe diese Kommandos in deine Eingabeaufforderung (`CMD`, `Terminal`, `Git-Bash`, etc.):
15 | ```
16 | git add -A
17 | git commit -m "dein Name"
18 | git push origin master
19 | ```
20 | 5. Dann erstelle deine Pull Request (PR).
21 |
22 | 6. Gib diesem Repository einen Stern.
23 |
24 | 7. Glückwunsch! Du hast erfolgreich deine Pull Request erstellt.
25 |
26 | 8. Überprüfe deinen Fortschritt [hier](https://hacktoberfest.digitalocean.com/profile) und warte auf dein T-Shirt!
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 10secondsofcode
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import { BrowserRouter, Route, Switch } from "react-router-dom";
4 | import Login from "./components/Login";
5 | import MentorProfile from "./components/MentorProfile";
6 | import App from './App';
7 | import * as serviceWorker from './serviceWorker';
8 |
9 | import 'bootstrap/dist/css/bootstrap.css';
10 | import 'devicon/devicon.git/devicon.css'
11 | import 'devicon/devicon.git/devicon-colors.css'
12 | import 'font-mfizz/dist/font-mfizz.css'
13 |
14 |
15 | ReactDOM.render(
16 |
17 |
18 |
19 |
20 |
21 |
22 | ,
23 | document.getElementById('root')
24 | );
25 |
26 | // If you want your app to work offline and load faster, you can change
27 | // unregister() to register() below. Note this comes with some pitfalls.
28 | // Learn more about service workers: http://bit.ly/CRA-PWA
29 | serviceWorker.register();
30 |
--------------------------------------------------------------------------------
/public/service-worker.js:
--------------------------------------------------------------------------------
1 | var doCache = true;
2 | alert("LEaf ===> "+doCache);
3 | var CACHE_NAME = "my-pwa-cache-v1";
4 |
5 | self.addEventListener("activate", event => {
6 | const cacheWhitelist = [CACHE_NAME];
7 | event.waitUntil(
8 | caches.keys().then(keyList =>
9 | Promise.all(
10 | keyList.map(key => {
11 | if (!cacheWhitelist.includes(key)) {
12 | console.log("Deleting cache: " + key);
13 | return caches.delete(key);
14 | }
15 | })
16 | )
17 | )
18 | );
19 | });
20 |
21 | self.addEventListener("install", function(event) {
22 | if (doCache) {
23 | event.waitUntil(
24 | caches.open(CACHE_NAME).then(function(cache) {
25 | fetch("manifest.json")
26 | .then(response => {
27 | response.json();
28 | })
29 | .then(assets => {
30 | const urlsToCache = ["/", assets["main.js"]];
31 | cache.addAll(urlsToCache);
32 | console.log("cached");
33 | });
34 | })
35 | );
36 | }
37 | });
38 |
39 | self.addEventListener("fetch", function(event) {
40 | if (doCache) {
41 | event.respondWith(
42 | caches.match(event.request).then(function(response) {
43 | return response || fetch(event.request);
44 | })
45 | );
46 | }
47 | });
--------------------------------------------------------------------------------
/src/components/Topics.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Route, Link } from "react-router-dom";
3 | import Topic from "../components/Topic";
4 |
5 | const Topics = ({ match }) => {
6 | return (
7 |