Skip to content

Commit

Permalink
feat: 초대 대기자 상태관리 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
seoyoung7623 committed Jun 2, 2023
1 parent 37a2aba commit 5f050e3
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/pages/company/inCompany/CompanyInvite.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import LeftMenuCeo from "components/LeftMenuCeo";
import { useEffect, useState } from "react";

import "../../../style/company/company.scss";
import { useSelector } from "react-redux";

const CompanyInvite = () => {
const [userEmail, setUserEmail] = useState("");
Expand All @@ -25,6 +26,7 @@ const CompanyInvite = () => {
state: "거절",
},
];
const alba_waitlist = useSelector((state) => state.alba_waitlist);
useEffect(() => {}, [invite_user]);

const validateEmail = (input) => {
Expand Down Expand Up @@ -59,11 +61,11 @@ const CompanyInvite = () => {
<h2>알바생 초대</h2>
</div>
<div className="main">
<h3>
{/* <h3>
초대할 알바생의 <b>email 주소</b>를 입력하세요.
</h3>
</h3> */}
<div className="emailform">
<div className="email-wrapper">
{/* <div className="email-wrapper">
<input
type="email"
value={userEmail}
Expand All @@ -72,9 +74,9 @@ const CompanyInvite = () => {
}}
placeholder="ex) [email protected] ..."
/>
</div>
</div> */}
<div className="btn-wrapper">
<button onClick={handlesubmit}>초대하기</button>
<button>초대하기</button>
</div>
</div>
</div>
Expand All @@ -83,13 +85,13 @@ const CompanyInvite = () => {
<h2>초대 대기 목록</h2>
</div>
<div className="waitlist-wrapper">
{invite_user.map((user) => (
{alba_waitlist.map((user) => (
<div className="waitlist-main">
<div className="waitlist-set">
<div className="waitlist-things">
<div className="name waitlist-one">
<label className="value">이름</label>
<label>{user.name}</label>
<label>{user.user_name}</label>
</div>
<div className="email waitlist-one">
<label className="value">이메일</label>
Expand Down
32 changes: 32 additions & 0 deletions src/redux-toolkit/albaModule/AlbaWaitListSlice.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { createSlice } from "@reduxjs/toolkit";

// 수정 필요
let nextId = 0;
const initialValue = [
{
alba_id: 0,
company_id: 1,
user_id: 0,
user_name: "김민규",
email: "[email protected]",
code: "24DW4Y89",
state: "대기",
},
{
alba_id: 1,
company_id: 1,
user_id: 1,
user_name: "윤서영",
email: "[email protected]",
code: "DE32S5DU",
state: "거절",
},
];

export const albaWaitListSlice = createSlice({
name: "alba_waitlist",
initialState: initialValue,
reducers: {},
});

export default albaWaitListSlice.reducer;
2 changes: 2 additions & 0 deletions src/redux-toolkit/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { albaCompanyListSlice } from "./albaModule/AlbaCompanyListReducer";
import { AlbaContractSlice } from "./albaModule/AlbaContractSlice";
import { AlbaRecordListSlice } from "./albaModule/AlbaRecordListSlice";
import { AlbaAttendance } from "./albaModule/AlbaAttendance";
import { albaWaitListSlice } from "./albaModule/AlbaWaitListSlice";

const store = configureStore({
reducer: {
Expand All @@ -17,6 +18,7 @@ const store = configureStore({
alba_contract: AlbaContractSlice.reducer,
alba_record: AlbaRecordListSlice.reducer,
alba_attendance: AlbaAttendance.reducer,
alba_waitlist: albaWaitListSlice.reducer,
},
});

Expand Down

0 comments on commit 5f050e3

Please sign in to comment.