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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ import com.google.maps.android.compose.Marker
import com.google.maps.android.compose.MarkerState
import com.google.maps.android.compose.rememberCameraPositionState

/**
* Android-specific implementation of the [RenderMap] composable function.
* This function displays a Google Map centered on the Mifos Initiative headquarters.
*
* @param modifier A [Modifier] for this composable.
*/
@Composable
actual fun RenderMap(modifier: Modifier) {
val headquarterLatLng = LatLng(47.61115, -122.34481)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ import mifos_mobile.feature.location.generated.resources.mifos_initiative
import mifos_mobile.feature.location.generated.resources.mifos_location
import org.jetbrains.compose.resources.stringResource

/**
* A composable function that displays the location of the Mifos Initiative.
* It includes the name, address, and a map view showing the location.
*
* @param modifier A [Modifier] for this composable.
*/
@Composable
internal fun LocationsScreen(
modifier: Modifier = Modifier,
Expand All @@ -45,5 +51,11 @@ internal fun LocationsScreen(
}
}

/**
* An expect composable function for rendering a map. Each platform is expected
* to provide its own implementation.
*
* @param modifier A [Modifier] for this composable.
*/
@Composable
expect fun RenderMap(modifier: Modifier = Modifier)
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ import androidx.navigation.compose.composable
import androidx.navigation.compose.navigation
import org.mifos.mobile.feature.location.LocationsScreen

/**
* Navigates to the locations screen.
*/
fun NavController.navigateToLocationsScreen() {
navigate(LocationsNavigation.LocationsScreen.route)
}

/**
* Defines the navigation graph for the locations feature.
*
* @receiver [NavGraphBuilder]
*/
fun NavGraphBuilder.locationsNavGraph() {
navigation(
startDestination = LocationsNavigation.LocationsScreen.route,
Expand All @@ -28,6 +36,11 @@ fun NavGraphBuilder.locationsNavGraph() {
}
}

/**
* Defines the route for the locations screen.
*
* @receiver [NavGraphBuilder]
*/
fun NavGraphBuilder.locationsScreenRoute() {
composable(
route = LocationsNavigation.LocationsScreen.route,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,29 @@
package org.mifos.mobile.feature.location.navigation

// Constants for Routes
/**
* Base route for the locations feature navigation graph.
*/
const val LOCATIONS_NAVIGATION_ROUTE_BASE = "locations_base_route"

/**
* Route for the locations screen.
*/
const val LOCATIONS_SCREEN_ROUTE = "locations_screen_route"

// Sealed class for Navigation Routes
/**
* Sealed class representing the navigation routes for the locations feature.
*
* @property route The route string for the navigation destination.
*/
sealed class LocationsNavigation(val route: String) {
/**
* Represents the base navigation route for the locations feature.
*/
data object LocationsBase : LocationsNavigation(route = LOCATIONS_NAVIGATION_ROUTE_BASE)

/**
* Represents the screen for displaying locations.
*/
data object LocationsScreen : LocationsNavigation(route = LOCATIONS_SCREEN_ROUTE)
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ package org.mifos.mobile.feature.location
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier

/**
* Desktop-specific implementation of the [RenderMap] composable function.
* This is currently a no-op.
*
* @param modifier A [Modifier] for this composable.
*/
@Composable
actual fun RenderMap(modifier: Modifier) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ package org.mifos.mobile.feature.location
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier

/**
* JS-specific implementation of the [RenderMap] composable function.
* This is currently a no-op.
*
* @param modifier A [Modifier] for this composable.
*/
@Composable
actual fun RenderMap(modifier: Modifier) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ package org.mifos.mobile.feature.location
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier

/**
* Native-specific implementation of the [RenderMap] composable function.
* This is currently a no-op.
*
* @param modifier A [Modifier] for this composable.
*/
@Composable
actual fun RenderMap(modifier: Modifier) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ package org.mifos.mobile.feature.location
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier

/**
* WasmJs-specific implementation of the [RenderMap] composable function.
* This is currently a no-op.
*
* @param modifier A [Modifier] for this composable.
*/
@Composable
actual fun RenderMap(modifier: Modifier) {
}
Loading