Skip to content

Commit

Permalink
fix: use dvh to replace vh on modals and layout frame
Browse files Browse the repository at this point in the history
  • Loading branch information
BigSillyTiger committed May 7, 2024
1 parent 097cd8d commit d4c3ac4
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 11 deletions.
10 changes: 10 additions & 0 deletions src/apis/api_admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,13 @@ export const accessCheck = async (page: string): Promise<Tresponse> => {
};
}
};

export const test = async () => {
try {
const response = await apis.get("/api/test");
return response.data;
} catch (err: unknown) {
console.error("err.test: ", err);
return { status: RES_STATUS.FAILED, msg: "", data: {} };
}
};
4 changes: 3 additions & 1 deletion src/apis/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import axios from "axios";

const apis = axios.create({
withCredentials: true,
baseURL: `http://localhost:8080`,
//baseURL: `http://localhost:8080`,
// playground
//baseURL: `https://cpsoftware.com.au`,
//baseURL: `http://cpsoftware.com.au`,
// alex
//baseURL: `https://tool.srclandscaping.com.au`,
baseURL: `https://test.srclandscaping.com.au`,
});

export default apis;
6 changes: 3 additions & 3 deletions src/components/modal/modalFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const ModalFrame: FC<Tprops> = ({
{/* modal content */}
<div className="mt-[7vh] fixed inset-0 z-10 overflow-y-auto">
{/* min-h-full */}
<div className="flex h-[93vh] items-end justify-center text-center sm:items-center p-0">
<div className="flex h-[93dvh] items-end justify-center text-center sm:items-center p-0">
<Transition.Child
as={Fragment}
enter="ease-out duration-300"
Expand All @@ -82,7 +82,7 @@ const ModalFrame: FC<Tprops> = ({
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
>
<Dialog.Panel
className={`relative h-full overflow-y-auto sm:h-auto bg-slate-100 text-left shadow-xl transition-all px-4 pb-4 pt-5 sm:my-8 sm:py-3 sm:px-4 ${widthSize(
className={`relative overflow-y-auto bg-slate-100 text-left shadow-xl transition-all px-4 pb-4 pt-5 sm:my-8 sm:py-3 sm:px-4 ${widthSize(
mode
)} ${className}`}
>
Expand All @@ -105,7 +105,7 @@ const ModalFrame: FC<Tprops> = ({
{/* title */}
<Dialog.Title
as="h3"
className={`text-base flex items-center font-semibold leading-6 h-[5vh] ${
className={`text-base flex items-center font-semibold leading-6 h-[5dvh] ${
isMajor
? "text-red-600 flex items-center justify-center"
: "text-gray-900"
Expand Down
2 changes: 1 addition & 1 deletion src/pageComponents/headBar/HeadBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const HeadBar: FC<Tprops> = ({ setOpen }) => {

return (
<header className="lg:pl-[5vw]">
<div className="sticky top-0 z-40 flex h-[7vh] shrink-0 items-center gap-x-4 border-b border-gray-200 bg-white px-4 shadow-sm sm:gap-x-6 sm:px-6 lg:px-8">
<div className="sticky top-0 z-40 flex h-[7dvh] shrink-0 items-center gap-x-4 border-b border-gray-200 bg-white px-4 shadow-sm sm:gap-x-6 sm:px-6 lg:px-8">
<button
type="button"
className="-m-2.5 p-2.5 text-gray-700 lg:hidden"
Expand Down
2 changes: 1 addition & 1 deletion src/pageComponents/layout/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const MainLayout = () => {

{/* view area */}
<main
className={`relative py-5 w-screen left-0 lg:left-[5vw] lg:w-[95vw] h-[93vh] overflow-y-auto`}
className={`relative py-5 w-screen left-0 lg:left-[5dvw] lg:w-[95dvw] h-[93dvh] overflow-y-auto`}
>
<Outlet />
</main>
Expand Down
4 changes: 2 additions & 2 deletions src/pageComponents/modals/pdfMaker/invoice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const DatePicker = ({
setDate(newDate);
onSubmit(newDate);
}}
className={`h-[4dvh] mt-[1vh]`}
className={`h-[4dvh] mt-[1dvh]`}
>
{t("btn.updateIssueDate")}
</NormalBtn>
Expand Down Expand Up @@ -111,7 +111,7 @@ const DatePicker = ({
setDate(defaultDate);
onSubmit(defaultDate);
}}
className={`h-[4dvh] mt-[1vh]`}
className={`h-[4dvh] mt-[1dvh]`}
>
{t("btn.resetIssue")}
</NormalBtn>
Expand Down
4 changes: 2 additions & 2 deletions src/pageComponents/modals/pdfMaker/quotation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const DatePicker = ({
setDate(newDate);
onSubmit(newDate);
}}
className={`h-[4dvh] mt-[1vh]`}
className={`h-[4dvh] mt-[1dvh]`}
>
{t("btn.updateIssueDate")}
</NormalBtn>
Expand Down Expand Up @@ -112,7 +112,7 @@ const DatePicker = ({
setDate(defaultDate);
onSubmit(defaultDate);
}}
className={`h-[4dvh] mt-[1vh]`}
className={`h-[4dvh] mt-[1dvh]`}
>
{t("btn.resetIssue")}
</NormalBtn>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/setting/company.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ const Company: FC<Tprops> = ({ company, logo }) => {
}
}
}}
className={`h-[4dvh] mt-[1vh]`}
className={`h-[4dvh] mt-[1dvh]`}
>
{t("btn.updateLogo")}
</NormalBtn>
Expand Down
2 changes: 2 additions & 0 deletions src/routerAccFns/actions/loginAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export const loginAction = async ({ request }: ActionFunctionArgs) => {
const search = new URL(request.url).searchParams.get("redirect");
const data = await request.formData();

//await API_ADMIN.test();

const result = await API_ADMIN.adminLogin(
data.get("email") as string,
data.get("password") as string
Expand Down

0 comments on commit d4c3ac4

Please sign in to comment.