Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat/70-UI-refactor' into feat/#69
Browse files Browse the repository at this point in the history
  • Loading branch information
faddishcorn committed Nov 14, 2024
2 parents 3328482 + 9d4f3f9 commit 8ffec1b
Show file tree
Hide file tree
Showing 8 changed files with 485 additions and 202 deletions.
28 changes: 0 additions & 28 deletions .gitignore

This file was deleted.

33 changes: 33 additions & 0 deletions src/api/hooks/useFcmUpdate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { useMutation } from "@tanstack/react-query";
import { apiClient } from "../instance";

interface FcmUpdateRequest {
token: string;
isNotificatioinEnabled?: boolean;
notificationOffset?: number;
}

interface FcmUpdateResponse {
message: string;
}

const useFcmUpdate = () => {
return useMutation<FcmUpdateResponse, Error, FcmUpdateRequest>({
mutationFn: async (data: FcmUpdateRequest) => {
const response = await apiClient.put<FcmUpdateResponse>(
"/api/fcm/update",
{
token: data.token,
isNotificationEnabled: data.isNotificatioinEnabled ?? true,
notificationOffset: data.notificationOffset ?? 0,
},
);
return response.data;
},
onError: (error) => {
console.error("FCM 토큰 μ—…λ°μ΄νŠΈ μ‹€νŒ¨:", error);
},
});
};

export default useFcmUpdate;
40 changes: 39 additions & 1 deletion src/components/features/CustomCalendar/CustomCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ const StyledInput = styled.input`
box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2); /* focus:ring-2 focus:ring-[#2196F3] */
}
`;
const ToggleContainer = styled.div`
display: flex;
align-items: center;
width: 100%;
justify-content: space-between;
font-size: 1.2rem;
margin-bottom: 10px;
`;

const ToggleSwitch = styled.input`
width: 20px;
height: 20px;
`;

export interface CalendarEvent {
id: string;
Expand Down Expand Up @@ -222,6 +235,12 @@ const EventContent = ({
e.stopPropagation();
handleOptionClick("edit");
}}
onKeyDown={(e) => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
handleOptionClick("edit");
}
}}
>
μˆ˜μ •
</div>
Expand All @@ -242,6 +261,12 @@ const EventContent = ({
e.stopPropagation();
handleOptionClick("delete");
}}
onKeyDown={(e) => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
handleOptionClick("delete");
}
}}
>
μ‚­μ œ
</div>
Expand Down Expand Up @@ -558,7 +583,20 @@ const CustomCalendar: React.FC<CustomCalendarProps> = ({
)
}
/>
<Button onClick={handleEditSubmit}>μ €μž₯</Button>
<ToggleContainer>
곡개 μ—¬λΆ€
<ToggleSwitch
type="checkbox"
checked={!!currentEditPlan.accessibility} // Converts null to false
onChange={(e) =>
setCurrentEditPlan((prev) => ({
...prev!,
accessibility: e.target.checked,
}))
}
/>
</ToggleContainer>
<Button onClick={handleEditSubmit}>μΆ”κ°€</Button>
</ModalContainer>
</Modal>
)}
Expand Down
43 changes: 0 additions & 43 deletions src/components/features/DatePicker/DatePicker.css
Original file line number Diff line number Diff line change
@@ -1,43 +0,0 @@
.custom-datepicker-wrapper {
position: relative;
z-index: 100;
}

.custom-calendar {
border: 1px solid #ddd !important;
font-family: -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* μ‹œκ°„ 선택 μ»¨ν…Œμ΄λ„ˆ μŠ€νƒ€μΌ */
.react-datepicker__time-container {
border-left: 1px solid #ddd !important;
width: 100px !important;
display: block !important;
}

.react-datepicker {
display: flex !important;
}

.react-datepicker__time-box {
width: 100px !important;
margin: 0 !important;
}

/* μ‹œκ°„ 리슀트 μŠ€νƒ€μΌ */
.react-datepicker__time-list {
height: 200px !important;
overflow-y: scroll !important;
width: 100% !important;
}

.react-datepicker__time-list-item {
padding: 5px 10px !important;
height: auto !important;
}

/* μ„ νƒλœ μ‹œκ°„ μŠ€νƒ€μΌ */
.react-datepicker__time-list-item--selected {
background-color: #216ba5 !important;
color: white !important;
}
Loading

0 comments on commit 8ffec1b

Please sign in to comment.