Skip to content

Commit 2ab8bdd

Browse files
authored
Merge pull request Next-Room#86 from Next-Room/feat/hint-qa-rin
2 parents 4e1b8f2 + b3fd86f commit 2ab8bdd

File tree

7 files changed

+12
-8
lines changed

7 files changed

+12
-8
lines changed

app/admin/(components)/Sidebar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export default function Sidebar(props: Props) {
6262
const navigateToNewTheme = () => {
6363
resetSelectedTheme();
6464
router.push("/admin");
65+
setDrawer({ ...drawer, isOpen: false });
6566
};
6667
const handleSelectTheme = (theme: Theme) => {
6768
if (drawer.isOpen && !drawer.isSameHint) {
@@ -134,7 +135,7 @@ export default function Sidebar(props: Props) {
134135
</button>
135136
</li>
136137
</ul>
137-
{!status?.includes("SUBSCRIPTION") && (
138+
{!(status?.replaceAll(`"`, "") === "SUBSCRIPTION") && (
138139
<div className="sidebar__subscribe">
139140
<p className="sidebar__subscribe-title">
140141
구독하고 힌트에 사진을 추가해 보세요

app/admin/(components)/ThemeDrawer/hooks/useImages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const useImages = ({
100100
};
101101

102102
const handleAddImageBtnClick = (e: MouseEvent<HTMLButtonElement>) => {
103-
if (!status?.includes("SUBSCRIPTION")) {
103+
if (!(status?.replaceAll(`"`, "") === "SUBSCRIPTION")) {
104104
e.preventDefault();
105105
window.open(subscribeLinkURL, "_blank", "noopener,noreferrer");
106106
return;

app/admin/(style)/admin.modules.sass

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
border-radius: 8px
131131

132132
.content-area
133+
margin: 0 auto
133134
flex-grow: 1
134135
flex-shrink: 1
135136
overflow-x: hidden

app/components/common/Hint-Dialog-new/Dialog.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ const Dialog = forwardRef<HTMLFormElement, DialogProps>((props) => {
4747
if (type === "put") {
4848
fn();
4949
close();
50-
setDrawer({ ...drawer, isOpen: false });
5150
} else if (type === "delete") {
5251
deleteHint({ id });
5352
close();

app/queries/getPreSignedUrl.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const useHintUpload = () => {
8484
PreSignedUrlRequest
8585
>({
8686
mutationFn: async (params) => {
87-
if (status?.includes("SUBSCRIPTION")) {
87+
if (status?.replaceAll(`"`, "") === "SUBSCRIPTION") {
8888
return getPreSignedUrl(params);
8989
}
9090
return {
@@ -119,11 +119,14 @@ const useHintUpload = () => {
119119
HintData
120120
>({
121121
mutationFn: (data) => (data.id > 0 ? putHint(data) : postHint(data)),
122-
onSuccess: () => {
122+
onSuccess: (data) => {
123123
queryClient.invalidateQueries(QUERY_KEY);
124124
setToast({
125125
isOpen: true,
126-
title: "힌트가 성공적으로 등록되었습니다.",
126+
title:
127+
data.config.method === "put"
128+
? "힌트를 수정했습니다."
129+
: "힌트를 추가했습니다.",
127130
text: "",
128131
});
129132
},

app/queries/getSubscriptionPlan.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface Response {
2121
export interface DataItem {
2222
id: number; // ID
2323
name: string; // 이름
24-
status: "FREE" | "SUBSCRIPTION"; // 상태 (두 가지 값 중 하나)
24+
status: "FREE" | "SUBSCRIPTION" | "SUBSCRIPTION_EXPIRATION"; // 상태 (두 가지 값 중 하나)
2525
startDate: string | null; // 시작 날짜 (문자열 또는 null)
2626
expiryDate: string | null; // 만료 날짜 (문자열 또는 null)
2727
createdAt: string; // 생성 날짜

app/utils/localStorage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const setLoginInfo = (loginInfo: LoginInfo) => {
7373
};
7474

7575
export const setStatus = (status: string) => {
76-
setLocalStorage(STATUS, JSON.stringify(status));
76+
setLocalStorage(STATUS, status);
7777
};
7878

7979
export const setSelectedThemeId = (themeId: number) => {

0 commit comments

Comments
 (0)