-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CHORE] #14 ModifyBottomSheet, RemoveItemBottomSheet를 PokitBottomShee…
…t 를 포함하지 않는 방식으로 수정
- Loading branch information
Showing
6 changed files
with
137 additions
and
177 deletions.
There are no files selected for viewing
49 changes: 0 additions & 49 deletions
49
...n/java/pokitmons/pokit/core/ui/components/template/modifybottomsheet/ModifyBottomSheet.kt
This file was deleted.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
...pokitmons/pokit/core/ui/components/template/modifybottomsheet/ModifyBottomSheetContent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package pokitmons.pokit.core.ui.components.template.modifybottomsheet | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.res.stringResource | ||
import pokitmons.pokit.core.ui.R | ||
import pokitmons.pokit.core.ui.components.template.modifybottomsheet.subcomponents.ModifyBottomSheetItem | ||
|
||
@Composable | ||
fun ModifyBottomSheetContent( | ||
onClickShare: (() -> Unit)? = null, | ||
onClickModify: (() -> Unit)? = null, | ||
onClickRemove: (() -> Unit)? = null, | ||
) { | ||
Column( | ||
modifier = Modifier.fillMaxWidth() | ||
) { | ||
onClickShare?.let { onClickShare -> | ||
ModifyBottomSheetItem( | ||
onClick = {}, | ||
title = stringResource(id = R.string.share), | ||
painter = painterResource(id = R.drawable.icon_24_share) | ||
) | ||
} | ||
|
||
onClickModify?.let { onClickModify -> | ||
ModifyBottomSheetItem( | ||
onClick = onClickModify, | ||
title = stringResource(id = R.string.modify), | ||
painter = painterResource(id = R.drawable.icon_24_edit) | ||
) | ||
} | ||
|
||
onClickRemove?.let { onClickRemove -> | ||
ModifyBottomSheetItem( | ||
onClick = onClickRemove, | ||
title = stringResource(id = R.string.remove), | ||
painter = painterResource(id = R.drawable.icon_24_trash) | ||
) | ||
} | ||
} | ||
} |
27 changes: 6 additions & 21 deletions
27
...ui/src/main/java/pokitmons/pokit/core/ui/components/template/modifybottomsheet/Preview.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,22 @@ | ||
package pokitmons.pokit.core.ui.components.template.modifybottomsheet | ||
|
||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.Surface | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import pokitmons.pokit.core.ui.theme.PokitTheme | ||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
private fun ModifyBottomSheetPreview() { | ||
var showBottomSheet by remember { mutableStateOf(false) } | ||
|
||
private fun ModifyBottomSheetContentPreview() { | ||
PokitTheme { | ||
Surface(modifier = Modifier.fillMaxSize()) { | ||
Button(onClick = { showBottomSheet = true }) { | ||
Text(text = "Click!") | ||
} | ||
|
||
if (showBottomSheet) { | ||
ModifyBottomSheet( | ||
onHideBottomSheet = {}, | ||
onClickRemove = {}, | ||
onClickModify = {}, | ||
onClickShare = {} | ||
) | ||
} | ||
ModifyBottomSheetContent( | ||
onClickRemove = {}, | ||
onClickModify = {}, | ||
onClickShare = {} | ||
) | ||
} | ||
} | ||
} |
29 changes: 6 additions & 23 deletions
29
...rc/main/java/pokitmons/pokit/core/ui/components/template/removeItemBottomSheet/Preview.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,23 @@ | ||
package pokitmons.pokit.core.ui.components.template.removeItemBottomSheet | ||
|
||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.Surface | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import pokitmons.pokit.core.ui.components.template.removeItemBottomSheet.attributes.RemoveItemType | ||
import pokitmons.pokit.core.ui.theme.PokitTheme | ||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
private fun RemoveItemBottomSheetPreview() { | ||
var showBottomSheet by remember { mutableStateOf(false) } | ||
|
||
private fun RemoveItemBottomSheetContentPreview() { | ||
PokitTheme { | ||
Surface(modifier = Modifier.fillMaxSize()) { | ||
Button(onClick = { showBottomSheet = true }) { | ||
Text(text = "Click!") | ||
} | ||
|
||
if (showBottomSheet) { | ||
RemoveItemBottomSheet( | ||
removeItemType = RemoveItemType.LINK, | ||
onHideBottomSheet = remember { | ||
{ showBottomSheet = false } | ||
}, | ||
onClickCancel = {}, | ||
onClickRemove = {} | ||
) | ||
} | ||
RemoveItemBottomSheetContent( | ||
removeItemType = RemoveItemType.LINK, | ||
onClickCancel = {}, | ||
onClickRemove = {} | ||
) | ||
} | ||
} | ||
} |
84 changes: 0 additions & 84 deletions
84
...okitmons/pokit/core/ui/components/template/removeItemBottomSheet/RemoveItemBottomSheet.kt
This file was deleted.
Oops, something went wrong.
80 changes: 80 additions & 0 deletions
80
...s/pokit/core/ui/components/template/removeItemBottomSheet/RemoveItemBottomSheetContent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package pokitmons.pokit.core.ui.components.template.removeItemBottomSheet | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.unit.dp | ||
import pokitmons.pokit.core.ui.R | ||
import pokitmons.pokit.core.ui.components.atom.button.PokitButton | ||
import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonShape | ||
import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonSize | ||
import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonStyle | ||
import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonType | ||
import pokitmons.pokit.core.ui.components.template.removeItemBottomSheet.attributes.RemoveItemType | ||
import pokitmons.pokit.core.ui.theme.PokitTheme | ||
|
||
@Composable | ||
fun RemoveItemBottomSheetContent( | ||
removeItemType: RemoveItemType, | ||
onClickCancel: () -> Unit, | ||
onClickRemove: () -> Unit, | ||
) { | ||
Column( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(top = 36.dp, start = 20.dp, end = 20.dp, bottom = 20.dp), | ||
horizontalAlignment = Alignment.CenterHorizontally | ||
) { | ||
Text( | ||
text = stringResource(id = removeItemType.titleStringResourceId), | ||
style = PokitTheme.typography.title2.copy(color = PokitTheme.colors.textPrimary) | ||
) | ||
|
||
Spacer(modifier = Modifier.height(8.dp)) | ||
|
||
Text( | ||
text = stringResource(id = removeItemType.subStringResourceId), | ||
style = PokitTheme.typography.body2Medium.copy(color = PokitTheme.colors.textSecondary), | ||
textAlign = TextAlign.Center | ||
) | ||
} | ||
|
||
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(top = 16.dp, start = 20.dp, end = 20.dp, bottom = 28.dp), | ||
horizontalArrangement = Arrangement.spacedBy(8.dp) | ||
) { | ||
PokitButton( | ||
text = stringResource(id = R.string.cancellation), | ||
icon = null, | ||
onClick = onClickCancel, | ||
shape = PokitButtonShape.RECTANGLE, | ||
type = PokitButtonType.SECONDARY, | ||
size = PokitButtonSize.LARGE, | ||
style = PokitButtonStyle.STROKE, | ||
modifier = Modifier.weight(1f) | ||
) | ||
|
||
PokitButton( | ||
text = stringResource(id = R.string.removal), | ||
icon = null, | ||
onClick = onClickRemove, | ||
shape = PokitButtonShape.RECTANGLE, | ||
type = PokitButtonType.PRIMARY, | ||
size = PokitButtonSize.LARGE, | ||
style = PokitButtonStyle.FILLED, | ||
modifier = Modifier.weight(1f) | ||
) | ||
} | ||
} |