Skip to content

Commit

Permalink
fix: move to correct folder
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisbordet committed Oct 24, 2024
1 parent 96c057b commit 193d339
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal fun CardsPreview() =
) {
AvatarCard(Modifier.height(100.dp))
ContactCard(Modifier.size(100.dp, 200.dp))
PremiumButton(Modifier.fillMaxWidth())
PremiumButton(Modifier.fillMaxWidth()) {}
}
}

Expand All @@ -48,19 +48,23 @@ private fun BackgroundView() {
) {
Box(
modifier =
Modifier
.background(FreetimelanceTrackerColors.purple)
.blur(FreetimelanceTrackerDimens.backgroundBlur)
.fillMaxSize(),
Modifier
.background(FreetimelanceTrackerColors.purple)
.blur(FreetimelanceTrackerDimens.backgroundBlur)
.fillMaxSize(),
contentAlignment = Alignment.Center,
) {
Box(
modifier =
Modifier
.background(FreetimelanceTrackerColors.yellow)
.size(100.dp),
Modifier
.background(FreetimelanceTrackerColors.yellow)
.size(100.dp),
)
}
NoiseTexture()
}
}

@Preview
@Composable
private fun PremiumButtonPreview() = PremiumButton(Modifier.fillMaxWidth()) {}
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
package tech.bam.dojo.freetimelancetracker.components

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Button
import androidx.compose.material.ButtonDefaults
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import tech.bam.dojo.freetimelancetracker.theme.FreetimelanceTrackerColors

@Composable
fun PremiumButton(modifier: Modifier = Modifier) {
Box(
modifier = modifier.background(FreetimelanceTrackerColors.white),
contentAlignment = Alignment.Center,
fun PremiumButton(
modifier: Modifier = Modifier,
onClick: () -> Unit,
) {
Button(
modifier = modifier,
shape = RoundedCornerShape(16.dp),
onClick = onClick,
colors =
ButtonDefaults.buttonColors(
backgroundColor = FreetimelanceTrackerColors.yellow,
contentColor = FreetimelanceTrackerColors.purpleDark,
),
) {
Text(
text = "Premium Fake Button",
color = FreetimelanceTrackerColors.purpleDark,
text = "🔥 Passer Premium 🔥",
)
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
package tech.bam.dojo.simplelayout

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.core.screen.Screen
import tech.bam.dojo.freetimelancetracker.components.AvatarCard
import tech.bam.dojo.freetimelancetracker.components.ContactCard
import tech.bam.dojo.freetimelancetracker.components.PremiumButton
import tech.bam.dojo.freetimelancetracker.theme.FreetimelanceTrackerColors

class SimpleLayoutScreen : Screen {
override val key = "Simple Layout"
Expand All @@ -21,10 +30,16 @@ class SimpleLayoutScreen : Screen {

@Composable
fun SimpleLayoutView() {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center,
Column(
modifier = Modifier
.background(FreetimelanceTrackerColors.purple)
.fillMaxSize()
.padding(16.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.SpaceEvenly,
) {
AvatarCard()
AvatarCard(Modifier.fillMaxWidth())
ContactCard(Modifier.fillMaxWidth())
PremiumButton(Modifier.fillMaxWidth().height(62.dp)) { }
}
}

0 comments on commit 193d339

Please sign in to comment.