Skip to content

Commit 67f1742

Browse files
authored
๐Ÿ”— :: (#382) ์•Œ๋ฆผ ์—†์Œ ํ™”๋ฉด ์ถ”๊ฐ€
2 parents 39c10a4 + c341342 commit 67f1742

File tree

9 files changed

+77
-86
lines changed

9 files changed

+77
-86
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package team.retum.jobisdesignsystemv2.empty
2+
3+
import androidx.compose.foundation.Image
4+
import androidx.compose.foundation.layout.Arrangement
5+
import androidx.compose.foundation.layout.Column
6+
import androidx.compose.foundation.layout.Spacer
7+
import androidx.compose.foundation.layout.fillMaxSize
8+
import androidx.compose.foundation.layout.fillMaxWidth
9+
import androidx.compose.foundation.layout.height
10+
import androidx.compose.foundation.layout.size
11+
import androidx.compose.runtime.Composable
12+
import androidx.compose.ui.Alignment
13+
import androidx.compose.ui.Modifier
14+
import androidx.compose.ui.res.painterResource
15+
import androidx.compose.ui.unit.dp
16+
import team.retum.jobisdesignsystemv2.foundation.JobisIcon
17+
import team.retum.jobisdesignsystemv2.foundation.JobisTheme
18+
import team.retum.jobisdesignsystemv2.foundation.JobisTypography
19+
import team.retum.jobisdesignsystemv2.text.JobisText
20+
21+
@Composable
22+
fun EmptyContent(
23+
modifier: Modifier = Modifier,
24+
title: String,
25+
description: String? = null,
26+
) {
27+
Column(
28+
modifier = modifier.fillMaxSize(),
29+
verticalArrangement = Arrangement.Center,
30+
horizontalAlignment = Alignment.CenterHorizontally,
31+
) {
32+
Image(
33+
modifier = Modifier.size(128.dp),
34+
painter = painterResource(JobisIcon.Empty),
35+
contentDescription = "empty content",
36+
)
37+
Spacer(modifier = Modifier.height(16.dp))
38+
Column(
39+
modifier = Modifier.fillMaxWidth(),
40+
verticalArrangement = Arrangement.spacedBy(4.dp),
41+
horizontalAlignment = Alignment.CenterHorizontally,
42+
) {
43+
JobisText(
44+
text = title,
45+
style = JobisTypography.SubHeadLine,
46+
)
47+
description?.let {
48+
JobisText(
49+
text = it,
50+
style = JobisTypography.Description,
51+
color = JobisTheme.colors.onSurfaceVariant,
52+
)
53+
}
54+
}
55+
}
56+
}

โ€Žcore/design-system/src/main/java/team/retum/jobisdesignsystemv2/foundation/JobisIcon.ktโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ object JobisIcon {
3535
val File = R.drawable.ic_file
3636
val SnowMan = R.drawable.ic_snow_man
3737
val Notification = R.drawable.ic_notification
38+
val Empty = R.drawable.ic_empty
3839
}

โ€Žfeature/company/src/main/java/team/retum/company/ui/SearchCompaniesScreen.ktโ€Ž

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
package team.retum.company.ui
22

3-
import androidx.compose.foundation.Image
43
import androidx.compose.foundation.background
54
import androidx.compose.foundation.layout.Column
6-
import androidx.compose.foundation.layout.Spacer
75
import androidx.compose.foundation.layout.fillMaxSize
8-
import androidx.compose.foundation.layout.height
9-
import androidx.compose.foundation.layout.padding
10-
import androidx.compose.foundation.layout.size
116
import androidx.compose.runtime.Composable
127
import androidx.compose.runtime.getValue
13-
import androidx.compose.ui.Alignment
148
import androidx.compose.ui.Modifier
15-
import androidx.compose.ui.res.painterResource
169
import androidx.compose.ui.res.stringResource
17-
import androidx.compose.ui.text.style.TextAlign
18-
import androidx.compose.ui.unit.dp
1910
import androidx.hilt.navigation.compose.hiltViewModel
2011
import androidx.lifecycle.compose.collectAsStateWithLifecycle
2112
import kotlinx.collections.immutable.ImmutableList
@@ -25,9 +16,8 @@ import team.retum.company.viewmodel.CompaniesState
2516
import team.retum.company.viewmodel.CompaniesViewModel
2617
import team.retum.jobis.company.R
2718
import team.retum.jobisdesignsystemv2.appbar.JobisSmallTopAppBar
19+
import team.retum.jobisdesignsystemv2.empty.EmptyContent
2820
import team.retum.jobisdesignsystemv2.foundation.JobisTheme
29-
import team.retum.jobisdesignsystemv2.foundation.JobisTypography
30-
import team.retum.jobisdesignsystemv2.text.JobisText
3121
import team.retum.jobisdesignsystemv2.textfield.JobisTextField
3222
import team.retum.usecase.entity.CompaniesEntity
3323

@@ -78,36 +68,10 @@ private fun SearchCompaniesScreen(
7868
fetchNextPage = fetchNextPage,
7969
)
8070
if (state.showCompaniesEmptyContent) {
81-
EmptySearchContent()
71+
EmptyContent(
72+
title = stringResource(id = R.string.not_found_company),
73+
description = stringResource(id = R.string.double_check),
74+
)
8275
}
8376
}
8477
}
85-
86-
@Composable
87-
private fun EmptySearchContent() {
88-
Column(
89-
modifier = Modifier
90-
.background(JobisTheme.colors.background)
91-
.fillMaxSize()
92-
.padding(vertical = 160.dp),
93-
horizontalAlignment = Alignment.CenterHorizontally,
94-
) {
95-
Image(
96-
modifier = Modifier.size(128.dp),
97-
painter = painterResource(id = R.drawable.ic_empty_company),
98-
contentDescription = "empty bookmark",
99-
)
100-
Spacer(modifier = Modifier.height(16.dp))
101-
JobisText(
102-
text = stringResource(id = R.string.not_found_company),
103-
style = JobisTypography.HeadLine,
104-
)
105-
Spacer(modifier = Modifier.height(8.dp))
106-
JobisText(
107-
text = stringResource(id = R.string.double_check),
108-
style = JobisTypography.Body,
109-
color = JobisTheme.colors.onSurfaceVariant,
110-
textAlign = TextAlign.Center,
111-
)
112-
}
113-
}

