Skip to content

Commit

Permalink
mostly done
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Aug 4, 2022
1 parent 657f987 commit 4e0f1cd
Show file tree
Hide file tree
Showing 19 changed files with 2,115 additions and 321 deletions.
Empty file added dependencygraph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,405 changes: 1,347 additions & 58 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@headlessui/react": "^1.5.0",
"@emailjs/browser": "^3.6.2",
"@headlessui/react": "^1.6.6",
"@heroicons/react": "^1.0.6",
"@material-tailwind/react": "0.3.4",
"@popperjs/core": "2.9.1",
Expand All @@ -13,25 +14,28 @@
"@types/geojson": "^7946.0.8",
"@types/jest": "^27.4.1",
"@types/node": "^16.11.26",
"@types/react": "^17.0.40",
"@types/react-dom": "^17.0.13",
"country-json": "^1.1.2",
"emailjs": "^4.0.0",
"flowbite": "^1.4.7",
"flowbite-react": "^0.1.3",
"fs": "^0.0.1-security",
"geojson": "^0.5.0",
"leaflet": "^1.7.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-leaflet": "^3.2.5",
"react-scripts": "5.0.0",
"typescript": "^4.6.2",
"web-vitals": "^2.1.4"
"web-vitals": "^2.1.4",
"yarn": "^1.22.19"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"architecture": "depcruise --include-only \"^src\" --output-type dot src | dot -T svg > dependencygraph.svg"
},
"eslintConfig": {
"extends": [
Expand All @@ -53,9 +57,14 @@
},
"devDependencies": {
"@types/leaflet": "^1.7.9",
"@types/react": "^18.0.15",
"autoprefixer": "^10.4.7",
"dependency-cruiser": "^11.11.0",
"postcss": "^8.4.14",
"tailwind": "^4.0.0",
"tailwindcss": "^3.1.5"
},
"compilerOptions": {
"useUnknownInCatchVariables": false
}
}
Binary file added public/%PUBLIC_URL%/favicon.ico
Binary file not shown.
Binary file removed public/geeez.jpg
Binary file not shown.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>IGO map</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
40 changes: 28 additions & 12 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,46 @@
import React, {useState} from 'react';
import './App.css';
import SearchBar from './components/searchbar/SearchBar';
import Map from "./components/map/Map"
import Map from "./components/map/Map";
import "@material-tailwind/react/tailwind.css";
import IntroductionModal from './components/IntroductionModal';
import OrganizationInfo from "./components/organizationinfo/OrganizationInfo";
import EditModal from './components/modals/EditModal';
import { InformationCircleIcon} from '@heroicons/react/outline'


