Skip to content

Commit

Permalink
♻️ :: string resource 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
parkuiery committed Jun 8, 2024
1 parent fd48833 commit 12ed490
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,11 @@ private fun NoticeCard(
}

private val LocalDateTime.text: String
@Composable inline get() = "${this.year}-${this.monthValue}-${this.dayOfMonth} ${this.hour}:${this.minute}"
@Composable inline get() = stringResource(
id = R.string.format_notice_time,
this.year,
this.monthValue,
this.dayOfMonth,
this.hour,
this.minute,
)
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ internal fun NoticeDetailsScreen(
modifier = Modifier
.fillMaxWidth()
.horizontalPadding(),
text = uiState.createdAt.text,
text = uiState.createdAt!!.text,
style = DmsTheme.typography.caption,
color = DmsTheme.colorScheme.onSurfaceVariant,
)
Expand Down Expand Up @@ -127,6 +127,13 @@ internal fun NoticeDetailsScreen(
}
}

private val LocalDateTime?.text: String
@Composable inline get() = "${this?.year}-${this?.monthValue}-${this?.dayOfMonth} ${this?.hour}:${this?.minute}"
private val LocalDateTime.text: String
@Composable inline get() = stringResource(
id = R.string.format_notice_time,
this.year,
this.monthValue,
this.dayOfMonth,
this.hour,
this.minute,
)

2 changes: 2 additions & 0 deletions feature/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@

<string name="notice_new_notice_exists">새로운 공지사항이 있습니다</string>
<string name="notice_notices_not_exists">공지사항이 없습니다</string>

<string name="format_notice_time">%d/%d/%d %d:%d</string>

<!--my page-->
<string name="my_page_sign_out">로그아웃</string>
Expand Down

0 comments on commit 12ed490

Please sign in to comment.