Skip to content

Commit

Permalink
Merge pull request #76 from uswLectureEvaluation/feature/#73-my-home&…
Browse files Browse the repository at this point in the history
…notice

Feature/#73 my home&notice
  • Loading branch information
BEEEAM-J authored Dec 30, 2023
2 parents 9d9660c + 9e026b0 commit 166ed4a
Show file tree
Hide file tree
Showing 23 changed files with 914 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.suwiki.core.designsystem.component.appbar

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
Expand All @@ -11,6 +10,7 @@ import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.painterResource
Expand All @@ -25,42 +25,54 @@ import com.suwiki.core.ui.extension.suwikiClickable
@Composable
fun SuwikiAppBarWithTitle(
modifier: Modifier = Modifier,
title: String = "",
title: String? = null,
showCloseIcon: Boolean = true,
showBackIcon: Boolean = true,
onClickBack: () -> Unit = {},
onClickRemove: () -> Unit = {},
onClickClose: () -> Unit = {},
) {
Row(
Box(
modifier = modifier
.fillMaxWidth()
.wrapContentHeight()
.background(White)
.padding(top = 15.dp, bottom = 15.dp, start = 18.dp, end = 24.dp),
horizontalArrangement = Arrangement.SpaceBetween,
) {
Icon(
painter = painterResource(id = R.drawable.ic_appbar_arrow_left),
contentDescription = "",
tint = Gray95,
modifier = Modifier
.size(24.dp)
.clip(CircleShape)
.suwikiClickable(onClick = onClickBack)
.padding(vertical = 2.dp, horizontal = 6.5.dp),
)
Text(
text = title,
style = SuwikiTheme.typography.header6,
)
Icon(
painter = painterResource(id = R.drawable.ic_appbar_close_mark),
contentDescription = "",
tint = Gray95,
modifier = Modifier
.size(24.dp)
.clip(CircleShape)
.suwikiClickable(onClick = onClickRemove)
.padding(3.dp),
)
if (showBackIcon) {
Icon(
modifier = Modifier
.align(Alignment.CenterStart)
.size(24.dp)
.clip(CircleShape)
.suwikiClickable(onClick = onClickBack)
.padding(vertical = 2.dp, horizontal = 6.5.dp),
painter = painterResource(id = R.drawable.ic_appbar_arrow_left),
contentDescription = "",
tint = Gray95,
)
}

if (title != null) {
Text(
modifier = Modifier.align(Alignment.Center),
text = title,
style = SuwikiTheme.typography.header6,
)
}

if (showCloseIcon) {
Icon(
modifier = Modifier
.align(Alignment.CenterEnd)
.size(24.dp)
.clip(CircleShape)
.suwikiClickable(onClick = onClickClose)
.padding(3.dp),
painter = painterResource(id = R.drawable.ic_appbar_close_mark),
contentDescription = "",
tint = Gray95,
)
}
}
}

Expand All @@ -71,7 +83,7 @@ fun SuwikiAppBarPreview() {
SuwikiAppBarWithTitle(
title = "타이틀",
onClickBack = { /*TODO*/ },
onClickRemove = { /*TODO*/ },
onClickClose = { /*TODO*/ },
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fun SuwikiBottomSheet(
}

@Composable
fun SuwikiBottomSheetItem(
fun SuwikiMenuItem(
modifier: Modifier = Modifier,
title: String,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.suwiki.core.model.notice
import java.time.LocalDateTime

data class Notice(
val id: Long,
val title: String,
val date: LocalDateTime?,
val id: Long = 0,
val title: String = "",
val date: LocalDateTime? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.suwiki.core.model.notice
import java.time.LocalDateTime

data class NoticeDetail(
val id: Long,
val title: String,
val date: LocalDateTime?,
val content: String,
val id: Long = 0,
val title: String = "",
val date: LocalDateTime? = null,
val content: String = "",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.suwiki.feature.myinfo

data class MyInfoState(
val showMyInfoCard: Boolean = false,
val isLoading: Boolean = false,
)

sealed interface MyInfoSideEffect {
data object NavigateNotice : MyInfoSideEffect
}
Loading

0 comments on commit 166ed4a

Please sign in to comment.