Skip to content

Commit

Permalink
fix: Address PR comments - 2
Browse files Browse the repository at this point in the history
- Update Button's prefixe
  • Loading branch information
omerhabib26 committed Oct 7, 2024
1 parent 9c346e9 commit ba57763
Show file tree
Hide file tree
Showing 31 changed files with 168 additions and 155 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ import org.openedx.core.R
import org.openedx.core.UIMessage
import org.openedx.core.presentation.global.app_upgrade.AppUpgradeRequiredScreen
import org.openedx.core.ui.BackBtn
import org.openedx.core.ui.BrandButton
import org.openedx.core.ui.HandleUIMessage
import org.openedx.core.ui.OpenEdXBrandButton
import org.openedx.core.ui.WindowSize
import org.openedx.core.ui.WindowType
import org.openedx.core.ui.displayCutoutForLandscape
Expand Down Expand Up @@ -297,7 +297,7 @@ private fun RestorePasswordScreen(
CircularProgressIndicator(color = MaterialTheme.appColors.primary)
}
} else {
BrandButton(
OpenEdXBrandButton(
modifier = buttonWidth,
text = stringResource(id = authR.string.auth_reset_password),
onClick = {
Expand Down Expand Up @@ -350,7 +350,7 @@ private fun RestorePasswordScreen(
color = MaterialTheme.appColors.textPrimary
)
Spacer(Modifier.height(48.dp))
BrandButton(
OpenEdXBrandButton(
modifier = buttonWidth,
text = stringResource(id = R.string.core_sign_in),
onClick = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ import org.openedx.auth.presentation.ui.SocialAuthView
import org.openedx.core.UIMessage
import org.openedx.core.extension.TextConverter
import org.openedx.core.ui.BackBtn
import org.openedx.core.ui.BrandButton
import org.openedx.core.ui.HandleUIMessage
import org.openedx.core.ui.HyperlinkText
import org.openedx.core.ui.OpenEdXBrandButton
import org.openedx.core.ui.WindowSize
import org.openedx.core.ui.WindowType
import org.openedx.core.ui.displayCutoutForLandscape
Expand Down Expand Up @@ -292,7 +292,7 @@ private fun AuthForm(
if (state.showProgress) {
CircularProgressIndicator(color = MaterialTheme.appColors.primary)
} else {
BrandButton(
OpenEdXBrandButton(
modifier = buttonWidth,
text = stringResource(id = coreR.string.core_sign_in),
onClick = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ import org.openedx.core.UIMessage
import org.openedx.core.domain.model.RegistrationField
import org.openedx.core.domain.model.RegistrationFieldType
import org.openedx.core.ui.BackBtn
import org.openedx.core.ui.BrandButton
import org.openedx.core.ui.HandleUIMessage
import org.openedx.core.ui.OpenEdXBrandButton
import org.openedx.core.ui.SheetContent
import org.openedx.core.ui.WindowSize
import org.openedx.core.ui.WindowType
Expand Down Expand Up @@ -436,7 +436,7 @@ internal fun SignUpView(
CircularProgressIndicator(color = MaterialTheme.appColors.primary)
}
} else {
BrandButton(
OpenEdXBrandButton(
modifier = buttonWidth,
text = stringResource(id = R.string.auth_create_account),
onClick = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.openedx.auth.R
import org.openedx.auth.data.model.AuthType
import org.openedx.core.ui.BrandButton
import org.openedx.core.ui.OpenEdXBrandButton
import org.openedx.core.ui.theme.OpenEdXTheme
import org.openedx.core.ui.theme.appColors

Expand All @@ -43,7 +43,7 @@ internal fun SocialAuthView(
} else {
R.string.auth_continue_google
}
BrandButton(
OpenEdXBrandButton(
backgroundColor = MaterialTheme.appColors.authGoogleButtonBackground,
onClick = { onEvent(AuthType.GOOGLE) }
) {
Expand All @@ -67,7 +67,7 @@ internal fun SocialAuthView(
} else {
R.string.auth_continue_facebook
}
BrandButton(
OpenEdXBrandButton(
backgroundColor = MaterialTheme.appColors.authFacebookButtonBackground,
onClick = { onEvent(AuthType.FACEBOOK) }
) {
Expand All @@ -93,7 +93,7 @@ internal fun SocialAuthView(
} else {
R.string.auth_continue_microsoft
}
BrandButton(
OpenEdXBrandButton(
backgroundColor = MaterialTheme.appColors.authMicrosoftButtonBackground,
onClick = { onEvent(AuthType.MICROSOFT) }
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ import org.openedx.core.presentation.iap.IAPLoaderType
import org.openedx.core.presentation.iap.IAPRequestType
import org.openedx.core.presentation.iap.IAPUIState
import org.openedx.core.presentation.iap.IAPViewModel
import org.openedx.core.ui.BrandButton
import org.openedx.core.ui.HandleUIMessage
import org.openedx.core.ui.IAPErrorDialog
import org.openedx.core.ui.OpenEdXBrandButton
import org.openedx.core.ui.UnlockingAccessView
import org.openedx.core.ui.ValuePropUpgradeFeatures
import org.openedx.core.ui.theme.OpenEdXTheme
Expand Down Expand Up @@ -110,7 +110,7 @@ class IAPDialogFragment : DialogFragment() {
iapState is IAPUIState.ProductData &&
iapViewModel.purchaseData.formattedPrice.isNullOrEmpty()
.not() -> {
BrandButton(
OpenEdXBrandButton(
text = stringResource(
id = R.string.iap_upgrade_price,
iapViewModel.purchaseData.formattedPrice!!,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ 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.layout.wrapContentSize
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
Expand All @@ -37,7 +36,7 @@ import org.openedx.core.config.Config
import org.openedx.core.presentation.CoreAnalytics
import org.openedx.core.presentation.CoreAnalyticsEvent
import org.openedx.core.presentation.CoreAnalyticsKey
import org.openedx.core.ui.TertiaryButton
import org.openedx.core.ui.OpenEdXTertiaryButton
import org.openedx.core.ui.theme.OpenEdXTheme
import org.openedx.core.ui.theme.appColors
import org.openedx.core.ui.theme.appShapes
Expand Down Expand Up @@ -168,12 +167,12 @@ private fun ActionDialog(
style = MaterialTheme.appTypography.bodyMedium
)
Row {
TertiaryButton(
OpenEdXTertiaryButton(
text = stringResource(R.string.core_cancel),
onClick = onPositiveClick
)
Spacer(modifier = Modifier.size(16.dp))
TertiaryButton(
OpenEdXTertiaryButton(
text = stringResource(R.string.core_continue),
onClick = onNegativeClick
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import androidx.compose.ui.unit.dp
import androidx.core.os.bundleOf
import androidx.fragment.app.DialogFragment
import org.openedx.core.R
import org.openedx.core.ui.TertiaryButton
import org.openedx.core.ui.OpenEdXTertiaryButton
import org.openedx.core.ui.theme.OpenEdXTheme
import org.openedx.core.ui.theme.appColors
import org.openedx.core.ui.theme.appShapes
Expand Down Expand Up @@ -109,7 +109,7 @@ private fun InfoDialog(
textAlign = TextAlign.Center,
style = MaterialTheme.appTypography.bodyMedium
)
TertiaryButton(
OpenEdXTertiaryButton(
text = stringResource(R.string.core_ok),
onClick = onClick
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.OutlinedTextField
Expand Down Expand Up @@ -47,7 +46,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.openedx.core.R
import org.openedx.core.presentation.dialog.DefaultDialogBox
import org.openedx.core.ui.TertiaryButton
import org.openedx.core.ui.OpenEdXTertiaryButton
import org.openedx.core.ui.theme.OpenEdXTheme
import org.openedx.core.ui.theme.appColors
import org.openedx.core.ui.theme.appShapes
Expand Down Expand Up @@ -102,11 +101,11 @@ fun ThankYouDialog(
Row(
horizontalArrangement = Arrangement.spacedBy(24.dp)
) {
TertiaryButton(
OpenEdXTertiaryButton(
text = stringResource(id = R.string.core_not_now),
onClick = onNotNowClick
)
TertiaryButton(
OpenEdXTertiaryButton(
text = stringResource(id = R.string.core_rate_us),
onClick = onRateUsClick
)
Expand Down Expand Up @@ -180,11 +179,11 @@ fun FeedbackDialog(
Row(
horizontalArrangement = Arrangement.spacedBy(24.dp)
) {
TertiaryButton(
OpenEdXTertiaryButton(
text = stringResource(id = R.string.core_not_now),
onClick = onNotNowClick
)
TertiaryButton(
OpenEdXTertiaryButton(
enabled = feedback.value.isNotEmpty(),
text = stringResource(id = R.string.core_share_feedback),
onClick = onShareClick
Expand Down Expand Up @@ -234,11 +233,11 @@ fun RateDialog(
Row(
horizontalArrangement = Arrangement.spacedBy(24.dp)
) {
TertiaryButton(
OpenEdXTertiaryButton(
text = stringResource(id = R.string.core_not_now),
onClick = onNotNowClick
)
TertiaryButton(
OpenEdXTertiaryButton(
enabled = rating.intValue > 0,
text = stringResource(id = R.string.core_submit),
onClick = onSubmitClick
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ 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.layout.wrapContentSize
import androidx.compose.material.Card
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
Expand All @@ -38,7 +37,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.openedx.core.R
import org.openedx.core.ui.TertiaryButton
import org.openedx.core.ui.OpenEdXTertiaryButton
import org.openedx.core.ui.noRippleClickable
import org.openedx.core.ui.statusBarsInset
import org.openedx.core.ui.theme.OpenEdXTheme
Expand Down Expand Up @@ -227,12 +226,12 @@ fun AppUpgradeRequiredButtons(
horizontalArrangement = Arrangement.spacedBy(24.dp)
) {
if (showAccountSettingsButton) {
TertiaryButton(
OpenEdXTertiaryButton(
text = stringResource(id = R.string.core_account_settings),
onClick = onAccountSettingsClick
)
}
TertiaryButton(
OpenEdXTertiaryButton(
text = stringResource(id = R.string.core_update),
onClick = onUpdateClick
)
Expand All @@ -247,11 +246,11 @@ fun AppUpgradeDialogButtons(
Row(
horizontalArrangement = Arrangement.spacedBy(24.dp)
) {
TertiaryButton(
OpenEdXTertiaryButton(
text = stringResource(id = R.string.core_not_now),
onClick = onNotNowClick
)
TertiaryButton(
OpenEdXTertiaryButton(
text = stringResource(id = R.string.core_update),
onClick = onUpdateClick
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import org.openedx.core.R
import org.openedx.core.extension.takeIfNotEmpty
import org.openedx.core.ui.TertiaryButton
import org.openedx.core.ui.OpenEdXTertiaryButton
import org.openedx.core.ui.theme.OpenEdXTheme
import org.openedx.core.ui.theme.appColors
import org.openedx.core.ui.theme.appShapes
Expand Down Expand Up @@ -151,7 +151,7 @@ private fun CalendarAlertDialog(dialogProperties: DialogProperties, onDismiss: (
)
},
confirmButton = {
TertiaryButton(
OpenEdXTertiaryButton(
text = dialogProperties.positiveButton,
onClick = {
onDismiss()
Expand All @@ -160,7 +160,7 @@ private fun CalendarAlertDialog(dialogProperties: DialogProperties, onDismiss: (
)
},
dismissButton = {
TertiaryButton(
OpenEdXTertiaryButton(
text = dialogProperties.negativeButton,
onClick = {
onDismiss()
Expand Down
Loading

0 comments on commit ba57763

Please sign in to comment.