Change account oauth feature to theme 2

This commit is contained in:
Wolf-Martell Montwé 2024-04-22 16:33:22 +02:00
parent f3755502fb
commit c4a0219903
No known key found for this signature in database
GPG key ID: 6D45B21512ACBF72
6 changed files with 71 additions and 69 deletions

View file

@ -0,0 +1,16 @@
package app.k9mail.feature.account.oauth.ui
import androidx.compose.runtime.Composable
import app.k9mail.core.ui.compose.common.annotation.PreviewDevices
import app.k9mail.core.ui.compose.designsystem.PreviewWithTheme
@Composable
@PreviewDevices
internal fun AccountOAuthContentPreview() {
PreviewWithTheme {
AccountOAuthContent(
state = AccountOAuthContract.State(),
onEvent = {},
)
}
}

View file

@ -0,0 +1,27 @@
package app.k9mail.feature.account.oauth.ui.view
import androidx.compose.runtime.Composable
import app.k9mail.core.ui.compose.common.annotation.PreviewDevices
import app.k9mail.core.ui.compose.designsystem.PreviewWithTheme
@PreviewDevices
@Composable
internal fun SignInViewPreview() {
PreviewWithTheme {
SignInView(
onSignInClick = {},
isGoogleSignIn = false,
)
}
}
@PreviewDevices
@Composable
internal fun SignInViewWithGooglePreview() {
PreviewWithTheme {
SignInView(
onSignInClick = {},
isGoogleSignIn = true,
)
}
}

View file

@ -0,0 +1,26 @@
package app.k9mail.feature.account.oauth.ui.view
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.designsystem.PreviewWithThemes
@Composable
@Preview(showBackground = true)
internal fun SignInWithGoogleButtonPreview() {
PreviewWithThemes {
SignInWithGoogleButton(
onClick = {},
)
}
}
@Composable
@Preview(showBackground = true)
internal fun SignInWithGoogleButtonDisabledPreview() {
PreviewWithThemes {
SignInWithGoogleButton(
onClick = {},
enabled = false,
)
}
}

View file

@ -8,12 +8,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import app.k9mail.core.ui.compose.common.annotation.PreviewDevices
import app.k9mail.core.ui.compose.designsystem.molecule.ErrorView
import app.k9mail.core.ui.compose.designsystem.molecule.LoadingView
import app.k9mail.core.ui.compose.theme.K9Theme
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme.ThunderbirdTheme
import app.k9mail.core.ui.compose.theme2.MainTheme
import app.k9mail.feature.account.oauth.R
import app.k9mail.feature.account.oauth.ui.AccountOAuthContract.Event
import app.k9mail.feature.account.oauth.ui.AccountOAuthContract.State
@ -53,25 +50,3 @@ internal fun AccountOAuthContent(
}
}
}
@Composable
@PreviewDevices
internal fun AccountOAuthContentK9Preview() {
K9Theme {
AccountOAuthContent(
state = State(),
onEvent = {},
)
}
}
@Composable
@PreviewDevices
internal fun AccountOAuthContentThunderbirdPreview() {
ThunderbirdTheme {
AccountOAuthContent(
state = State(),
onEvent = {},
)
}
}

View file

@ -7,10 +7,9 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import app.k9mail.core.ui.compose.common.annotation.PreviewDevices
import app.k9mail.core.ui.compose.designsystem.atom.button.ButtonFilled
import app.k9mail.core.ui.compose.designsystem.atom.text.TextBodySmall
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme2.MainTheme
import app.k9mail.feature.account.oauth.R
@Composable
@ -44,21 +43,3 @@ internal fun SignInView(
}
}
}
@PreviewDevices
@Composable
internal fun SignInViewPreview() {
SignInView(
onSignInClick = {},
isGoogleSignIn = false,
)
}
@PreviewDevices
@Composable
internal fun SignInViewWithGooglePreview() {
SignInView(
onSignInClick = {},
isGoogleSignIn = true,
)
}

View file

@ -22,10 +22,8 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
import app.k9mail.feature.account.oauth.R
import androidx.compose.material.Button as MaterialButton
@ -123,24 +121,3 @@ private fun getTextColor(isLight: Boolean): Color {
Color(0xFFFFFFFF)
}
}
@Preview(showBackground = true)
@Composable
internal fun SignInWithGoogleButtonPreview() {
PreviewWithThemes {
SignInWithGoogleButton(
onClick = {},
)
}
}
@Preview(showBackground = true)
@Composable
internal fun SignInWithGoogleButtonDisabledPreview() {
PreviewWithThemes {
SignInWithGoogleButton(
onClick = {},
enabled = false,
)
}
}