Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Contributor] 카드 UI 변경 #97

Merged
merged 3 commits into from
Jul 25, 2023
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 @@ -5,11 +5,13 @@ import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.Divider
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
Expand All @@ -25,6 +27,8 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.droidknights.app2023.core.designsystem.component.KnightsCard
import com.droidknights.app2023.core.designsystem.component.TextChip
import com.droidknights.app2023.core.model.Contributor

@Composable
Expand Down Expand Up @@ -57,9 +61,8 @@ internal fun ContributorScreen(
ContributorsUiState.Loading -> Unit
is ContributorsUiState.Contributors ->
Column(
modifier = Modifier.padding(horizontal = 32.dp)
modifier = Modifier.padding(horizontal = 8.dp, vertical = 16.dp)
) {
ContributorTitle()
ContributorList(
contributors = uiState.contributors,
)
Expand Down Expand Up @@ -97,22 +100,6 @@ internal fun ActionBarContent(
}
}

@Composable
internal fun ContributorTitle() {
Column(
verticalArrangement = Arrangement.spacedBy(8.dp),
modifier = Modifier
.padding(vertical = 37.dp)
) {
Text(
text = stringResource(id = R.string.contributor_title),
style = MaterialTheme.typography.titleLarge,
fontWeight = FontWeight.Bold,
)
Divider(color = Color(0xFF000000), thickness = 2.dp)
}
}

@Composable
internal fun ContributorList(contributors: List<Contributor>) {
LazyColumn(
Expand All @@ -127,12 +114,43 @@ internal fun ContributorList(contributors: List<Contributor>) {

@Composable
internal fun ContributorItem(contributor: Contributor) {
Text(
text = contributor.name,
style = MaterialTheme.typography.titleMedium,
fontWeight = FontWeight.Bold,
color = Color(0xFF5E5E5E),
)
KnightsCard {
Row {
Column(
modifier = Modifier
.weight(1f)
.padding(
top = 16.dp,
bottom = 16.dp,
start = 24.dp,
end = 16.dp
)
) {
TextChip(
stringResource(id = R.string.contributor_chip),
containerColor = Color(0x66A1ED00),
labelColor = Color(0xFF465703),
)
Text(
text = contributor.name,
style = MaterialTheme.typography.headlineSmall,
fontWeight = FontWeight.Bold,
color = Color(0xFF000000),
modifier = Modifier.padding(top = 12.dp)
)
}
// TODO: NetworkImage 연결
Box(
modifier = Modifier
.padding(16.dp)
.size(100.dp)
.background(
color = Color(0xFF88F21D),
shape = RoundedCornerShape(50.dp),
)
)
}
}
}

@Preview
Expand Down
2 changes: 1 addition & 1 deletion feature/contributor/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<resources>
<string name="contributor_top_title">컨트리뷰터</string>
<string name="contributor_title">Contributors</string>
<string name="contributor_chip">Contributor</string>
</resources>