Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted CRA to Vite. #188

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
# and commit this file to your remote git repository to share the goodness with others.

# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart

tasks:
- init: npm install && npm run build
command: npm run start


5 changes: 3 additions & 2 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" href="%PUBLIC_URL%/icon.png" />
<link rel="icon" href="/icon.png" />
<!-- Primary tags -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand Down Expand Up @@ -34,7 +34,7 @@
<meta property="twitter:image" content="https://user-images.githubusercontent.com/96580571/245455697-56ff1c06-1392-46c8-8a76-940cebf0c19f.png" />

<title>Poll It Up</title>
<link rel="manifest" href="manifest.json">
<link rel="manifest" href="./manifest.json">

<script>
if ('serviceWorker' in navigator) {
Expand Down Expand Up @@ -87,6 +87,7 @@
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="./src/index.jsx"></script>

<!-- FOOTER -->
<footer>
Expand Down
File renamed without changes.
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^12.8.3",
"@vitejs/plugin-react": "^4.0.0",
"animate.css": "^4.1.1",
"chart.js": "^2.9.4",
"cra-template-pwa": "^1.0.3",
Expand All @@ -29,16 +30,17 @@
"react-dom": "^17.0.1",
"react-google-maps": "^9.4.5",
"react-icons": "^4.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.3",
"react-router-dom": "^5.3.4",
"react-transition-group": "^4.4.1",
"vite": "^4.3.9",
"vite-plugin-svgr": "^3.2.0",
"vite-tsconfig-paths": "^4.2.0",
"web-vitals": "^1.1.1"
},
"scripts": {
"start": "react-scripts --openssl-legacy-provider start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"start": "vite",
"build": "vite build",
"serve": "vite preview"
},
"eslintConfig": {
"extends": [
Expand All @@ -57,5 +59,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/react-router-dom": "^5.3.3"
}
}
4 changes: 2 additions & 2 deletions server/db/mongoose.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const mongoose=require('mongoose')
mongoose.set('strictQuery', false);
mongoose.connect('mongodb://127.0.0.1:27017/curiomind',{})

const connectToDatabase=()=>{console.log("Connected")}

module.exports=connectToDatabase
module.exports=connectToDatabase;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/pages/discover.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ export default function Discover() {
<Box w="90%" h="80vh" borderWidth="1px" borderRadius="lg" overflow="hidden">
<Map defaultCenter={[39.0831315, -77.2049467]} defaultZoom={12} width="100%" height="100%" provider={getProvider}>
{
markers.map(marker => <Marker anchor={[marker.location._lat, marker.location._long]} width={50} height={50} onClick={() => handleClick(marker)} />)
markers.map((marker,index) => <Marker key={index} anchor={[marker.location._lat, marker.location._long]} width={50} height={50} onClick={() => handleClick(marker)} />)
}
{
markers.map(marker =>
<Overlay anchor={[marker.location._lat, marker.location._long]} offset={[18, 54]} >
markers.map((marker,index) =>
<Overlay key={index} anchor={[marker.location._lat, marker.location._long]} offset={[18, 54]} >
<ProfileMarker marker={marker} set1={setPost} set2={setShowPopup} />
</Overlay>
)
Expand All @@ -144,7 +144,7 @@ export default function Discover() {
<Container maxW="container.lg" mt={12}>
<Heading>Most Recent Polls</Heading>
<SimpleGrid p={8} columns={{ base: 1, md: 2, lg: 4 }} spacing={6}>
{markers.slice(-8).map(marker => <Poll /*pollvoting={true}*/ name={marker.name} description={marker.description} data={marker} flag="discover" />)}
{markers.slice(-8).map((marker,index) => <Poll /*pollvoting={true}*/ key={index} name={marker.name} description={marker.description} data={marker} flag="discover"/>)}
</SimpleGrid>
</Container>
</Box>
Expand Down
16 changes: 0 additions & 16 deletions src/pages/emailSent.jsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,17 @@
import React from 'react';
import { useHistory, Route , Routes , Redirect } from 'react-router-dom';

import initFirebase from '../lib/firebase';
import firebase from 'firebase/app';
import 'firebase/auth';
import { useAuth } from '../lib/auth';
import { addDoc, getDoc } from '../lib/db';

import { emailRequestForm } from "../components/emailRequestForm";
import { DividerWithText } from '../components/dividerWithText';
import { FaGoogle } from 'react-icons/fa';

import {
Container,
Box,
Heading,
Text,
Button,
SimpleGrid,
useColorModeValue as mode,
VisuallyHidden,
useToast,
Image,
Center
} from '@chakra-ui/react';
import Link from '../components/link';
import EmailRequestForm from '../components/emailRequestForm';
import {LoginForm} from '../components/loginForm';
import login from './login';

function EmailSentPage() {
function handleResetPassword() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import viteTsconfigPaths from 'vite-tsconfig-paths';
import svgrPlugin from 'vite-plugin-svgr';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), viteTsconfigPaths(), svgrPlugin()],
});