Skip to content

Commit

Permalink
[FEAT/#313] 정렬기준 버튼 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyobeen-Park committed Jan 4, 2025
1 parent 5c82936 commit b786182
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.terning.core.designsystem.component.button

import androidx.compose.foundation.Image
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
Expand All @@ -11,11 +12,13 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.unit.dp
import com.terning.core.designsystem.R
import com.terning.core.designsystem.extension.noRippleClickable
import com.terning.core.designsystem.theme.Black
import com.terning.core.designsystem.theme.Grey350
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.designsystem.type.SortBy
Expand All @@ -27,36 +30,31 @@ fun SortingButton(
onCLick: () -> Unit,
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier
.border(
width = 1.dp,
color = Grey350,
shape = RoundedCornerShape(5.dp)
)
.noRippleClickable(onCLick),
) {
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_down_18),
contentDescription = stringResource(id = R.string.sort_button_description),
tint = Grey350,
modifier = Modifier
.padding(
start = 7.dp,
end = 6.dp,
top = 5.dp,
bottom = 5.dp,
)
.size(20.dp)
)
Text(
text = stringResource(
id = SortBy.entries[sortBy].sortBy
),
style = TerningTheme.typography.button3,
color = Grey350,
color = Black,
modifier = Modifier
.padding(
top = 6.dp,
bottom = 6.dp,
)
)
Image(
painter = painterResource(id = R.drawable.ic_down_18),
contentDescription = stringResource(id = R.string.sort_button_description),
modifier = Modifier
.padding(end = 11.dp)
.padding(
start = 2.dp,
end = 2.dp,
top = 6.dp,
bottom = 4.dp,
)
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import com.terning.feature.dialog.cancel.ScrapCancelDialog
import com.terning.feature.dialog.detail.ScrapDialog
import com.terning.feature.home.component.HomeFilteringScreen
import com.terning.feature.home.component.HomeRecommendEmptyIntern
import com.terning.feature.home.component.HomeSortingButton
import com.terning.feature.home.component.HomeUpcomingEmptyFilter
import com.terning.feature.home.component.HomeUpcomingEmptyIntern
import com.terning.feature.home.component.HomeUpcomingInternScreen
Expand Down Expand Up @@ -308,7 +309,7 @@ fun HomeScreen(
)
}
Spacer(modifier = Modifier.weight(1f))
SortingButton(
HomeSortingButton(
sortBy = homeState.sortBy.ordinal,
onCLick = { updateSortingSheetVisibility(true) },
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package com.terning.feature.home.component

import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Row
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.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.unit.dp
import com.terning.core.designsystem.R
import com.terning.core.designsystem.extension.noRippleClickable
import com.terning.core.designsystem.theme.Grey350
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.designsystem.type.SortBy

@Composable
internal fun HomeSortingButton(
modifier: Modifier = Modifier,
sortBy: Int = 0,
onCLick: () -> Unit,
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier
.border(
width = 1.dp,
color = Grey350,
shape = RoundedCornerShape(5.dp)
)
.noRippleClickable(onCLick),
) {
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_down_18),
contentDescription = stringResource(id = R.string.sort_button_description),
tint = Grey350,
modifier = Modifier
.padding(
start = 7.dp,
end = 6.dp,
top = 5.dp,
bottom = 5.dp,
)
.size(20.dp)
)
Text(
text = stringResource(
id = SortBy.entries[sortBy].sortBy
),
style = TerningTheme.typography.button3,
color = Grey350,
modifier = Modifier
.padding(end = 11.dp)
)
}
}

0 comments on commit b786182

Please sign in to comment.