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

Added changes to readme file #29

Open
wants to merge 3 commits into
base: master
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
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
70 changes: 70 additions & 0 deletions Eve-fests_web/Frontend_Eve-fests/React4Frontend
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

var element = React.createElement('h1', { className: 'greeting' }, 'Hello, world!');
ReactDOM.render(element, document.getElementById('root'));

reportWebVitals();

import React, { useState } from 'react';

function App() {
const [isRegistering, setIsRegistering] = useState(true);
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [loggedInUser, setLoggedInUser] = useState(null);

const handleToggleMode = () => {
setIsRegistering(!isRegistering);
};

const handleAuth = () => {
if (isRegistering) {
// Simulated user registration
console.log('User registered with email:', email);
} else {
// Simulated user login
console.log('User logged in with email:', email);
setLoggedInUser(email); // Set the user's email as the logged-in user
}
};

return (
<div>
<h1>Eve-fests</h1>
{loggedInUser ? (
<div>
<p>Welcome, {loggedInUser}!</p>
<button onClick={() => setLoggedInUser(null)}>Log Out</button>
</div>
) : (
<div>
<h2>{isRegistering ? 'Register' : 'Log In'}</h2>
<input
type="text"
placeholder="Email"
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
<input
type="password"
placeholder="Password"
value={password}
onChange={(e) => setPassword(e.target.value)}
/>
<button onClick={handleAuth}>
{isRegistering ? 'Register' : 'Log In'}
</button>
<p onClick={handleToggleMode}>
{isRegistering ? 'Already have an account? Log in' : 'Don\'t have an account? Register'}
</p>
</div>
)}
</div>
);
}

export default App;
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
# Project Name
Long Description about project. This project do that. This project is awesome...
## Team members
1. Name [Embed personal github URL]
2. Name [Embed perosnal github URL]
1. Bhagyasree Kishore Menon [Embed personal github URL]
2. Arya Krishna [Embed perosnal github URL]
3. Diya Bhatt A [Embed perosnal github URL]
4. Gayatri K B [Embed perosnal github URL]
## Team Id
Team id here
## Link to product walkthrough
Expand Down
3 changes: 3 additions & 0 deletions Reactproject123/Reactapp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
npx create-react-app my-react-app
cd my-react-app
npm start