Skip to content

Commit

Permalink
✨ :: Apply makeToast function
Browse files Browse the repository at this point in the history
  • Loading branch information
diejdkll committed Jun 3, 2024
1 parent f6a260e commit 5c01cf2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.msg.certification

import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
Expand All @@ -23,6 +22,7 @@ import com.msg.design_system.component.button.BitgoeulButton
import com.msg.design_system.component.topbar.DetailSettingTopBar
import com.msg.design_system.theme.color.BitgoeulColor
import com.msg.ui.DevicePreviews
import com.msg.ui.makeToast
import com.msg.ui.util.toKoreanFormat
import java.time.LocalDate

Expand Down Expand Up @@ -99,9 +99,9 @@ internal fun AddCertificationScreen(
text = "자격증 등록",
onClicked = {
if (name.value.isBlank()) {
Toast.makeText(context, "자격증 이름을 입력해주세요", Toast.LENGTH_SHORT).show()
makeToast(context, "자격증 이름을 입력해주세요")
} else if (date.value == null) {
Toast.makeText(context, "취득일을 입력해주세요", Toast.LENGTH_SHORT).show()
makeToast(context, "취득일을 입력해주세요")
} else {
onAddClicked(name.value, date.value!!)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.bitgoeul.email

import android.util.Log
import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -29,6 +28,7 @@ import com.msg.design_system.component.icon.GoBackIcon
import com.msg.design_system.component.topbar.GoBackTopBar
import com.msg.design_system.theme.BitgoeulAndroidTheme
import com.msg.model.remote.response.email.GetEmailAuthenticateStatusResponse
import com.msg.ui.makeToast
import kotlinx.coroutines.launch

@Composable
Expand All @@ -51,10 +51,10 @@ internal fun EmailSendInformRoute(
onSuccess = { response ->
if (response.isAuthentication) {
onMoveNewPasswordClicked()
Toast.makeText(context, "이메일 인증에 성공했습니다.", Toast.LENGTH_SHORT).show()
makeToast(context, "이메일 인증에 성공했습니다.")
}
if (!response.isAuthentication) {
Toast.makeText(context, "이메일 인증에 실패했습니다.", Toast.LENGTH_SHORT).show()
makeToast(context, "이메일 인증에 실패했습니다.")
}
}
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.bitgoeul.email

import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
Expand All @@ -27,6 +26,7 @@ import com.msg.design_system.component.icon.GoBackIcon
import com.msg.design_system.component.textfield.DefaultTextField
import com.msg.design_system.component.topbar.GoBackTopBar
import com.msg.design_system.theme.BitgoeulAndroidTheme
import com.msg.ui.makeToast

@Composable
internal fun InputNewPasswordRoute(
Expand Down Expand Up @@ -134,7 +134,7 @@ internal fun InputNewPasswordScreen(
if (passwordPattern.matches(firstInputPassword.value)) {
onNextClicked(secondInputPassword.value)
} else {
Toast.makeText(context, "비밀번호는 8~24자 영문, 숫자, 특수문자 1개 이상이어야 합니다.", Toast.LENGTH_SHORT).show()
makeToast(context, "비밀번호는 8~24자 영문, 숫자, 특수문자 1개 이상이어야 합니다.")
}
}
)
Expand Down
6 changes: 3 additions & 3 deletions feature/login/src/main/java/com/bitgoeul/login/LoginScreen.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.bitgoeul.login

import android.content.pm.ActivityInfo
import android.widget.Toast
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
Expand Down Expand Up @@ -35,6 +34,7 @@ import com.msg.design_system.theme.BitgoeulAndroidTheme
import com.msg.design_system.util.LockScreenOrientation
import com.msg.design_system.util.checkEmailRegex
import com.msg.design_system.util.checkPasswordRegex
import com.msg.ui.makeToast
import kotlinx.coroutines.launch

@Composable
Expand All @@ -56,11 +56,11 @@ internal fun LoginRoute(
getLoginData(
viewModel = viewModel,
onSuccess = {
Toast.makeText(context, "로그인에 성공하였습니다.", Toast.LENGTH_SHORT).show()
makeToast(context, "로그인에 성공하였습니다.")
onLoginClicked()
},
onFailure = {
Toast.makeText(context, "로그인에 실패하였습니다. 다시 시도해주세요", Toast.LENGTH_SHORT).show()
makeToast(context, "로그인에 실패하였습니다. 다시 시도해주세요")
}
)
}
Expand Down

0 comments on commit 5c01cf2

Please sign in to comment.