โ€Žfeature/notice/src/main/java/team/retum/jobis/notice/ui/NoticesScreen.ktโ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import team.retum.jobis.notice.viewmodel.NoticesSideEffect
2727
import team.retum.jobis.notice.viewmodel.NoticesViewModel
2828
import team.retum.jobis.notification.R
2929
import team.retum.jobisdesignsystemv2.appbar.JobisSmallTopAppBar
30+
import team.retum.jobisdesignsystemv2.empty.EmptyContent
3031
import team.retum.jobisdesignsystemv2.foundation.JobisIcon
3132
import team.retum.jobisdesignsystemv2.foundation.JobisTheme
3233
import team.retum.jobisdesignsystemv2.foundation.JobisTypography
@@ -93,6 +94,9 @@ private fun NoticesScreen(
9394
)
9495
}
9596
}
97+
if (notices.isEmpty()) {
98+
EmptyContent(title = stringResource(id = R.string.no_notice))
99+
}
96100
}
97101
}
98102

โ€Žfeature/notice/src/main/res/values/string.xmlโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
<string name="failed_download">๋‹ค์šด๋กœ๋“œ์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค</string>
77
<string name="success_download">๋‹ค์šด๋กœ๋“œ๊ฐ€ ์™„๋ฃŒ๋˜์—ˆ์–ด์š”!</string>
88
<string name="open">์—ด๊ธฐ</string>
9+
<string name="no_notice">์•„์ง ๊ณต์ง€์‚ฌํ•ญ์ด ์—†์–ด์š”</string>
910
</resources>

โ€Žfeature/notification/src/main/java/team/retum/notification/ui/NotificationsScreen.ktโ€Ž

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import kotlinx.collections.immutable.ImmutableList
2828
import kotlinx.collections.immutable.toPersistentList
2929
import team.retum.alarm.R
3030
import team.retum.jobisdesignsystemv2.appbar.JobisSmallTopAppBar
31+
import team.retum.jobisdesignsystemv2.empty.EmptyContent
3132
import team.retum.jobisdesignsystemv2.foundation.JobisTheme
3233
import team.retum.jobisdesignsystemv2.foundation.JobisTypography
3334
import team.retum.jobisdesignsystemv2.tab.TabBar
@@ -108,8 +109,7 @@ private fun NotificationsScreen(
108109
onSelectTab = onSelectTab,
109110
)
110111
LazyColumn(
111-
modifier = Modifier
112-
.fillMaxWidth(),
112+
modifier = Modifier.fillMaxWidth(),
113113
) {
114114
items(notificationList) {
115115
NotificationContent(
@@ -122,6 +122,9 @@ private fun NotificationsScreen(
122122
)
123123
}
124124
}
125+
if (notificationList.isEmpty()) {
126+
EmptyContent(title = stringResource(id = R.string.no_notification))
127+
}
125128
}
126129
}
127130

