Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
package com.neki.android.core.designsystem.dialog

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.widthIn
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.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
Expand Down Expand Up @@ -56,9 +55,9 @@ fun DoubleButtonAlertDialog(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(12.dp),
) {
Icon(
imageVector = ImageVector.vectorResource(R.drawable.icon_dialog_alert),
tint = Color.Unspecified,
Image(
modifier = Modifier.size(64.dp),
painter = painterResource(R.drawable.image_dialog_alert),
contentDescription = null,
)
Column(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
package com.neki.android.core.designsystem.dialog

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.shape.RoundedCornerShape
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.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties
import com.neki.android.core.designsystem.ComponentPreview
import com.neki.android.core.designsystem.button.CTAButtonGray
import com.neki.android.core.designsystem.button.CTAButtonPrimary
import com.neki.android.core.designsystem.ui.theme.NekiTheme

@Composable
fun DoubleButtonDialog(
title: String,
content: String,
grayButtonText: String,
primaryButtonText: String,
onDismissRequest: () -> Unit,
onClickPrimaryButton: () -> Unit,
onClickGrayButton: () -> Unit,
modifier: Modifier = Modifier,
properties: DialogProperties = DialogProperties(
usePlatformDefaultWidth = false,
),
) {
Dialog(
onDismissRequest = onDismissRequest,
properties = properties,
) {
Column(
modifier = modifier
.fillMaxWidth()
.padding(horizontal = 20.dp)
.widthIn(max = 400.dp)
.clip(RoundedCornerShape(20.dp))
.background(NekiTheme.colorScheme.white)
.padding(top = 20.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(12.dp),
) {
Column(
modifier = Modifier.padding(horizontal = 24.dp),
verticalArrangement = Arrangement.spacedBy(4.dp),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text(
text = title,
style = NekiTheme.typography.title18Bold,
color = NekiTheme.colorScheme.gray900,
textAlign = TextAlign.Center,
)
Text(
text = content,
style = NekiTheme.typography.body14Regular,
color = NekiTheme.colorScheme.gray500,
textAlign = TextAlign.Center,
)
}
Row(
modifier = Modifier
.fillMaxWidth()
.padding(12.dp),
horizontalArrangement = Arrangement.spacedBy(10.dp),
) {
CTAButtonGray(
text = grayButtonText,
onClick = onClickGrayButton,
modifier = Modifier.weight(1f),
)
CTAButtonPrimary(
text = primaryButtonText,
onClick = onClickPrimaryButton,
modifier = Modifier.weight(1f),
)
}
}
}
}

@ComponentPreview
@Composable
private fun DoubleButtonDialogPreview() {
NekiTheme {
DoubleButtonDialog(
title = "메인 텍스트가 들어가는 곳",
content = "보조 설명 텍스트가 들어가는 공간입니다",
grayButtonText = "텍스트",
primaryButtonText = "텍스트",
onDismissRequest = {},
onClickPrimaryButton = {},
onClickGrayButton = {},
)
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package com.neki.android.core.designsystem.dialog

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.widthIn
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.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
Expand Down Expand Up @@ -54,9 +53,9 @@ fun SingleButtonAlertDialog(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(12.dp),
) {
Icon(
imageVector = ImageVector.vectorResource(R.drawable.icon_dialog_alert),
tint = Color.Unspecified,
Image(
modifier = Modifier.size(64.dp),
painter = painterResource(R.drawable.image_dialog_alert),
contentDescription = null,
)
Column(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package com.neki.android.core.designsystem.dialog

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.shape.RoundedCornerShape
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.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties
import com.neki.android.core.designsystem.ComponentPreview
import com.neki.android.core.designsystem.button.CTAButtonPrimary
import com.neki.android.core.designsystem.ui.theme.NekiTheme

@Composable
fun SingleButtonDialog(
title: String,
content: String,
buttonText: String,
onDismissRequest: () -> Unit,
onClick: () -> Unit,
enabled: Boolean = true,
properties: DialogProperties = DialogProperties(
usePlatformDefaultWidth = false,
dismissOnBackPress = false,
dismissOnClickOutside = false,
),
) {
Dialog(
onDismissRequest = onDismissRequest,
properties = properties,
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 20.dp)
.widthIn(max = 400.dp)
.clip(RoundedCornerShape(20.dp))
.background(NekiTheme.colorScheme.white)
.padding(top = 20.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(12.dp),
) {
Column(
modifier = Modifier.padding(horizontal = 24.dp),
verticalArrangement = Arrangement.spacedBy(4.dp),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text(
text = title,
style = NekiTheme.typography.title18Bold,
color = NekiTheme.colorScheme.gray900,
textAlign = TextAlign.Center,
)
Text(
text = content,
style = NekiTheme.typography.body14Regular,
color = NekiTheme.colorScheme.gray500,
textAlign = TextAlign.Center,
)
}
CTAButtonPrimary(
text = buttonText,
onClick = onClick,
modifier = Modifier
.fillMaxWidth()
.padding(12.dp),
enabled = enabled,
)
}
}
}

@ComponentPreview
@Composable
private fun SingleButtonDialogPreview() {
NekiTheme {
SingleButtonDialog(
title = "메인 텍스트가 들어가는 곳",
content = "보조 설명 텍스트가 들어가는 공간입니다",
buttonText = "텍스트",
onDismissRequest = {},
onClick = {},
)
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package com.neki.android.core.designsystem.dialog

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.widthIn
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.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -58,9 +57,9 @@ fun SingleButtonWithTextButtonAlertDialog(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(12.dp),
) {
Icon(
imageVector = ImageVector.vectorResource(R.drawable.icon_dialog_alert),
tint = Color.Unspecified,
Image(
modifier = Modifier.size(64.dp),
painter = painterResource(R.drawable.image_dialog_alert),
contentDescription = null,
)
Column(
Expand All @@ -84,7 +83,7 @@ fun SingleButtonWithTextButtonAlertDialog(
Column(
modifier = Modifier.padding(vertical = 12.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(8.dp),
verticalArrangement = Arrangement.spacedBy(4.dp),
) {
CTAButtonPrimary(
text = buttonText,
Expand All @@ -96,11 +95,11 @@ fun SingleButtonWithTextButtonAlertDialog(
)
Text(
modifier = Modifier
.clickableSingle(onClick = onTextButtonClick)
.padding(
vertical = 4.dp,
horizontal = 56.dp,
)
.clickableSingle(onClick = onTextButtonClick),
),
text = textButtonText,
style = NekiTheme.typography.body14Regular,
color = NekiTheme.colorScheme.primary600,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.neki.android.core.designsystem.dialog

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand All @@ -14,8 +15,8 @@ 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.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -62,12 +63,11 @@ fun WarningDialog(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(12.dp),
) {
Icon(
imageVector = ImageVector.vectorResource(R.drawable.icon_dialog_alert),
tint = Color.Unspecified,
Image(
modifier = Modifier.size(64.dp),
painter = painterResource(R.drawable.image_dialog_alert),
contentDescription = null,
)

Text(
text = content,
style = NekiTheme.typography.body14Regular,
Expand Down
10 changes: 0 additions & 10 deletions core/designsystem/src/main/res/drawable/icon_dialog_alert.xml

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading