Skip to content

Commit

Permalink
Merge pull request #288 from UPbrella/release-dev
Browse files Browse the repository at this point in the history
Deploy: Release
  • Loading branch information
ShinChanU authored Dec 19, 2023
2 parents 04ca350 + dbbb8da commit 3067b3a
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/pages/admin/locker/LockerAdminPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,16 @@ const LockerAdminPage = () => {
storesListRes.find((e) => e.id === data.storeMetaId)?.name ?? "잘못된 지점입니다."
}
/>
<Column header="비밀번호" field="secretKey" style={{ minWidth: "120px" }} />
<Column
header="비밀번호"
field="secretKey"
style={{ minWidth: "120px" }}
body={(data: TLockersRes) => (
<div>
{data.secretKey.length > 50 ? data.secretKey.slice(0, 50) + "..." : data.secretKey}
</div>
)}
/>
</CssDataTable>

{/* 모달 */}
Expand Down
12 changes: 12 additions & 0 deletions src/components/pages/admin/locker/LockerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ type TProps = {
selectedLocker?: TLockersRes;
};

const MIN_LOCKER_SECRET_KEY_COUNT = 32;

const LockerModal = ({ isOpen, handleClose, storesListRes, selectedLocker }: TProps) => {
const [storeId, setStoreId] = useState(selectedLocker?.storeMetaId);
const [secretKey, setSecretKey] = useState(selectedLocker?.secretKey);
Expand All @@ -37,6 +39,11 @@ const LockerModal = ({ isOpen, handleClose, storesListRes, selectedLocker }: TPr
return;
}

if (secretKey.length < MIN_LOCKER_SECRET_KEY_COUNT) {
toast.error(`비밀번호는 최소 ${MIN_LOCKER_SECRET_KEY_COUNT}자 이상이여야합니다.`);
return;
}

postMutateLocker(
{ secretKey: secretKey.replace(SECRET_REMOVE_REGEX, ""), storeId },
{
Expand All @@ -55,6 +62,11 @@ const LockerModal = ({ isOpen, handleClose, storesListRes, selectedLocker }: TPr
return;
}

if (secretKey.length < MIN_LOCKER_SECRET_KEY_COUNT) {
toast.error(`비밀번호는 최소 ${MIN_LOCKER_SECRET_KEY_COUNT}자 이상이여야합니다.`);
return;
}

patchMutateLocker(
{
lockerId: selectedLocker.id,
Expand Down
14 changes: 14 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import "@/styles/fonts/font.css";
import { BrowserRouter } from "react-router-dom";
import { ThemeProvider, createTheme } from "@mui/material";
import { Global, css } from "@emotion/react";

const globalStyles = css`
* {
margin: 0;
box-sizing: border-box;
font-family: "Pretendard JP";
}
`;

const theme = createTheme({
typography: {
fontFamily: "Pretendard JP",
},
breakpoints: {
values: {
xs: 0,
Expand All @@ -26,6 +39,7 @@ declare global {
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<BrowserRouter>
<ThemeProvider theme={theme}>
<Global styles={globalStyles} />
<App />
</ThemeProvider>
</BrowserRouter>
Expand Down
26 changes: 26 additions & 0 deletions src/styles/fonts/font.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@font-face {
font-family: "Pretendard JP";
src: url("subset-PretendardJP-Regular.woff2") format("woff2"),
url("subset-PretendardJP-Regular.woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Pretendard JP";
src: url("subset-PretendardJP-Bold.woff2") format("woff2"),
url("subset-PretendardJP-Bold.woff") format("woff");
font-weight: bold;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Pretendard JP";
src: url("subset-PretendardJP-SemiBold.woff2") format("woff2"),
url("subset-PretendardJP-SemiBold.woff") format("woff");
font-weight: 600;
font-style: normal;
font-display: swap;
}
Binary file added src/styles/fonts/subset-PretendardJP-Bold.woff
Binary file not shown.
Binary file added src/styles/fonts/subset-PretendardJP-Bold.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 3067b3a

Please sign in to comment.