Skip to content

Commit

Permalink
Merge pull request #98 from eshc123/dev
Browse files Browse the repository at this point in the history
[RELEASE]
  • Loading branch information
eshc123 authored Jun 24, 2024
2 parents e66070a + 932066b commit fe3b486
Show file tree
Hide file tree
Showing 32 changed files with 1,623 additions and 487 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.eshc.goonersapp.feature.chat.navigation.navigateToChatRoom
import com.eshc.goonersapp.feature.home.navigation.homeNavigationRoute
import com.eshc.goonersapp.feature.home.navigation.homeScreen
import com.eshc.goonersapp.feature.login.navigation.loginScreen
import com.eshc.goonersapp.feature.login.navigation.navigateToLogin
import com.eshc.goonersapp.feature.login.navigation.navigateToSignUp
import com.eshc.goonersapp.feature.login.navigation.signUpScreen
import com.eshc.goonersapp.feature.match.model.toUiModel
Expand Down Expand Up @@ -59,13 +60,13 @@ fun GnrNavHost(
onShowSnackbar = onShowSnackbar
)
matchScreen(
topBar = {
topBar(TopLevelDestination.MATCH)
},
bottomBar = bottomBar,
onClickDetail = {
navController.navigateToMatchDetail(it.toUiModel())
},
onClickUser = {
navController.navigateToLogin()
},
onShowSnackbar = onShowSnackbar
)
}
Expand Down
43 changes: 24 additions & 19 deletions app/src/main/java/com/eshc/goonersapp/ui/GnrApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarDuration
Expand All @@ -17,6 +18,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
Expand All @@ -31,6 +33,7 @@ import com.eshc.goonersapp.core.designsystem.IconPack
import com.eshc.goonersapp.core.designsystem.component.GnrNavigationBar
import com.eshc.goonersapp.core.designsystem.component.GnrNavigationBarItem
import com.eshc.goonersapp.core.designsystem.component.GnrTopLevelTopBar
import com.eshc.goonersapp.core.designsystem.iconpack.IcGridCalender
import com.eshc.goonersapp.core.designsystem.iconpack.IcInfo
import com.eshc.goonersapp.core.designsystem.iconpack.IcNotification
import com.eshc.goonersapp.core.designsystem.iconpack.IcPeople
Expand Down Expand Up @@ -69,9 +72,7 @@ fun GnrApp(

Scaffold(
modifier = Modifier,
snackbarHost = {
SnackbarHost(snackbarHostState)
}
snackbarHost = { SnackbarHost(snackbarHostState) }
) { padding ->
Column(
modifier = Modifier.padding(padding)
Expand All @@ -80,44 +81,44 @@ fun GnrApp(
navController = navController,
onShowSnackbar = { message ->
coroutineScope.launch {
snackbarHostState.showSnackbar(
message
)
snackbarHostState.showSnackbar(message)
}
},
topBar = { topLevelDestination ->
GnrTopLevelBar(
topLevelDestination = topLevelDestination,
icons = {
when (topLevelDestination) {
TopLevelDestination.TEAM -> {
TopLevelDestination.HOME -> {
Icon(
imageVector = IconPack.IcInfo,
imageVector = IconPack.IcNotification,
contentDescription = null,
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp)
.clickable { navController.navigateToClubDetail() },
.clip(RoundedCornerShape(3.dp)),
tint = ColorFF777777
)
Icon(
imageVector = IconPack.IcSearch,
imageVector = IconPack.IcPeople,
contentDescription = null,
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp)
.clickable { navController.navigateToSearch() },
.clip(RoundedCornerShape(3.dp))
.clickable { navController.navigateToLogin() },
tint = ColorFF777777
)
}

TopLevelDestination.HOME -> {
TopLevelDestination.MATCH -> {
Icon(
imageVector = IconPack.IcNotification,
imageVector = IconPack.IcGridCalender,
contentDescription = null,
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp),
.size(24.dp)
.clip(RoundedCornerShape(3.dp)),
tint = ColorFF777777
)
Icon(
Expand All @@ -126,27 +127,31 @@ fun GnrApp(
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp)
.clip(RoundedCornerShape(3.dp))
.clickable { navController.navigateToLogin() },
tint = ColorFF777777
)
}

else -> {
TopLevelDestination.TEAM -> {
Icon(
imageVector = IconPack.IcNotification,
imageVector = IconPack.IcInfo,
contentDescription = null,
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp),
.size(24.dp)
.clip(RoundedCornerShape(3.dp))
.clickable { navController.navigateToClubDetail() },
tint = ColorFF777777
)
Icon(
imageVector = IconPack.IcPeople,
imageVector = IconPack.IcSearch,
contentDescription = null,
modifier = Modifier
.padding(horizontal = 8.dp)
.size(24.dp)
.clickable { navController.navigateToLogin() },
.clip(RoundedCornerShape(3.dp))
.clickable { navController.navigateToSearch() },
tint = ColorFF777777
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ fun RemoteTeamDetail.toModel() = TeamDetail(
fun RemoteTeam.toModel() = Team(
clubId = teamId ?: 0,
clubName = teamName ?: "",
officialName = "",
foundationDate = (founded ?: 0).toString(),
imageUrl = teamImageUrl ?: "",
teamNickname = shortCode ?: "",
managerId = 0,
manager = "",
captainId = 0,
captain = "",
stadiumName = venueName ?:""
clubFoundedYear = founded ?: 0,
clubImgUrl = teamImageUrl ?: "",
clubShortCode = shortCode ?: "",
manager = managerName ?: "",
captain = captainName ?: "",
stadiumName = venueName ?: "",
clubHomeTown = cityName ?: "",
clubNationality = nationality ?: "",
clubNationImgUrl = nationalityImgUrl ?: "",
officialWebUrl = officialWebUrl ?: "",
snsFaceBook = snsFacebook ?: "",
snsX = snsX ?: "",
snsInstagram = snsInstagram ?: ""
)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.eshc.goonersapp.core.designsystem

import androidx.compose.ui.graphics.vector.ImageVector
import com.eshc.goonersapp.core.designsystem.iconpack.IcBall
import com.eshc.goonersapp.core.designsystem.iconpack.IcTrophy
import com.eshc.goonersapp.core.designsystem.iconpack.IcGrid
import com.eshc.goonersapp.core.designsystem.iconpack.IcList
import kotlin.collections.List as ____KtList

public object IconPack
Expand All @@ -14,6 +14,6 @@ public val IconPack.Icons: ____KtList<ImageVector>
if (__Icons != null) {
return __Icons!!
}
__Icons= listOf(IcBall, IcTrophy)
__Icons= listOf(IcList, IcGrid)
return __Icons!!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.eshc.goonersapp.core.designsystem.component

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.eshc.goonersapp.core.designsystem.theme.ColorFF000000
import com.eshc.goonersapp.core.designsystem.theme.GnrTypography

@Composable
fun MatchItemResultChip(
result: String,
color: Color,
modifier: Modifier = Modifier
) {
Card(
modifier = modifier,
shape = RoundedCornerShape(3.dp),
colors = CardDefaults.cardColors(
containerColor = color,
contentColor = ColorFF000000
)
) {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
Text(
text = result,
style = GnrTypography.descriptionMedium
)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.eshc.goonersapp.core.designsystem.component

import androidx.compose.material3.HorizontalDivider
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.eshc.goonersapp.core.designsystem.theme.ColorFFDCDCDC

@Composable
fun GnrHorizontalDivider(
modifier: Modifier = Modifier,
color: Color = ColorFFDCDCDC,
thickness: Dp = 1.dp
) {
HorizontalDivider(modifier, thickness, color)
}
Loading

0 comments on commit fe3b486

Please sign in to comment.