Skip to content

Commit

Permalink
firebase nhi horya :(
Browse files Browse the repository at this point in the history
  • Loading branch information
avibedi1768 committed Sep 9, 2023
1 parent 9d8a0c9 commit 8dd0f15
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 17 deletions.
111 changes: 111 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Signup from './Components/jsx/Signup';
import Main from './Components/jsx/Main';
// import Navigation from './Components/Navigation'; // Import the Navigation component


function App() {
return (
<div className="App">
Expand Down
35 changes: 21 additions & 14 deletions src/Components/jsx/Signup.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
import React from 'react'
import { useState } from 'react'
import { Link } from 'react-router-dom'
import Arrow1 from '../imgs/Arrow 1.png'
import Arrow2 from '../imgs/Arrow 2.png'
import '../css/signup.css'
import db from '../../Firebase-config'

function Signup() {

let [user, setUser] = useState('')
let [pass, setPass] = useState('')
function send() {
console.log('helo')
// var username = document.getElementById('username').value;
// var password = document.getElementById('password').value;
// if (username == '' || password == '') {
// const alert = () => {
// alert('Please enter data');
// }
// }
console.log(user + ' ' + pass)
if (user == '' || pass == '') {
alert('Please enter data');
return;
} else {
db.ref(user).set({
Password: pass
})

}
}

let style1 = {
Expand All @@ -26,20 +31,22 @@ function Signup() {
<div className='signup'>
<div className="container">
<h2>Sign-Up</h2>
<input type="text" placeholder="Username" id="username" />
<input type="text" placeholder="Username" onChange={(e) => setUser(e.target.value)} />
<p>HINT: Enter your instagram username</p>
<br /><br />
<input type="password" id="password" placeholder="Password" className="inp" />
<br />
<p>HEY! {user}</p>
<br />
<input type="password" placeholder="Password" className="inp" onChange={(e) => setPass(e.target.value)} />
<i className="far fa-eye" id="togglePassword" style={style1}></i>

<br /><br />
<input
{/* <input
type="password"
id="repassword"
className="inp"
placeholder="Re-enter Password"
/>
<i className="far fa-eye" id="retogglePassword" style={style1}></i>
<i className="far fa-eye" id="retogglePassword" style={style1}></i> */}

<br /><br /><br />
<button type="submit" id="btn" onClick={send}>
Expand Down
8 changes: 5 additions & 3 deletions src/Firebase-config,js → src/Firebase-config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { initializeApp } from "firebase/app";
import { initializeApp } from 'firebase/app';
import { getAnalytics } from "firebase/analytics";

const firebaseConfig = {
apiKey: "AIzaSyCNBKA2-9-hwSR51W_dTeQkUVKM_CHAyO0",
authDomain: "ngl-knockoff.firebaseapp.com",
databaseURL: "https://ngl-knockoff-default-rtdb.firebaseio.com",
projectId: "ngl-knockoff",
storageBucket: "ngl-knockoff.appspot.com",
messagingSenderId: "303503322190",
Expand All @@ -11,5 +13,5 @@ const firebaseConfig = {
};

const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);

const db = getAnalytics(app);
export default db;

0 comments on commit 8dd0f15

Please sign in to comment.