โ€Žfeature/notification/src/main/res/values/strings.xmlโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
<string name="recruitment_notification">๋ชจ์ง‘์˜๋ขฐ์„œ ์•Œ๋ฆผ</string>
1515
<string name="cannot_current_notification_status">์„ค์ •๋œ ์•Œ๋ฆผ์„ ๊ฐ€์ ธ์˜ค์ง€ ๋ชปํ–ˆ์–ด์š”</string>
1616
<string name="change_notification_fail">์•Œ๋ฆผ์„ ๋ณ€๊ฒฝ์— ์‹คํŒจํ–ˆ์–ด์š”</string>
17+
<string name="no_notification">์•„์ง ์•Œ๋ฆผ์ด ์—†์–ด์š”</string>
1718
</resources>

โ€Žfeature/recruitment/src/main/java/team/retum/jobis/recruitment/ui/SearchRecruitmentScreen.ktโ€Ž

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
package team.retum.jobis.recruitment.ui
22

3-
import androidx.compose.foundation.Image
43
import androidx.compose.foundation.background
5-
import androidx.compose.foundation.layout.Arrangement
64
import androidx.compose.foundation.layout.Column
7-
import androidx.compose.foundation.layout.Spacer
85
import androidx.compose.foundation.layout.fillMaxSize
9-
import androidx.compose.foundation.layout.height
10-
import androidx.compose.foundation.layout.padding
11-
import androidx.compose.foundation.layout.size
126
import androidx.compose.runtime.Composable
137
import androidx.compose.runtime.getValue
14-
import androidx.compose.ui.Alignment
158
import androidx.compose.ui.Modifier
16-
import androidx.compose.ui.res.painterResource
179
import androidx.compose.ui.res.stringResource
18-
import androidx.compose.ui.unit.dp
1910
import androidx.hilt.navigation.compose.hiltViewModel
2011
import androidx.lifecycle.compose.collectAsStateWithLifecycle
2112
import kotlinx.collections.immutable.ImmutableList
@@ -25,10 +16,9 @@ import team.retum.jobis.recruitment.ui.component.RecruitmentItems
2516
import team.retum.jobis.recruitment.viewmodel.RecruitmentViewModel
2617
import team.retum.jobis.recruitment.viewmodel.RecruitmentsState
2718
import team.retum.jobisdesignsystemv2.appbar.JobisSmallTopAppBar
19+
import team.retum.jobisdesignsystemv2.empty.EmptyContent
2820
import team.retum.jobisdesignsystemv2.foundation.JobisIcon
2921
import team.retum.jobisdesignsystemv2.foundation.JobisTheme
30-
import team.retum.jobisdesignsystemv2.foundation.JobisTypography
31-
import team.retum.jobisdesignsystemv2.text.JobisText
3222
import team.retum.jobisdesignsystemv2.textfield.JobisTextField
3323
import team.retum.usecase.entity.RecruitmentsEntity
3424

@@ -83,38 +73,9 @@ private fun SearchRecruitmentScreen(
8373
fetchNextPage = fetchNextPage,
8474
)
8575
if (state.showRecruitmentsEmptyContent) {
86-
EmptyRecruitmentContent()
87-
}
88-
}
89-
}
90-
91-
@Composable
92-
private fun EmptyRecruitmentContent() {
93-
Column(
94-
modifier = Modifier
95-
.fillMaxSize()
96-
.padding(bottom = 80.dp),
97-
verticalArrangement = Arrangement.Center,
98-
horizontalAlignment = Alignment.CenterHorizontally,
99-
) {
100-
Image(
101-
modifier = Modifier.size(128.dp),
102-
painter = painterResource(id = R.drawable.ic_empty_company),
103-
contentDescription = "empty recruitment",
104-
)
105-
Spacer(modifier = Modifier.height(16.dp))
106-
Column(
107-
horizontalAlignment = Alignment.CenterHorizontally,
108-
verticalArrangement = Arrangement.spacedBy(4.dp),
109-
) {
110-
JobisText(
111-
text = stringResource(id = R.string.recruitment_no_content),
112-
style = JobisTypography.HeadLine,
113-
)
114-
JobisText(
115-
text = stringResource(id = R.string.retry),
116-
style = JobisTypography.Body,
117-
color = JobisTheme.colors.onSurfaceVariant,
76+
EmptyContent(
77+
title = stringResource(id = R.string.recruitment_no_content),
78+
description = stringResource(id = R.string.retry),
11879
)
11980
}
12081
}

0 commit comments

Comments
ย (0)