Merge branch 'main' into feature/dashboard

This commit is contained in:
Sirin Puenggun 2023-11-23 05:04:33 +07:00 committed by GitHub
commit 050def4b26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 34 additions and 32 deletions

View File

@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react";
import { useState, useEffect } from "react";
import { FiAlertCircle, FiClock, FiXCircle, FiCheckCircle } from "react-icons/fi";
import { readTodoTasks } from "../../api/TaskApi";
import axiosInstance from "src/api/AxiosConfig";

View File

@ -1,4 +1,4 @@
import React, { useState, useRef } from "react";
import { useState, useRef } from "react";
import { ApiUpdateUserProfile } from "../api/UserProfileApi";
function ProfileUpdateComponent() {
@ -15,7 +15,7 @@ function ProfileUpdateComponent() {
}
};
const handleFileChange = e => {
const handleFileChange = (e) => {
const selectedFile = e.target.files[0];
if (selectedFile) {
setFile(selectedFile);
@ -66,7 +66,7 @@ function ProfileUpdateComponent() {
placeholder="Enter your username"
className="input w-full"
value={username}
onChange={e => setUsername(e.target.value)}
onChange={(e) => setUsername(e.target.value)}
/>
</div>
@ -78,7 +78,7 @@ function ProfileUpdateComponent() {
placeholder="Enter your full name"
className="input w-full"
value={fullName}
onChange={e => setFullName(e.target.value)}
onChange={(e) => setFullName(e.target.value)}
/>
</div>
@ -89,7 +89,7 @@ function ProfileUpdateComponent() {
placeholder="Tell us about yourself"
className="textarea w-full h-32"
value={about}
onChange={e => setAbout(e.target.value)}
onChange={(e) => setAbout(e.target.value)}
/>
</div>

View File

@ -4,9 +4,12 @@ import axiosapi from "../../api/AuthenticationApi";
import { FcGoogle } from "react-icons/fc";
import { useGoogleLogin } from "@react-oauth/google";
import { NavPreLogin } from "../navigations/NavPreLogin";
import { useAuth } from "src/hooks/AuthHooks";
export default function SignUp() {
const Navigate = useNavigate();
const { setIsAuthenticated } = useAuth();
const [formData, setFormData] = useState({
email: "",

View File

@ -1,4 +1,3 @@
import * as React from "react";
import ProfileUpdateComponent from "./ProfileUpdateComponent";
function ProfileUpdatePage() {
@ -47,7 +46,7 @@ function ProfileUpdatePage() {
</div>
</div>
<div className="stat-desc py-2">3213/321312321 points</div>
<progress class="progress progress-info w-36" value="10" max="100"></progress>
<progress className="progress progress-info w-36" value="10" max="100"></progress>
</div>
<div className="stat">
@ -75,10 +74,10 @@ function ProfileUpdatePage() {
</div>
<div className="card bg-base-100 shadow">
<div class="card-body">
<h2 class="card-title">About me</h2>
<div class="card-actions justify-end"></div>
<textarea class="textarea textarea-bordered textarea-lg w-full" disabled>
<div className="card-body">
<h2 className="card-title">About me</h2>
<div className="card-actions justify-end"></div>
<textarea className="textarea textarea-bordered textarea-lg w-full" disabled>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nostrum dolores recusandae, officiis consequuntur
nam, non ab commodi totam mollitia iusto nemo voluptatum error aliquam similique perspiciatis, eligendi
nulla. Animi, sit?
@ -89,31 +88,31 @@ function ProfileUpdatePage() {
<div className="grid grid-cols-2 grid-rows-2 gap-4 my-2">
<div className="col-span-full">
<div className="card bg-base-100 shadow">
<div class="card-body">
<h2 class="card-title">Overall Statistics</h2>
<div class="card-actions justify-end"></div>
<div className="card-body">
<h2 className="card-title">Overall Statistics</h2>
<div className="card-actions justify-end"></div>
</div>
</div>
</div>
<div className="col-start-2 row-start-2">
<div className="card bg-base-100 shadow">
<div class="card-body">
<h2 class="card-title">Achievements</h2>
<div class="card-actions justify-end"></div>
<div className="card-body">
<h2 className="card-title">Achievements</h2>
<div className="card-actions justify-end"></div>
</div>
</div>
</div>
<div className="col-start-1 row-start-2">
<div className="card bg-base-100 shadow">
<div class="card-body">
<h2 class="card-title">Friends</h2>
<div class="card-actions justify-end"></div>
<div className="card-body">
<h2 className="card-title">Friends</h2>
<div className="card-actions justify-end"></div>
</div>
</div>
</div>
</div>
<div class="fixed bottom-4 right-4">
<div className="fixed bottom-4 right-4">
<ul className="menu menu-horizontal bg-base-200 rounded-box">
<li>
<a onClick={() => document.getElementById("my_modal_4").showModal()}>
@ -136,7 +135,7 @@ function ProfileUpdatePage() {
<div className="modal-box w-11/12 max-w-5xl flex flex-col">
<form method="dialog">
<ProfileUpdateComponent />
<button class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2"></button>
<button className="btn btn-sm btn-circle btn-ghost absolute right-2 top-2"></button>
</form>
</div>
</dialog>

View File

@ -1,4 +1,4 @@
import React, { useState } from "react";
import { useState } from "react";
import axiosapi from "../api/axiosapi";
import TextField from "@material-ui/core/TextField";
import Typography from "@material-ui/core/Typography";
@ -7,7 +7,7 @@ import Container from "@material-ui/core/Container";
import Button from "@material-ui/core/Button";
import { makeStyles } from "@material-ui/core/styles";
const useStyles = makeStyles(theme => ({
const useStyles = makeStyles((theme) => ({
// Styles for various elements
paper: {
marginTop: theme.spacing(8),
@ -38,7 +38,7 @@ const Signup = () => {
const [error, setError] = useState(null);
const [isSubmitting, setIsSubmitting] = useState(false);
const handleSubmit = async e => {
const handleSubmit = async (e) => {
e.preventDefault();
setIsSubmitting(true);
setError(null);
@ -53,7 +53,7 @@ const Signup = () => {
}
};
const handleChange = e => {
const handleChange = (e) => {
const { name, value } = e.target;
setFormData({ ...formData, [name]: value });
};

View File

@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react";
import { useState, useEffect } from "react";
import axiosapi from "../api/AuthenticationApi";
import { Button } from "@mui/material";
import { useNavigate } from "react-router-dom";
@ -12,11 +12,11 @@ function TestAuth() {
// Fetch the "hello" data from the server when the component mounts
axiosapi
.getGreeting()
.then(res => {
.then((res) => {
console.log(res.data);
setMessage(res.data.user);
})
.catch(err => {
.catch((err) => {
console.log(err);
setMessage("");
});
@ -32,14 +32,14 @@ function TestAuth() {
<div>
{message !== "" && (
<div>
<h1 class="text-xl font-bold">Login! Hello!</h1>
<h1 className="text-xl font-bold">Login! Hello!</h1>
<h2>{message}</h2>
<Button variant="contained" onClick={logout}>
Logout
</Button>
</div>
)}
{message === "" && <h1 class="text-xl font-bold">Need to sign in, No authentication found</h1>}
{message === "" && <h1 className="text-xl font-bold">Need to sign in, No authentication found</h1>}
</div>
);
}