Skip to content

firebase/soracard #861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a8e88ec
soracard
PankraSerg Mar 3, 2023
2c24d61
soracard PR fix
PankraSerg Mar 9, 2023
cf71a37
soracard fix
PankraSerg Mar 9, 2023
ba2868b
soracard's related readme updates
PankraSerg Mar 14, 2023
613b85e
FLW-2866 Sora card. Create info + KYC start point screen: logic updates
PankraSerg Mar 14, 2023
cddf2f0
soracard wip. update card status
PankraSerg Mar 17, 2023
c6ed226
fix rebase
PankraSerg Mar 17, 2023
0d80d0b
fix webview update bug
Mar 20, 2023
eb7c4ce
FLW-3151 Sora Card. We need to put the text line on the centre
PankraSerg Mar 20, 2023
12a24a4
versions update, fixes
PankraSerg Mar 20, 2023
83de016
FLW-3165 Sora Card. We need to delete ISSUE CARD FOR 12 $ button
PankraSerg Mar 20, 2023
dd4e687
FLW-3166 Sora Card. There is a mistake on the text
PankraSerg Mar 20, 2023
14fca3d
FLW-3158 Error appears after tapping on SORA asset: allow asset null …
PankraSerg Mar 20, 2023
34e3237
FLW-3157 SORA Card. Eternal loader freezes after closing pop-up succe…
PankraSerg Mar 20, 2023
010280d
FLW-3152 Sora Card. Sometimes we can see error status: Add cache to g…
PankraSerg Mar 21, 2023
3f7e656
FLW-3155 Sora Card. Sora card button doesn’t work on the settings screen
PankraSerg Mar 21, 2023
bbd5771
FLW-3168 Sora Card. X1. The e-mail field covered by keyboard
PankraSerg Mar 21, 2023
b429da1
FLW-3153 Sora Card. The cross should be red
PankraSerg Mar 21, 2023
9ae93c3
FLW-3153 Sora Card. UI updates
PankraSerg Mar 21, 2023
7cffd65
FLW-3173 Sora Card. There is wrong background colour: force dark them…
PankraSerg Mar 23, 2023
db8aa72
code clean
PankraSerg Mar 23, 2023
00b247b
update versions sora related; x1 black background
PankraSerg Mar 24, 2023
a975f7a
firebase + test crash
PankraSerg Mar 24, 2023
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
Prev Previous commit
Next Next commit
FLW-3153 Sora Card. UI updates
  • Loading branch information
PankraSerg committed Mar 22, 2023
commit 9ae93c3a53334692581ad00400992c1e2af54cbe
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jp.co.soramitsu.common.compose.component

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.RowScope
Expand All @@ -23,6 +24,7 @@ import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.compose.theme.FearlessTheme
import jp.co.soramitsu.common.compose.theme.accentButtonColors
import jp.co.soramitsu.common.compose.theme.colorAccent
import jp.co.soramitsu.common.compose.theme.colorAccentDark
import jp.co.soramitsu.common.compose.theme.customButtonColors
import jp.co.soramitsu.common.compose.theme.customTypography
import jp.co.soramitsu.common.compose.theme.grayButtonBackground
Expand All @@ -48,6 +50,11 @@ fun GrayButton(text: String, enabled: Boolean = true, modifier: Modifier = Modif
TextButton(text = text, enabled = enabled, colors = customButtonColors(grayButtonBackground), modifier = modifier, onClick = onClick)
}

@Composable
fun TransparentButton(text: String, enabled: Boolean = true, modifier: Modifier = Modifier, onClick: () -> Unit) {
TextButton(text = text, enabled = enabled, colors = customButtonColors(Color.Unspecified, colorAccentDark), modifier = modifier, onClick = onClick)
}

