Skip to content

Commit

Permalink
resolved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
NancyAanchal committed Jul 12, 2024
1 parent 5da46ca commit a8cf67e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
3 changes: 3 additions & 0 deletions nepalingo-web/pnpm-lock.yaml

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

2 changes: 0 additions & 2 deletions nepalingo-web/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React, { useState, useEffect } from "react";
import {
BrowserRouter as Router,
Route,
Expand All @@ -7,7 +6,6 @@ import {
} from "react-router-dom";
import User_auth from "./components/userAuth/UserAuth";
import Home from "./pages/Home/Home";
import supabase from "./components/userAuth/supabaseClient";
import { useAuth } from "./components/userAuth/AuthContext";
import ReactGA from "react-ga4";

Expand Down
14 changes: 4 additions & 10 deletions nepalingo-web/src/components/userAuth/UserAuth.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useState } from "react";
import supabase from "./supabaseClient";
import { useNavigate } from "react-router-dom";
import { useAuth } from "./AuthContext";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
Expand All @@ -10,10 +9,10 @@ import {
faEye,
faEyeSlash,
} from "@fortawesome/free-solid-svg-icons";
//import ReactGA from "react-ga4";
import ReactGA from "react-ga4";

const User_auth: React.FC = () => {
//ReactGA.send({ hitType: "pageview", page: "/login", title: "login" });
ReactGA.send({ hitType: "pageview", page: "/login", title: "login" });
const [action, setAction] = useState<"Sign Up" | "Log In">("Sign Up");
const [username, setUsername] = useState("");
const [email, setEmail] = useState("");
Expand All @@ -35,28 +34,23 @@ const User_auth: React.FC = () => {
}

if (action === "Sign Up" && username != "") {
// Attempt to sign up the user with the provided email and password
const { error } = await supabase.auth.signUp({
const { error } = await signUp({
email,
password,
options: {
data: {
// Store the username in the user metadata
username: username,
},
},
});

if (error) {
// If there is an error during sign up, set the error message
setError(error.message);
} else {
// If sign up is successful, set success to true
setSuccess(true);
}
} else {
// Attempt to log in the user with the provided email and password
const { data, error } = await supabase.auth.signInWithPassword({
const { error } = await signIn({
email,
password,
});
Expand Down
1 change: 0 additions & 1 deletion nepalingo-web/src/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import { useLocation } from "react-router-dom";
import logo from "../../assets/logo.png";
import { useAuth } from "../../components/userAuth/AuthContext";
import ReactGA from "react-ga4";
Expand Down

0 comments on commit a8cf67e

Please sign in to comment.