function App() {

const [curentOrg, setcurentOrg] = useState("")
//name of intergovernmental organisation the user selected to show
const [curentOrg, setcurentOrg] = useState("");

function changeCurrentOrg(org: string) {
setcurentOrg(org)
setcurentOrg(org);
}

console.log("just a small test");
const [introductionModalOpen, setintroductionModalOpen] = useState(false)


function triggerIntroductionModal() {
setintroductionModalOpen(!introductionModalOpen)
}


return (
<div className="App ">

<div className="flex gap-4 ">
<SearchBar changeCurrentOrg={changeCurrentOrg}></SearchBar>
<Map organization={curentOrg}></Map>

<IntroductionModal></IntroductionModal>

<div className="App">
<div className=" flex flex-row ">
<SearchBar triggerIntroductionModal = {triggerIntroductionModal} changeCurrentOrg={changeCurrentOrg}></SearchBar>
<div className=' w-full'>
<Map currentOrganization={curentOrg}></Map>
{curentOrg ? <OrganizationInfo currentOrganization = {curentOrg} ></OrganizationInfo> : <></> }
</div>
</div>
<div className=' flex flex-row h-fit w-fit sticky left-full m-7 bottom-5 '>
<div onClick={triggerIntroductionModal} className=' m-2 w-fit p-4 h-fit bg-slate-100 bg-opacity-80 hover:bg-slate-600 hover:cursor-pointer rounded-full'><InformationCircleIcon className=' scale-125 h-5 w-5'/></div>
<IntroductionModal triggerIntroductionModal = {triggerIntroductionModal} open = {introductionModalOpen}></IntroductionModal>
{curentOrg ? <EditModal currentOrganization={curentOrg}></EditModal> : <></>}
{/* TODO: add theme change modal :) */}
{/* <ThemeChangeModal theme = {}></ThemeChangeModal> */}
</div>
</div>
);
Expand Down
148 changes: 113 additions & 35 deletions src/components/IntroductionModal.tsx
Original file line number Diff line number Diff line change
@@ -1,45 +1,123 @@
import React, {useState, Fragment} from 'react'
import { Modal, Button} from "flowbite-react"
import React, {TextareaHTMLAttributes, useEffect} from 'react'
import { Fragment, useRef, useState} from 'react'
import { Dialog, Transition} from '@headlessui/react'
import { InformationCircleIcon, CheckIcon, EmojiHappyIcon } from '@heroicons/react/outline'

interface introductionModalProps {
open: boolean,
triggerIntroductionModal: () => void
}

const IntroductionModal = () => {
const [open, setopen] = useState(true)

function onClick () {
console.log("heyy i happened :)")
setopen(!open)
}

const IntroductionModal = (props: introductionModalProps) => {

const cancelButtonRef = useRef(null)

return (
<div style={{width: "80px", overflow: 'hidden'}}>
<>
<Modal
show={open}
onClose={onClick}
<>
{/* Modal */}
<Transition.Root show={props.open} as={Fragment}>
<Dialog as="div" className="relative z-10" initialFocus={cancelButtonRef} onClose={props.triggerIntroductionModal}>
<Transition.Child
as={Fragment}
enter="ease-out duration-300"
enterFrom="opacity-0"
enterTo="opacity-25"
leave="ease-in duration-200"
leaveFrom="opacity-25"
leaveTo="opacity-0"
>
<Modal.Header>
About fact book
</Modal.Header>
<Modal.Body>
<div className="space-y-6">
<p className="text-base leading-relaxed text-gray-500 dark:text-gray-400">
Dear visitor, this webpage was created to showcase various IGOs (inter-governmental organisations)
</p>
<p className="text-base leading-relaxed text-gray-500 dark:text-gray-400">
Data were scraped from cia world fact book in the year 2020 so there might be some inaccuracies
</p>
<div className="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" />
</Transition.Child>

<div className="fixed z-10 inset-0 overflow-y-auto">
<div className="flex items-center sm:items-center justify-center min-h-full p-4 text-center sm:p-0">
<Transition.Child
as={Fragment}
enter="ease-out duration-300"
enterFrom="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
enterTo="opacity-100 translate-y-0 sm:scale-100"
leave="ease-in duration-200"
leaveFrom="opacity-100 translate-y-0 sm:scale-100"
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
>
<Dialog.Panel className="relative bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-lg sm:w-full">
<div className="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div className="sm:flex sm:items-start">
<div className="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-100 sm:mx-0 sm:h-10 sm:w-10">
<InformationCircleIcon className="h-6 w-6 text-blue-600" aria-hidden="true" />
</div>
<div className="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
<Dialog.Title as="h3" className="text-lg leading-6 font-medium text-gray-900">
Information about IGO Map
</Dialog.Title>
<hr className='my-4' />
<p className="text-base leading-relaxed text-gray-900 dark:text-gray-400">
Dear visitor, this webpage was created to showcase various IGOs (inter-governmental organisations)
<hr className='my-4' />
the data were scraped from <a href='#www.ciaworldfactbook.com' target="_blank" className=' font-semibold text-slate-700'>The World Factbook</a> in the year 2020 and
may be obsolete or incomplete, if that is the case you can help us update these data by filling form in edit button
<hr className='my-4' />
Enjoy 😄
</p>

</div>

</div>
</div>


<div className="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
<button
type="button"
className="mt-3 w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-slate-600 text-base font-medium text-white hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-slate-500 sm:ml-3 sm:w-auto sm:text-sm"
onClick={props.triggerIntroductionModal}
>
Understand &nbsp;<CheckIcon className='h-6 w-6'></CheckIcon>
</button>

</div>
</Dialog.Panel>
</Transition.Child>
</div>
</Modal.Body>
<Modal.Footer>
<Button onClick={onClick}>
Got it
</Button>

</Modal.Footer>
</Modal>
</>
</div>
</div>
</Dialog>
</Transition.Root>
</>
)
}



// <div style={{width: "80px", overflow: 'hidden'}}>
// <>
// <Modal
// show={open}
// onClose={onClick}
// >
// <Modal.Header>
// About fact book
// </Modal.Header>
// <Modal.Body>
// <div className="space-y-6">
// <p className="text-base leading-relaxed text-gray-500 dark:text-gray-400">
// Dear visitor, this webpage was created to showcase various IGOs (inter-governmental organisations)
// </p>
// <p className="text-base leading-relaxed text-gray-500 dark:text-gray-400">
// Data were scraped from cia world fact book in the year 2020 so there might be some inaccuracies
// </p>
// </div>
// </Modal.Body>
// <Modal.Footer>
// <Button onClick={onClick}>
// Got it
// </Button>

// </Modal.Footer>
// </Modal>
// </>
// </div>



export default IntroductionModal
Loading

0 comments on commit 4e0f1cd

Please sign in to comment.