Skip to content

Commit

Permalink
hoantatdangki
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanh2003 committed Oct 23, 2023
1 parent 2351108 commit e4e050e
Show file tree
Hide file tree
Showing 10 changed files with 282 additions and 79 deletions.
6 changes: 3 additions & 3 deletions CNPMNC_2023/src/Admin/CRUD_User/ModalEditUser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React, { Component } from 'react';

import { Button,Modal,ModalHeader,ModalBody,ModalFooter } from 'reactstrap';
import {toast} from "react-toastify";

import "./ModalUser.scss";
import _ from 'lodash';
import { Buffer } from 'buffer';
Expand Down Expand Up @@ -110,7 +110,7 @@ class ModalEditUser extends Component {
if(isValid==true){

this.props.editUser(this.state);
toast.success("Sửa thành công !")




Expand Down Expand Up @@ -145,7 +145,7 @@ class ModalEditUser extends Component {

render() {

console.log("hinhne",this.state);

return (


Expand Down
6 changes: 3 additions & 3 deletions CNPMNC_2023/src/Admin/CRUD_User/ModalUser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ModalUser extends Component {
email:'',
roleId: 'R1',
avatar:'',
previewImgURL:"",
previewImgURL:" ",



Expand All @@ -41,7 +41,7 @@ class ModalUser extends Component {
email:'',
roleId: 'R1',
avatar:'',
previewImgURL:"",
previewImgURL:" ",
})
});

Expand Down Expand Up @@ -129,7 +129,7 @@ class ModalUser extends Component {

render() {

console.log("usernaemdau:",this.state);

return (
<Modal isOpen={this.props.isOpen}
toggle={()=>{this.toggle()}}
Expand Down
20 changes: 12 additions & 8 deletions CNPMNC_2023/src/Admin/CRUD_User/UserManage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ class UserManage extends Component {
toast.error("Xóa thất bại")
}else{
await this.getAllUserFromReact();
toast.success("Xóa Thành công")
toast.success("Xóa Thành công");




Expand All @@ -112,15 +113,18 @@ class UserManage extends Component {
doEditUser=async(user)=>{
try {
let res= await editUserService(user);
if(res && res.errcode==0){
if(res && res.errcode!==0){
await this.getAllUserFromReact();
toast.success("Sửa Thành công")
this.setState({
isOpenModalEditUser:false
})
await this.getAllUserFromReact();
toast.error("Sửa Thất bại")



}
else{

toast.error("Sửa Thất bại")
}

} catch (e) {
Expand All @@ -139,7 +143,7 @@ class UserManage extends Component {
*/

render() {
console.log('check render',this.state)

let arrUsers=this.state.arrUsers;

return (
Expand Down Expand Up @@ -183,9 +187,9 @@ class UserManage extends Component {

{
arrUsers&&arrUsers.map((item,index)=>{
console.log('tanh check map',item,index)

return(
<tr>
<tr key={index}>
<td>{item.taikhoan}</td>
<td>{item.fullName}</td>
<td>{item.address}</td>
Expand Down
4 changes: 2 additions & 2 deletions CNPMNC_2023/src/Admin/Components/SidebarAdmin.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Nav, NavDropdown } from 'react-bootstrap';
import 'bootstrap/dist/css/bootstrap.min.css';

import { Link } from "react-router-dom";

const SidebarAdmin = () => {
return (
Expand All @@ -22,7 +22,7 @@ const SidebarAdmin = () => {
<span style={{ display: 'flex', alignItems: 'center' }}>
<i className="fas fa-list-ul" style={{ marginRight: '5px' }}></i>
<span className="ml-0"> <NavDropdown title="Danh sách" className='text-secondary'>
<NavDropdown.Item href="list chuyen di" className='text-secondary '><i className="fas fa-book-reader text-secondary mr-3"></i>Danh sách chuyến đi </NavDropdown.Item>
<NavDropdown.Item href="list chuyen di" className='text-secondary '><i className="fas fa-book-reader text-secondary mr-3"></i> <Link to="/admin"><span>Danh sách chuyến đi</span></Link> </NavDropdown.Item>
<NavDropdown.Item href="list nguoi dung" className='text-secondary '><i className="fas fa-book-medical text-secondary mr-3"></i>Danh sách người dùng</NavDropdown.Item>
</NavDropdown></span>
</span>
Expand Down
16 changes: 14 additions & 2 deletions CNPMNC_2023/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function App() {
shopItems={shopItems}

/>

<Footer />
</Route>
<Route path="/login-signup/Login" exact>
<Login />
Expand Down Expand Up @@ -155,7 +155,19 @@ function App() {
</Route>

</Switch>
<Footer />
<ToastContainer
position="bottom-right"
autoClose={5000}
hideProgressBar={false}
newestOnTop={false}
closeOnClick
rtl={false}
pauseOnFocusLoss
draggable
pauseOnHover
theme="colored"
/>

</Router>
</div>

Expand Down
18 changes: 15 additions & 3 deletions CNPMNC_2023/src/pages/login-signup/Login.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import React from "react";
import "./LoginSignup.css";
import React, { useState } from 'react';
import "./LoginSignup.scss";
import { Link } from "react-router-dom";
export const Login = () => {





const [isShowPassword, setIsShowPassword] = useState(false);
const handleShowHidePassword = () => {
setIsShowPassword(!isShowPassword);
};
return (
<>
<div className="loginsignup">
Expand All @@ -13,7 +22,10 @@ export const Login = () => {
<label>Tài khoản </label>
</div>
<div className="input-data">
<input type="password" required />
<input type={isShowPassword ? 'text' : 'password'} required />
<span onClick={handleShowHidePassword}>
<i className={isShowPassword ? 'fas fa-eye' : 'fas fa-eye-slash'}></i>
</span>
<div className="underline"></div>
<label>Mật khẩu </label>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@
border: none;
cursor: pointer;
}

.input-data {
height: 65px;
width: 100%;
position: relative;
margin-top: 30px;
}

.input-data input {
height: 100%;
width: 100%;
Expand All @@ -72,7 +74,16 @@
outline: none;
color: #5c5c5c;
border: 1px solid #c9c9c9;
position: relative; /* Đặt vị trí là tương đối */
}

.input-data span {
position: absolute;
margin-left: -40px;
margin-top: 20px;
/* Sử dụng top và left để điều chỉnh vị trí của span trong input */
}

.input-data input:focus ~ label,
.input-data input:valid ~ label {
transform: translateY(-40px);
Expand Down
Loading

0 comments on commit e4e050e

Please sign in to comment.