+
{isBack && (
router.history.back()}
className={cn(
"flex justify-start shrink-0 items-center gap-2 text-base font-semibold cursor-pointer w-fit p-4",
- backClassName
+ backClassName,
)}
>
@@ -66,7 +72,7 @@ export default function NavigationLayout({
className={cn(
"h-full relative pt-18",
isBottomNav && "overflow-y-auto",
- mainClassName
+ mainClassName,
)}
>
{children}
diff --git a/src/components/ui/bottom-navigation/bottom-navigation.tsx b/src/components/ui/bottom-navigation/bottom-navigation.tsx
index da41f47..ebdd90e 100644
--- a/src/components/ui/bottom-navigation/bottom-navigation.tsx
+++ b/src/components/ui/bottom-navigation/bottom-navigation.tsx
@@ -1,19 +1,16 @@
import { Link, useRouterState } from "@tanstack/react-router";
-import { BarChart3, DoorOpen, Home, Settings } from "lucide-react";
+import { BarChart3, Home, ListCheck, Settings } from "lucide-react";
import { cn } from "../../../utils/classname";
-
export default function BottomNavigation() {
const location = useRouterState({
- select: (state) => state.location,
-})
-
-console.log(location.pathname)
+ select: (state) => state.location,
+ });
const tabs = [
{ path: "/", icon: Home, label: "Dashboard", disabled: false },
{ path: "/analysis", icon: BarChart3, label: "analysis", disabled: true },
- { path: "/rooms", icon: DoorOpen, label: "Rooms", disabled: true },
+ { path: "/topics", icon: ListCheck, label: "Topics", disabled: false },
{ path: "/settings", icon: Settings, label: "Settings", disabled: false },
];
@@ -24,7 +21,11 @@ console.log(location.pathname)
{tab.label}
diff --git a/src/constants/env.ts b/src/constants/env.ts
index 999d7d0..e751f69 100644
--- a/src/constants/env.ts
+++ b/src/constants/env.ts
@@ -2,4 +2,6 @@ export const ENV = {
apiUrl: import.meta.env.VITE_API_URL,
apiKey: import.meta.env.VITE_SIGN_KEY,
secretKey: import.meta.env.VITE_SIGN_SECRET_KEY,
-}
\ No newline at end of file
+ basicUsername: import.meta.env.VITE_BASIC_AUTH_USERNAME,
+ basicPassword: import.meta.env.VITE_BASIC_AUTH_PASSWORD,
+};
diff --git a/src/features/settings/index.tsx b/src/features/settings/index.tsx
index 96dea55..25ad484 100644
--- a/src/features/settings/index.tsx
+++ b/src/features/settings/index.tsx
@@ -11,17 +11,15 @@ export default function SettingsFeature() {
tower: "",
floor: "",
unit: "",
+ credential: "",
});
const [loading, setLoading] = useState(false);
-function isObjectValueDifferent(
- a: MerchantForm,
- b: MerchantForm
-): boolean {
- return (Object.keys(a) as (keyof MerchantForm)[]).some(
- (key) => a[key] !== b[key]
- );
-}
+ function isObjectValueDifferent(a: MerchantForm, b: MerchantForm): boolean {
+ return (Object.keys(a) as (keyof MerchantForm)[]).some(
+ (key) => a[key] !== b[key],
+ );
+ }
function handleChange(e: React.ChangeEvent) {
const { name, value } = e.target;
@@ -31,29 +29,26 @@ function isObjectValueDifferent(
}));
}
-function handleSubmit(e: React.FormEvent) {
- e.preventDefault();
+ function handleSubmit(e: React.FormEvent) {
+ e.preventDefault();
- const merchant = getMerchant();
+ const merchant = getMerchant();
- if(merchant){
- const isDifferent = isObjectValueDifferent(merchant, form);
- if (isDifferent) {
- clearDevice(); // reset device kalau merchant berubah
+ if (merchant) {
+ const isDifferent = isObjectValueDifferent(merchant, form);
+ if (isDifferent) {
+ clearDevice(); // reset device kalau merchant berubah
+ }
}
+ setLoading(true);
+ saveMerchant(form);
+
+ setTimeout(() => {
+ setLoading(false);
+ navigate({ to: "/" });
+ }, 200);
}
-
-
-
- setLoading(true);
- saveMerchant(form);
-
- setTimeout(() => {
- setLoading(false);
- navigate({ to: "/" });
- }, 200);
-}
useEffect(() => {
const merchant = getMerchant();
@@ -119,6 +114,18 @@ function handleSubmit(e: React.FormEvent) {
className="p-2 border border-neutral-200 w-full rounded-md"
/>
+
+
+
+
+