Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(074) - refactor on my-schedule features #74

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/components/shared-components/ModalConfirmSchedule.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button, Modal } from "antd";
import { useState } from "react";
import { Button, Modal } from "antd";
import { useDispatch } from "react-redux";
import { IoIosWarning } from "react-icons/io";

Expand All @@ -14,8 +14,11 @@ export function ModalConfirmSchedule({
textDate,
}) {
const [isModalOpen, setIsModalOpen] = useState(true);
const [isSubmitting, setIsSubmitting] = useState(false);
const dispatch = useDispatch();
const handleOk = async () => {
setIsSubmitting(true);

if (payload.doctor_available) {
try {
await APISchedule.updateActiveSchedule(payload);
Expand Down Expand Up @@ -64,18 +67,19 @@ export function ModalConfirmSchedule({
id="button-confirm-schedule"
key="ok"
onClick={handleOk}
className="mb-2 mt-5 h-10 rounded-lg bg-[#FEA53F] text-sm text-white sm:px-7 sm:text-base sm:font-medium"
className="mb-2 mt-5 h-10 rounded-lg bg-warning text-sm text-white disabled:bg-warning/70 sm:px-7 sm:text-base sm:font-medium"
style={{
border: "transparent",
}}
disabled={isSubmitting}
>
Ya, Saya yakin
</Button>
<Button
id="button-cancel-schedule"
key="cancel"
onClick={handleCancel}
className="ms-4 mt-5 h-10 rounded-lg border-[#FEA53F] text-sm text-[#FEA53F] sm:px-7 sm:text-base sm:font-medium"
className="ms-4 mt-5 h-10 rounded-lg border-warning text-sm text-warning sm:px-7 sm:text-base sm:font-medium"
>
Tidak, Batalkan
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/MapListData.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function formatStrDayJs(date) {
return date?.format("DD-MM-YYYY");
return date?.format("YYYY-MM-DD");
}

export function mapListData(data, eventDate) {
Expand Down