Skip to content
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

MOB-266 Launch incentive pixel perfect design, mainly the background image #11

Merged
merged 5 commits into from
Mar 5, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
**/build/spotless
**/build/test-results
**/build/tmp
**/build/gmpAppId.txt
**/build/reports/*
!**/build/reports/lint-results-debug.txt
captures
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
package exchange.dydx.trading.feature.profile.components

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
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.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand All @@ -24,9 +32,11 @@ import exchange.dydx.platformui.components.buttons.PlatformButtonState
import exchange.dydx.platformui.components.icons.PlatformImage
import exchange.dydx.platformui.designSystem.theme.ThemeColor
import exchange.dydx.platformui.designSystem.theme.ThemeFont
import exchange.dydx.platformui.designSystem.theme.ThemeSettings
import exchange.dydx.platformui.designSystem.theme.ThemeShapes
import exchange.dydx.platformui.designSystem.theme.color
import exchange.dydx.platformui.designSystem.theme.dydxDefault
import exchange.dydx.platformui.designSystem.theme.isLightTheme
import exchange.dydx.platformui.designSystem.theme.themeColor
import exchange.dydx.platformui.designSystem.theme.themeFont
import exchange.dydx.trading.common.component.DydxComponent
Expand Down Expand Up @@ -78,7 +88,7 @@ object DydxProfileLaunchIncentivesView : DydxComponent {
Column(
modifier = modifier
.background(
color = exchange.dydx.platformui.designSystem.theme.ThemeColor.SemanticColor.layer_3.color,
color = ThemeColor.SemanticColor.layer_3.color,
shape = RoundedCornerShape(14.dp),
)
.padding(vertical = ThemeShapes.VerticalPadding),
Expand Down Expand Up @@ -187,46 +197,76 @@ object DydxProfileLaunchIncentivesView : DydxComponent {
points: String?,
) {
val seasonText = localizer.localize("APP.LEAGUES.SEASON")
Column(
modifier = modifier
.fillMaxWidth()
.background(
color = ThemeColor.SemanticColor.layer_4.color,
shape = RoundedCornerShape(10.dp),
)
.padding(16.dp),
val clipShape = RoundedCornerShape(10.dp)
Box(
modifier = modifier.fillMaxWidth()
.height(150.dp)
.clip(clipShape)
.border(
width = 1.dp,
color = ThemeColor.SemanticColor.layer_5.color,
shape = clipShape,
),
) {
Text(
text = localizer.localize("APP.PORTFOLIO.ESTIMATED_REWARDS"),
style = TextStyle.dydxDefault
.themeColor(ThemeColor.SemanticColor.text_primary)
.themeFont(fontSize = ThemeFont.FontSize.medium),
)
Text(
text = "$seasonText $season",
style = TextStyle.dydxDefault
.themeColor(ThemeColor.SemanticColor.text_primary)
.themeFont(fontSize = ThemeFont.FontSize.medium),
Image(
painterResource(id = R.drawable.texture),
contentDescription = "",
contentScale = ContentScale.Crop,
modifier = Modifier
.matchParentSize()
.alpha(if (ThemeSettings.shared.isLightTheme()) 0.2f else 1.0f),
)

Spacer(modifier = Modifier.weight(1f))
Image(
painterResource(id = R.drawable.stars),
contentDescription = "",
contentScale = ContentScale.Fit,
modifier = Modifier
.padding(8.dp)
.size(100.dp)
.align(Alignment.CenterEnd),
)

Row {
Column(
modifier = Modifier
.matchParentSize()
.padding(16.dp),
) {
Text(
text = points ?: "-",
text = localizer.localize("APP.PORTFOLIO.ESTIMATED_REWARDS"),
style = TextStyle.dydxDefault
.themeColor(ThemeColor.SemanticColor.text_primary)
.themeFont(
fontSize = ThemeFont.FontSize.extra,
),
.themeFont(fontSize = ThemeFont.FontSize.medium),
)
Spacer(modifier = Modifier.width(8.dp))
Text(
text = localizer.localize("APP.PORTFOLIO.POINTS"),
text = "$seasonText $season",
style = TextStyle.dydxDefault
.themeColor(ThemeColor.SemanticColor.text_primary)
.themeFont(fontSize = ThemeFont.FontSize.large),
.themeFont(fontSize = ThemeFont.FontSize.medium),
)

Spacer(modifier = Modifier.weight(1f))

Row(
modifier = Modifier
.fillMaxWidth(),
) {
Text(
text = points ?: "-",
style = TextStyle.dydxDefault
.themeColor(ThemeColor.SemanticColor.text_primary)
.themeFont(
fontSize = ThemeFont.FontSize.extra,
),
)
Spacer(modifier = Modifier.width(8.dp))
Text(
text = localizer.localize("APP.PORTFOLIO.POINTS"),
style = TextStyle.dydxDefault
.themeColor(ThemeColor.SemanticColor.text_primary)
.themeFont(fontSize = ThemeFont.FontSize.large),
)
}
}
}
}
Expand Down
Loading
Loading