Skip to content
Snippets Groups Projects
Commit 8e74f2dc authored by bsanyi1998's avatar bsanyi1998
Browse files

Merge branch 'master' into 'main'

Master

See merge request !1
parents 538c37b0 f1cfa738
No related branches found
No related tags found
1 merge request!1Master
asset-manifest.json,1634157325191,09514d2c8e3dc1cb92bb8cdbe987d10fe39e2d691f66a64d6a36084ebc489ccc
favicon.ico,1634157322427,c599b7a91ab3627e3538125d9f40adc2d4bf949046984262670545dc7738af06
index.html,1634157325191,bb32bf018138f45f4bd99376da48e2fd879108786672dc96e2f60140921e02a3
logo192.png,1634157322427,76c449ccb9cd117c2f2338f091b18f7050f3210e249b2228f5c81b23f34377cd
manifest.json,1634157322427,0958a5e0c831126100c8c2d06a6bbaa665a3900f21aaff4130238a6f5a113aa1
robots.txt,1634157322427,2544ca049f223a42bff01f72ad930a5edba75bbb7199d0f8430a02ff5aca16ec
static/css/main.d87cbb72.chunk.css,1634157325191,960f22a1840c08f5c0e08bec5d701f41c200b06ed24234b80b553873777c8ca5
logo512.png,1634157322427,7779210d56c1f3741e2e487799fe3092def4fa6ac450a60532b807c3a8971205
static/css/main.d87cbb72.chunk.css.map,1634157325191,f31f967aeb5a9885c8b7ed24a0f79ab211b8d7d7765bb5d6070c08b2c56fcd5f
static/js/2.51a186f7.chunk.js.LICENSE.txt,1634157325191,ca0ab16c5c8f495df0b1f695c20b3f4f8750e5bb4a6ba2d33f1c7b5c599e167b
static/js/main.2e090636.chunk.js,1634157325191,4ef00a1dd5875ae252d02b6a358b305275e49c6829de9cf19569db7fa643ae6e
static/js/main.2e090636.chunk.js.map,1634157325191,38c566e5e2b5bc13e2c3ce551a287da00fcf5ebeda11d582d99b06570d766eca
static/js/runtime-main.05878717.js,1634157325191,8911802426736a2f3fe65eb2671cdec22991691f280f8a3fa3fc8eeb986febf8
static/js/runtime-main.05878717.js.map,1634157325191,a7896f05729a7562bd4c95a894d436c233bd4ff19898cbf5e548bea97a3c7b70
static/js/2.51a186f7.chunk.js,1634157325191,d21bcbb0ee881e89c87db095c95e29b4f8fe33d9b5e4f49396b3289d059a0442
static/js/2.51a186f7.chunk.js.map,1634157325191,e28bcbcbb80df780e8848d27e1a4212abe919a9cb85c38aefae989c19db253d9
{
"projects": {
"default": "sruhatar"
}
}
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# SSSLRuhatar
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `yarn start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `yarn test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `yarn build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `yarn eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
{
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
},
"remoteconfig": {
"template": "remoteconfig.template.json"
}
}
{
"indexes": [],
"fieldOverrides": []
}
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if false;
}
}
}
\ No newline at end of file
This diff is collapsed.
{
"name": "ssslruhatar",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/firebase": "^3.2.1",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/react-router": "^5.1.17",
"@types/react-router-dom": "^5.3.1",
"firebase": "^9.1.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-firebase-hooks": "^3.0.4",
"react-router": "^5.2.1",
"react-router-dom": "^5.3.0",
"react-scripts": "4.0.3",
"typescript": "^4.1.2",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
public/favicon.ico

3.78 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
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>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
public/logo192.png

5.22 KiB

public/logo512.png

9.44 KiB

{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
{}
\ No newline at end of file
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
import "./App.css";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import Login from "./pages/Login";
import Register from "./pages/Register";
import Home from "./pages/Home";
import Dashboard from "./pages/Dashboard";
function App() {
return (
<div className="app">
<Router>
<Switch>
<Route exact path="/" component={Home} />
<Route exact path="/register" component={Register} />
<Route exact path="/login" component={Login} />
<Route exact path="/dashboard" component={Dashboard} />
</Switch>
</Router>
</div>
);
}
export default App;
import { initializeApp } from "firebase/app";
import {
getAuth,
signInWithEmailAndPassword,
createUserWithEmailAndPassword,
} from "@firebase/auth";
import { collection, addDoc, getFirestore } from "firebase/firestore";
const firebaseConfig = {
apiKey: "AIzaSyDyX6i1gZDti_E014A_pIx257IurTW8u24",
authDomain: "sruhatar.firebaseapp.com",
projectId: "sruhatar",
storageBucket: "sruhatar.appspot.com",
messagingSenderId: "69554238669",
appId: "1:69554238669:web:e5555da89be2e1e1686584",
};
initializeApp(firebaseConfig);
const auth = getAuth();
const db = getFirestore();
const signWithEmailAndPassword = async (email: string, password: string) => {
try {
await signInWithEmailAndPassword(auth, email, password);
} catch (err) {
console.error(err);
alert((err as any).message);
}
};
const registerWithEmailAndPassword = async (
name: string,
email: string,
password: string
) => {
try {
const res = await createUserWithEmailAndPassword(auth, email, password);
const user = res.user;
await addDoc(collection(db, "users"), {
uid: user.uid,
name,
authProvider: "local",
email,
});
} catch (err) {
console.error(err);
alert((err as any).message);
}
};
const logout = () => {
auth.signOut();
};
export {
auth,
db,
signWithEmailAndPassword,
registerWithEmailAndPassword,
logout,
};
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root")
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment