Skip to content

Commit

Permalink
Merge pull request #15 from develop-pix/chj950807
Browse files Browse the repository at this point in the history
RENAME: Branch to Photobooth 파일및 폴더명 변경
  • Loading branch information
jsee53 authored Nov 1, 2023
2 parents 6b47b8e + ebf8254 commit 1978699
Show file tree
Hide file tree
Showing 28 changed files with 187 additions and 172 deletions.
12 changes: 6 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import NotFound from "./pages/NotFound";
import Login from "./pages/Login";
import DashBoard from "./pages/Dashboard";
import EventManage from "./pages/EventManage";
import BranchManage from "./pages/BranchManage";
import PhotoboothManage from "./pages/PhotoboothManage";
import ReviewManage from "./pages/ReviewManage";
import UserManage from "./pages/UserManage";
import PushMessage from "./pages/PushMessage";
import { ThemeProvider, createTheme } from "@mui/material";
import EventNew from "./pages/EventNew";
import EventEdit from "./pages/EventEdit";
import BrnachNew from "./pages/BranchNew";
import BranchEdit from "./pages/BranchEdit";
import PhotoboothNew from "./pages/PhotoboothNew";
import PhotoboothEdit from "./pages/PhotoboothEdit";

const theme = createTheme({
typography: {
Expand All @@ -28,9 +28,9 @@ function App() {
<Route path="/event" element={<EventManage />}></Route>
<Route path="/event/new" element={<EventNew />}></Route>
<Route path="/event/edit/:id" element={<EventEdit />}></Route>
<Route path="/branch/new" element={<BrnachNew />}></Route>
<Route path="/branch/edit/:id" element={<BranchEdit />}></Route>
<Route path="/branch" element={<BranchManage />}></Route>
<Route path="/branch/new" element={<PhotoboothNew />}></Route>
<Route path="/branch/edit/:id" element={<PhotoboothEdit />}></Route>
<Route path="/branch" element={<PhotoboothManage />}></Route>
<Route path="/user" element={<UserManage />}></Route>
<Route path="/pushmessage" element={<PushMessage />}></Route>
<Route path="/review" element={<ReviewManage />}></Route>
Expand Down
4 changes: 2 additions & 2 deletions src/components/event-manage/EventManage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box } from "@mui/material";
import Table from "../reuse/table/Table";
import TableForm from "../reuse/table/TableForm";
import { customColors } from "../../styles/base/Variable.style";
import { EventTableColumn } from "../../interface/EventManage.interface";
import { useState } from "react";
Expand Down Expand Up @@ -219,7 +219,7 @@ export default function EventManage() {
<AddButton />
</Box>
</Box>
<Table
<TableForm
columns={tablecolumns}
rows={tablerows}
page={page}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { useNavigate } from "react-router-dom";
import { customColors } from "../../styles/base/Variable.style";
import CancelButton from "../reuse/button/CancelButton";
import SubmitButton from "../reuse/button/SubmitButton";
import BranchEditInputForm from "./BranchEditInputForm";
import PhotoboothEditInputForm from "./PhotoboothEditInputForm";

export default function BranchEdit() {
export default function PhotoboothhEdit() {
const [photoboothName, setPhotoboothName] = useState<string>("");
const [image, setImage] = useState<string[]>([]);
const [hashtag, setHashtag] = useState<string[]>([]);
Expand Down Expand Up @@ -65,7 +65,7 @@ export default function BranchEdit() {
<SubmitButton value={"수정"} />
</Box>
</Box>
<BranchEditInputForm
<PhotoboothEditInputForm
photoboothName={photoboothName}
setPhotoboothName={setPhotoboothName}
image={image}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Box } from "@mui/material";
import SideBar from "../reuse/sidebar/SideBar";
import BrnachNew from "./BranchNew";
import PhotoboothhEdit from "./PhotoboothEdit";

export default function BrnachNewForm() {
export default function PhotoboothEditForm() {
return (
<Box sx={{ display: "flex" }}>
<SideBar />
<BrnachNew />
<PhotoboothhEdit />
</Box>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ import { useEffect } from "react";
import { customColors } from "../../styles/base/Variable.style";
import { Box, Typography, TextField } from "@mui/material";
import MultiFileInput from "../reuse/input/MultiFileInput";
import BranchHashTags from "../branch-new/BranchHashTags";
import { BranchEditInputFormProps } from "../../interface/BranchEdit.interface";
import PhotoboothHashTags from "../photobooth-new/PhotoboothHashTags";
import { PhotoboothEditInputFormProps } from "../../interface/PhotoboothEdit.interface";
import { useLocation } from "react-router-dom";

export default function BranchEditInputForm({
export default function PhotoboothEditInputForm({
photoboothName,
setPhotoboothName,
image,
setImage,
hashtag,
setHashtag,
}: BranchEditInputFormProps) {
}: PhotoboothEditInputFormProps) {
const location = useLocation().pathname.split("/");

const GetEditData = (currentID: string) => {
Expand Down Expand Up @@ -202,7 +202,7 @@ export default function BranchEditInputForm({
>
해시태그
</Typography>
<BranchHashTags hashtag={hashtag} setHashtag={setHashtag} />
<PhotoboothHashTags hashtag={hashtag} setHashtag={setHashtag} />
</Box>
</Box>
</Box>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Box } from "@mui/material";
import Table from "../reuse/table/Table";
import TableForm from "../reuse/table/TableForm";
import { customColors } from "../../styles/base/Variable.style";
import { BranchTableColumn } from "../../interface/BranchManage.interface";
import { PhotoboothTableColumn } from "../../interface/PhotoboothManage.interface";
import { useState } from "react";
import SearchInput from "../reuse/input/SearchInput";
import AddButton from "../reuse/button/AddButton";
import EditButton from "../reuse/button/EditButton";
import DeleteButton from "../reuse/button/DeleteButton";

export default function EventManage() {
export default function PhotoboothManage() {
const [search, setSearch] = useState<string>("");
const [page, setPage] = useState<number>(0);

/* 표 제목 및 포맷 설정 */
const tablecolumns: BranchTableColumn[] = [
const tablecolumns: PhotoboothTableColumn[] = [
{ id: "name", label: "포토부스명", minWidth: 120 },
{
id: "image",
Expand Down Expand Up @@ -93,7 +93,7 @@ export default function EventManage() {
<AddButton />
</Box>
</Box>
<Table
<TableForm
columns={tablecolumns}
rows={tablerows}
page={page}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import SideBar from "../reuse/sidebar/SideBar";
import Box from "@mui/material/Box";
import BranchManage from "./BranchManage";
import PhotoboothManage from "./PhotoboothManage";

// 포토부스 관리 페이지
export default function BranchManageForm() {
export default function PhotoboothManageForm() {
return (
<Box sx={{ display: "flex" }}>
<SideBar />
<BranchManage />
<PhotoboothManage />
</Box>
);
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { Box, TextField, Typography } from "@mui/material";
import { BranchHashTagProps } from "../../interface/BranchNew.interface";
import { PhotoboothHashTagProps } from "../../interface/PhotoboothNew.interface";

export default function BranchHashTags({
export default function PhotoboothHashTags({
hashtag,
setHashtag,
}: BranchHashTagProps) {
const handleHashTagChange = (index: number, value: string) => {
}: PhotoboothHashTagProps) {
const handleHashTagChange = (
e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,
index: number
) => {
e.preventDefault();
const updatedHashtags = [...hashtag];
updatedHashtags[index] = value;
updatedHashtags[index] = e.target.value;
setHashtag(updatedHashtags);
};

Expand All @@ -23,8 +27,8 @@ export default function BranchHashTags({
<TextField
label={`해시태그`}
variant="outlined"
value={hashtag[index]}
onChange={(e) => handleHashTagChange(index, e.target.value)}
value={hashtag[index] ? hashtag[index] : ""}
onChange={(e) => handleHashTagChange(e, index)}
/>
</Box>
))}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { Box, Typography, TextField } from "@mui/material";
import { customColors } from "../../styles/base/Variable.style";
import { BranchInputFormProps } from "../../interface/BranchNew.interface";
import BranchHashTags from "./BranchHashTags";
import { PhotoboothInputFormProps } from "../../interface/PhotoboothNew.interface";
import PhotoboothHashTags from "./PhotoboothHashTags";
import MultiFileInput from "../reuse/input/MultiFileInput";

export default function BranchInputForm({
export default function PhotoboothInputForm({
photoboothName,
setPhotoboothName,
image,
setImage,
hashtag,
setHashtag,
}: BranchInputFormProps) {
}: PhotoboothInputFormProps) {
return (
<Box
sx={{
Expand Down Expand Up @@ -70,7 +70,7 @@ export default function BranchInputForm({
>
해시태그
</Typography>
<BranchHashTags hashtag={hashtag} setHashtag={setHashtag} />
<PhotoboothHashTags hashtag={hashtag} setHashtag={setHashtag} />
</Box>
</Box>
</Box>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Box } from "@mui/material";
import { customColors } from "../../styles/base/Variable.style";
import BranchInputForm from "./BranchInputForm";
import PhotoboothInputForm from "./PhotoboothInputForm";
import { useState } from "react";
import CancelButton from "../reuse/button/CancelButton";
import SubmitButton from "../reuse/button/SubmitButton";
import { useNavigate } from "react-router-dom";

export default function BrnachNew() {
export default function PhotoboothNew() {
const [photoboothName, setPhotoboothName] = useState<string>("");
const [image, setImage] = useState<string[]>([]);
const [hashtag, setHashtag] = useState<string[]>([]);
Expand Down Expand Up @@ -69,7 +69,7 @@ export default function BrnachNew() {
<SubmitButton value="등록" />
</Box>
</Box>
<BranchInputForm
<PhotoboothInputForm
photoboothName={photoboothName}
setPhotoboothName={setPhotoboothName}
image={image}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Box } from "@mui/material";
import SideBar from "../reuse/sidebar/SideBar";
import BranchEdit from "./BranchEdit";
import PhotoboothNew from "./PhotoboothNew";

export default function BranchEditForm() {
export default function PhotoboothNewForm() {
return (
<Box sx={{ display: "flex" }}>
<SideBar />
<BranchEdit />
<PhotoboothNew />
</Box>
);
}
6 changes: 4 additions & 2 deletions src/components/reuse/sidebar/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export default function SideBar() {

// url이 변경될 때마다 /이후 첫번째 인자를 선택된 인덱스로 저장
useEffect(() => {
setSelectedIndex(location.pathname.split("/").filter((item) => item !== "")[0]);
setSelectedIndex(
location.pathname.split("/").filter((item) => item !== "")[0]
);
}, [location]);

const handleListClick = (index: string) => {
Expand Down Expand Up @@ -46,7 +48,7 @@ export default function SideBar() {
/>
<SideBarListItem
url="/branch"
text="지점 관리"
text="포토부스 관리"
selectedIndex={selectedIndex}
handleListClick={handleListClick}
/>
Expand Down
86 changes: 0 additions & 86 deletions src/components/reuse/table/Table.tsx

This file was deleted.

Loading

0 comments on commit 1978699

Please sign in to comment.