This commit is contained in:
29
src/components/DefaultModal.jsx
Normal file
29
src/components/DefaultModal.jsx
Normal file
@ -0,0 +1,29 @@
|
||||
import React, { useState, useEffect, useContext } from "react";
|
||||
import classes from "../assets/styles/components/defaultModal.module.scss";
|
||||
import MyButton from "./MyButton.jsx";
|
||||
|
||||
|
||||
const DefaultModal = ({
|
||||
name,
|
||||
postfix,
|
||||
btn,
|
||||
BodyModal
|
||||
}) => {
|
||||
|
||||
return (
|
||||
<div class="modal fade myModal" className={classes.main} id={`${name}`} tabIndex="-1" aria-labelledby="exampleModalLabel" data-bs-backdrop="static" aria-hidden="true">
|
||||
<div class="modal-dialog myModal__dialog" className={classes.main__dialog}>
|
||||
<div class="modal-content" className={classes.main__dialog__content}>
|
||||
{BodyModal}
|
||||
<div class="modal-footer myModal__dialog__content__footer" className={classes.myModal__dialog__content__footer}>
|
||||
{btn.map(((item, i) =>
|
||||
<MyButton text={item.text} dismiss={item.dismiss} class={item.class} click={item.action} key={i}/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default DefaultModal;
|
@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import classes from "../assets/styles/components/myInput.module.scss"
|
||||
import classes from "../assets/styles/components/myInput.module.scss";
|
||||
|
||||
const MyInput = (props) => {
|
||||
return (
|
||||
|
133
src/components/bodyModal/EditUserAdminPanel.jsx
Normal file
133
src/components/bodyModal/EditUserAdminPanel.jsx
Normal file
@ -0,0 +1,133 @@
|
||||
import React, {useState} from "react";
|
||||
import classes from "../../assets/styles/components/bodyModal/editUserAdminPanel.module.scss";
|
||||
import MyInput from "../../components/MyInput.jsx";
|
||||
|
||||
|
||||
const EditUserAdminPanel = ({
|
||||
id,
|
||||
email,
|
||||
firstName,
|
||||
isAdmin,
|
||||
isTeacher,
|
||||
lastName,
|
||||
login,
|
||||
phone,
|
||||
setEmail,
|
||||
setFirstName,
|
||||
setIsAdmin,
|
||||
setIsTeacher,
|
||||
setLastName,
|
||||
setLogin,
|
||||
setPhone,
|
||||
}) => {
|
||||
|
||||
console.log('228', id, isAdmin, isAdmin)
|
||||
|
||||
return (
|
||||
<div className={classes.main}>
|
||||
<MyInput
|
||||
type={"text"}
|
||||
value={login}
|
||||
placeholder={"Логин"}
|
||||
change={setLogin}
|
||||
otherMainStyle={{width: "100%", height: "100%", marginTop: "1%"}}
|
||||
otherInputStyle={{width: "100%", height: "10%"}}
|
||||
/>
|
||||
<MyInput
|
||||
type={"text"}
|
||||
value={phone}
|
||||
placeholder={"Телефон"}
|
||||
change={setPhone}
|
||||
otherMainStyle={{width: "100%", height: "100%", marginTop: "1%"}}
|
||||
otherInputStyle={{width: "100%", height: "10%"}}
|
||||
/>
|
||||
<MyInput
|
||||
type={"text"}
|
||||
value={firstName}
|
||||
placeholder={"Имя"}
|
||||
change={setFirstName}
|
||||
otherMainStyle={{width: "100%", height: "100%", marginTop: "1%"}}
|
||||
otherInputStyle={{width: "100%", height: "10%"}}
|
||||
/>
|
||||
<MyInput
|
||||
type={"text"}
|
||||
value={lastName}
|
||||
placeholder={"Фамилия"}
|
||||
change={setLastName}
|
||||
otherMainStyle={{width: "100%", height: "100%", marginTop: "1%"}}
|
||||
otherInputStyle={{width: "100%", height: "10%"}}
|
||||
/>
|
||||
<MyInput
|
||||
type={"text"}
|
||||
value={email}
|
||||
placeholder={"email"}
|
||||
change={setEmail}
|
||||
otherMainStyle={{width: "100%", height: "100%", marginTop: "1%"}}
|
||||
otherInputStyle={{width: "100%", height: "10%"}}
|
||||
/>
|
||||
<div className={classes.main__status}>
|
||||
<div className={classes.main__status__admin}>
|
||||
<div className={classes.main__status__admin__text}>Администратор</div>
|
||||
<div className={classes.main__status__admin__checkbox}>
|
||||
<div class="form-check">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="radio"
|
||||
name="admin"
|
||||
id="choiceYes"
|
||||
value="1"
|
||||
checked={isAdmin}
|
||||
onChange={() => setIsAdmin(true)}
|
||||
/>
|
||||
<label class="form-check-label" for="choiceYes">Да</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="radio"
|
||||
name="admin"
|
||||
id="choiceNo"
|
||||
value="2"
|
||||
checked={!isAdmin}
|
||||
onChange={() => setIsAdmin(false)}
|
||||
/>
|
||||
<label class="form-check-label" for="choiceNo">Нет</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className={classes.main__status__teacher}>
|
||||
<div className={classes.main__status__admin__text}>Учитель</div>
|
||||
<div className={classes.main__status__admin__checkbox}>
|
||||
<div class="form-check">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="radio"
|
||||
name="teacher"
|
||||
id="choiceYes"
|
||||
value="1"
|
||||
checked={isTeacher}
|
||||
onChange={() => setIsTeacher(true)}
|
||||
/>
|
||||
<label class="form-check-label" for="choiceYes">Да</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="radio"
|
||||
name="teacher"
|
||||
id="choiceNo"
|
||||
value="2"
|
||||
checked={!isTeacher}
|
||||
onChange={() => setIsTeacher(false)}
|
||||
/>
|
||||
<label class="form-check-label" for="choiceNo">Нет</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default EditUserAdminPanel;
|
Reference in New Issue
Block a user