File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed
Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,15 @@ export default function Sidebar({ isOpen = true, onClose }: SidebarProps) {
1616 const [ userRole , setUserRole ] = useState < boolean | null > ( null ) ;
1717 const [ loading , setLoading ] = useState ( true ) ;
1818
19+ const downloadAPK = async ( ) => {
20+ const link = document . createElement ( "a" ) ;
21+ link . href = "/client.apk" ;
22+ link . download = "area-client.apk" ;
23+ document . body . appendChild ( link ) ;
24+ link . click ( ) ;
25+ document . body . removeChild ( link ) ;
26+ } ;
27+
1928 const getUserId = async ( ) => {
2029 try {
2130 const token = localStorage . getItem ( "authToken" ) ;
@@ -77,9 +86,7 @@ export default function Sidebar({ isOpen = true, onClose }: SidebarProps) {
7786 } ;
7887
7988 if ( loading ) {
80- return (
81- < div className = "h-full w-60 bg-[#1B264F] z-15" />
82- ) ;
89+ return < div className = "h-full w-60 bg-[#1B264F] z-15" /> ;
8390 }
8491
8592 return (
@@ -129,6 +136,12 @@ export default function Sidebar({ isOpen = true, onClose }: SidebarProps) {
129136 ) }
130137 </ ul >
131138 </ nav >
139+ < button
140+ 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"
141+ onClick = { downloadAPK }
142+ >
143+ < span > Download the app</ span >
144+ </ button >
132145 </ div >
133146 ) ;
134- }
147+ }
Original file line number Diff line number Diff line change @@ -76,7 +76,6 @@ export default function ServicesPage() {
7676 throw new Error ( "Failed to fetch services status" ) ;
7777 }
7878 const data = await response . json ( ) ;
79- console . log ( "Fetched services status:" , data ) ;
8079 setServicesStatus ( data || [ ] ) ;
8180 return data ;
8281 } catch ( err ) {
You can’t perform that action at this time.
0 commit comments