From 6af3de279adcb66c18bf44c14bdb6a2b39e2205f Mon Sep 17 00:00:00 2001 From: rhorom Date: Wed, 3 Jan 2024 12:08:51 +0000 Subject: [PATCH] remove unnecessary files --- package.json | 8 +--- public/vite.svg | 1 - src/App.tsx | 2 +- src/Map.tsx | 2 +- src/dummy_table.json | 1 - src/snkrs.ts | 87 -------------------------------------------- vite.config.js | 2 +- 7 files changed, 5 insertions(+), 98 deletions(-) delete mode 100644 public/vite.svg delete mode 100644 src/dummy_table.json delete mode 100644 src/snkrs.ts diff --git a/package.json b/package.json index d8c6ece..76696ac 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "impact_portal", + "name": "ciff_impact_portal", "private": true, "version": "0.1.0", "type": "module", @@ -17,16 +17,12 @@ "html-react-parser": "^5.0.11", "jsurl": "^0.1.5", "leaflet": "^1.9.4", - "localforage": "^1.10.0", - "match-sorter": "^6.3.1", "react": "^18.2.0", "react-bootstrap": "^2.9.1", "react-dom": "^18.2.0", "react-icons": "^4.12.0", "react-leaflet": "^4.2.1", - "react-router-dom": "^6.21.0", - "react-table": "^7.8.0", - "sort-by": "^0.0.2" + "react-router-dom": "^6.21.0" }, "devDependencies": { "@types/react": "^18.2.43", diff --git a/public/vite.svg b/public/vite.svg deleted file mode 100644 index e7b8dfb..0000000 --- a/public/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index d2db61a..b28a19b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,11 +3,11 @@ import * as JSURL from "jsurl"; import type { NavigateOptions } from "react-router-dom"; import { Routes, Route, Link, useSearchParams } from "react-router-dom"; import 'bootstrap/dist/css/bootstrap.css'; +import parser from 'html-react-parser'; import table from './data/impact_table.json'; import { TheMap } from './Map'; import { columns, detailColumns, longColumns } from './config' import { onlyUnique } from "./utils"; -import parser from 'html-react-parser'; export default function App() { return ( diff --git a/src/Map.tsx b/src/Map.tsx index e550195..a6a764d 100644 --- a/src/Map.tsx +++ b/src/Map.tsx @@ -1,11 +1,11 @@ import * as React from 'react'; import { MapContainer, GeoJSON, Marker, CircleMarker, Popup, Pane, TileLayer, useMap } from 'react-leaflet'; import 'leaflet/dist/leaflet.css'; +import * as L from 'leaflet'; import table from './data/impact_table.json'; import boundary from './data/boundary.json'; import { onlyUnique } from './utils'; import { activeStyle, regionStyle, columns } from './config'; -import * as L from 'leaflet'; var main_map: any; diff --git a/src/dummy_table.json b/src/dummy_table.json deleted file mode 100644 index f2e0b89..0000000 --- a/src/dummy_table.json +++ /dev/null @@ -1 +0,0 @@ -[{"ID":1,"Name":"Activity 1","Country":"Indonesia","Sector":"Maternal health","Target Population":"Mother","Primary Outcome":"Indicator A","Status":"Completed"},{"ID":2,"Name":"Activity 2","Country":"Nigeria","Sector":"Education","Target Population":"Public","Primary Outcome":"Indicator B","Status":"Not completed"},{"ID":3,"Name":"Activity 3","Country":"Ghana","Sector":"Public policy","Target Population":"Health facility","Primary Outcome":"Indicator A","Status":"Not completed"},{"ID":4,"Name":"Activity 4","Country":"Ethiopia","Sector":"Child health","Target Population":"Childern","Primary Outcome":"Indicator C","Status":"Not completed"},{"ID":5,"Name":"Activity 5","Country":"Burkina Faso","Sector":"Education","Target Population":"Childern","Primary Outcome":"Indicator B","Status":"Not completed"},{"ID":6,"Name":"Activity 6","Country":"Indonesia","Sector":"Education","Target Population":"Childern","Primary Outcome":"Indicator A","Status":"Not completed"},{"ID":7,"Name":"Activity 7","Country":"Nigeria","Sector":"Maternal health","Target Population":"Mother","Primary Outcome":"Indicator B","Status":"Not completed"},{"ID":8,"Name":"Activity 8","Country":"Ghana","Sector":"Education","Target Population":"Teenager","Primary Outcome":"Indicator A","Status":"Not completed"},{"ID":9,"Name":"Activity 9","Country":"Ethiopia","Sector":"Public policy","Target Population":"Health worker","Primary Outcome":"Indicator C","Status":"Not completed"},{"ID":10,"Name":"Activity 10","Country":"Burkina Faso","Sector":"Reproductive health","Target Population":"Teenager","Primary Outcome":"Indicator B","Status":"Not completed"},{"ID":11,"Name":"Activity 11","Country":"Indonesia","Sector":"Education","Target Population":"Teenager","Primary Outcome":"Indicator A","Status":"Not completed"},{"ID":12,"Name":"Activity 12","Country":"Nigeria","Sector":"Public policy","Target Population":"Local government","Primary Outcome":"Indicator B","Status":"Not completed"},{"ID":13,"Name":"Activity 13","Country":"Ghana","Sector":"Reproductive health","Target Population":"Teenager","Primary Outcome":"Indicator A","Status":"Completed"},{"ID":14,"Name":"Activity 14","Country":"Ethiopia","Sector":"Education","Target Population":"Childern","Primary Outcome":"Indicator C","Status":"Completed"},{"ID":15,"Name":"Activity 15","Country":"Burkina Faso","Sector":"Child health","Target Population":"Childern","Primary Outcome":"Indicator B","Status":"Completed"}] \ No newline at end of file diff --git a/src/snkrs.ts b/src/snkrs.ts deleted file mode 100644 index 6f70e93..0000000 --- a/src/snkrs.ts +++ /dev/null @@ -1,87 +0,0 @@ -interface Sneaker { - id: string; - colorway: string; - imageUrl: string; - model: string; - brand: string; - } - -let SNEAKERS: Sneaker[] = [ - { - id: "1", - colorway: "Green", - imageUrl: - "https://images.mcan.sh/b_auto,c_pad,f_auto,h_400,q_auto,w_400/v1/shoes/bkkj0lqzlwlwdwtofqxs", - model: "Vintage", - brand: "Nike", - }, - { - id: "2", - colorway: "Red", - imageUrl: - "https://images.mcan.sh/b_auto,c_pad,f_auto,h_400,q_auto,w_400/v1/shoes/RPlzC_CBHjiMM4dr90gdU", - model: "AirMax", - brand: "Nike", - }, - { - id: "3", - colorway: "Green", - imageUrl: - "https://images.mcan.sh/b_auto,c_pad,f_auto,h_400,q_auto,w_400/v1/shoes/0bf9336b-03c9-4cbd-b482-f4e80b770582", - model: "AirMax", - brand: "Nike", - }, - { - id: "5", - colorway: "Beluga", - imageUrl: - "https://images.mcan.sh/b_auto,c_pad,f_auto,h_400,q_auto,w_400/v1/shoes/irxakb1ij0uzmcvn9szo", - model: "Yeezy", - brand: "Adidas", - }, - { - id: "6", - colorway: "Red", - imageUrl: - "https://images.mcan.sh/b_auto,c_pad,f_auto,h_400,q_auto,w_400/v1/shoes/g9tjjjdn476nhou1c1dj", - model: "Grid SD", - brand: "Saucony", - }, - { - id: "7", - colorway: "Red", - imageUrl: - "https://images.mcan.sh/b_auto,c_pad,f_auto,h_400,q_auto,w_400/v1/shoes/erg1lxa8x29h1wtbog9a", - model: "AirMax", - brand: "Vans", - }, - { - id: "8", - colorway: "Beluga", - imageUrl: - "https://images.mcan.sh/b_auto,c_pad,f_auto,h_400,q_auto,w_400/v1/shoes/u4z27k4wyzr7bxatlfgj", - model: "AirMax", - brand: "Nike", - }, - ]; - -function filterByBrand(brand, color) { - let selected = SNEAKERS; - if (brand !== null) { - selected = SNEAKERS.filter((sneaker) => sneaker.brand.toLowerCase() === brand.toLowerCase()) - } - if (color !== null) { - selected = SNEAKERS.filter((sneaker) => sneaker.colorway.toLowerCase() === color.toLowerCase()) - } - return selected; - } - - function getSneakerById(id: string) { - return SNEAKERS.find((sneaker) => sneaker.id === id); - } - - let brands = [...new Set(SNEAKERS.map((sneaker) => sneaker.brand))]; - - let colors = [...new Set(SNEAKERS.map((sneaker) => sneaker.colorway))]; - - export { brands, colors, SNEAKERS, filterByBrand, getSneakerById }; \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index c951209..f10da72 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,6 +3,6 @@ import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ - base: "/ciff_impact_portal", + base: "/ciff_impact_portal/", plugins: [react()], })