Skip to content
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
21 changes: 17 additions & 4 deletions app/Components/Area_sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ export default function Sidebar({ isOpen = true, onClose }: SidebarProps) {
const [userRole, setUserRole] = useState<boolean | null>(null);
const [loading, setLoading] = useState(true);

const downloadAPK = async () => {
const link = document.createElement("a");
link.href = "/client.apk";
link.download = "area-client.apk";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};

const getUserId = async () => {
try {
const token = localStorage.getItem("authToken");
Expand Down Expand Up @@ -77,9 +86,7 @@ export default function Sidebar({ isOpen = true, onClose }: SidebarProps) {
};

if (loading) {
return (
<div className="h-full w-60 bg-[#1B264F] z-15" />
);
return <div className="h-full w-60 bg-[#1B264F] z-15" />;
}

return (
Expand Down Expand Up @@ -129,6 +136,12 @@ export default function Sidebar({ isOpen = true, onClose }: SidebarProps) {
)}
</ul>
</nav>
<button
className="absolute bottom-10 left-6 right-6 flex items-center gap-2 px-6 py-2 bg-white text-[#576CA8] font-semibold rounded hover:bg-gray-200"
onClick={downloadAPK}
>
<span>Download the app</span>
</button>
</div>
);
}
}
1 change: 0 additions & 1 deletion app/Services/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export default function ServicesPage() {
throw new Error("Failed to fetch services status");
}
const data = await response.json();
console.log("Fetched services status:", data);
setServicesStatus(data || []);
return data;
} catch (err) {
Expand Down