@Composable
fun TextButton(
text: String,
Expand Down Expand Up @@ -179,7 +186,7 @@ fun ShapeButton(
@Preview
fun ButtonPreview() {
FearlessTheme {
Column(modifier = Modifier.padding(16.dp)) {
Column(modifier = Modifier.padding(16.dp).background(Color.Black)) {
AccentButton(
"Start staking",
modifier = Modifier
Expand Down Expand Up @@ -214,6 +221,12 @@ fun ButtonPreview() {
colors = customButtonColors(colorAccent),
onClick = {}
)
MarginVertical(margin = 16.dp)
TransparentButton(
modifier = Modifier.height(52.dp),
text = stringResource(id = R.string.staking_redeem),
onClick = {}
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,12 @@ import jp.co.soramitsu.common.compose.component.MarginHorizontal
import jp.co.soramitsu.common.compose.component.MarginVertical
import jp.co.soramitsu.common.compose.component.Toolbar
import jp.co.soramitsu.common.compose.component.ToolbarViewState
import jp.co.soramitsu.common.compose.component.TransparentButton
import jp.co.soramitsu.common.compose.theme.errorRed
import jp.co.soramitsu.common.compose.theme.fearlessMaterialColors
import jp.co.soramitsu.common.utils.format
import jp.co.soramitsu.feature_soracard_impl.R
import jp.co.soramitsu.soracard.api.presentation.models.SoraCardInfo
import jp.co.soramitsu.ui_core.component.button.TextButton
import jp.co.soramitsu.ui_core.component.button.properties.Order
import jp.co.soramitsu.ui_core.component.button.properties.Size
import jp.co.soramitsu.ui_core.component.text.HtmlText
import jp.co.soramitsu.ui_core.resources.Dimens
import jp.co.soramitsu.ui_core.theme.borderRadius
Expand Down Expand Up @@ -125,7 +123,7 @@ fun GetSoraCardScreen(
modifier = Modifier
.fillMaxSize()
.background(color = Color(0xFF1D1D1F))
.padding(Dimens.x2)
.padding(16.dp)
) {
Image(
modifier = Modifier
Expand All @@ -136,36 +134,42 @@ fun GetSoraCardScreen(
contentScale = ContentScale.FillWidth
)

MarginVertical(margin = 16.dp)
Text(
modifier = Modifier
.fillMaxWidth()
.padding(top = Dimens.x2, start = Dimens.x1, end = Dimens.x1),
.padding(horizontal = 8.dp),
text = stringResource(R.string.sora_card_title),
style = MaterialTheme.customTypography.headline2,
color = Color.White
)

MarginVertical(margin = 16.dp)
Text(
modifier = Modifier
.fillMaxWidth()
.padding(top = Dimens.x2, start = Dimens.x1, end = Dimens.x1),
.padding(horizontal = 8.dp),
text = stringResource(R.string.sora_card_description),
style = MaterialTheme.customTypography.paragraphM,
color = Color.White
)

MarginVertical(margin = 16.dp)
AnnualFee()

MarginVertical(margin = 16.dp)
FreeCardIssuance(state)

MarginVertical(margin = 16.dp)
BlacklistedCountries(onSeeListClicked = callbacks::onSeeBlacklist)

MarginVertical(margin = 16.dp)
if (state.enoughXor) {
AccentButton(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = Dimens.x2, horizontal = Dimens.x1)
.height(Size.Large),
.padding(horizontal = 8.dp)
.height(48.dp),
onClick = callbacks::onEnableCard,
text = stringResource(R.string.common_continue)
)
Expand All @@ -174,23 +178,25 @@ fun GetSoraCardScreen(
modifier = Modifier
.fillMaxWidth()
.testTag("GetMoreXor")
.padding(vertical = Dimens.x2, horizontal = Dimens.x1)
.height(Size.Large),
.padding(horizontal = 8.dp)
.height(48.dp),
onClick = callbacks::onGetMoreXor,
text = stringResource(R.string.sora_card_get_more_xor)
)
}

TextButton(
MarginVertical(margin = 8.dp)
TransparentButton(
modifier = Modifier
.testTag("AlreadyHaveCard")
.fillMaxWidth()
.padding(start = Dimens.x1, end = Dimens.x1, bottom = Dimens.x2),
.padding(horizontal = 8.dp)
.height(48.dp),
text = stringResource(R.string.sora_card_already_have_card),
size = Size.Large,
order = Order.PRIMARY,
onClick = callbacks::onAlreadyHaveCard
)

MarginVertical(margin = 8.dp)
}
}
}
Expand All @@ -206,7 +212,7 @@ private fun BlacklistedCountries(
HtmlText(
modifier = Modifier
.fillMaxWidth()
.padding(start = Dimens.x1, end = Dimens.x1, top = Dimens.x2),
.padding(horizontal = 8.dp),
text = stringResource(R.string.sora_card_blacklisted_countires_warning),
style = MaterialTheme.customTypography.paragraphXS.copy(
textAlign = TextAlign.Center,
Expand All @@ -223,7 +229,7 @@ private fun AnnualFee() {
Card(
modifier = Modifier
.fillMaxWidth()
.padding(top = Dimens.x2, start = Dimens.x1, end = Dimens.x1),
.padding(horizontal = 8.dp),
cornerRadius = 12.dp,
backgroundColor = Color(0xFF131313),
elevation = 0.dp
Expand Down Expand Up @@ -260,7 +266,7 @@ private fun FreeCardIssuance(
Card(
modifier = Modifier
.fillMaxWidth()
.padding(top = Dimens.x2, start = Dimens.x1, end = Dimens.x1),
.padding(horizontal = 8.dp),
cornerRadius = 12.dp,
backgroundColor = Color(0xFF131313),
elevation = 0.dp
Expand Down