Skip to content

Commit d69e6ce

Browse files
1 parent c6fa745 commit d69e6ce

File tree

3 files changed

+81
-3
lines changed

3 files changed

+81
-3
lines changed

components/src/main/java/com/ifeel/components/ui/components/generic/card/AlertInfoCard.kt

-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ import androidx.compose.foundation.Image
44
import androidx.compose.foundation.background
55
import androidx.compose.foundation.border
66
import androidx.compose.foundation.layout.Row
7-
import androidx.compose.foundation.layout.height
87
import androidx.compose.foundation.layout.padding
9-
import androidx.compose.foundation.layout.size
10-
import androidx.compose.foundation.layout.width
118
import androidx.compose.foundation.shape.RoundedCornerShape
129
import androidx.compose.material3.Text
1310
import androidx.compose.runtime.Composable
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
package com.ifeel.components.ui.components.generic.card
2+
3+
import androidx.compose.foundation.Image
4+
import androidx.compose.foundation.background
5+
import androidx.compose.foundation.border
6+
import androidx.compose.foundation.layout.Row
7+
import androidx.compose.foundation.layout.padding
8+
import androidx.compose.foundation.shape.RoundedCornerShape
9+
import androidx.compose.material3.Text
10+
import androidx.compose.runtime.Composable
11+
import androidx.compose.ui.Alignment
12+
import androidx.compose.ui.Modifier
13+
import androidx.compose.ui.draw.clip
14+
import androidx.compose.ui.res.painterResource
15+
import androidx.compose.ui.tooling.preview.Preview
16+
import androidx.compose.ui.unit.dp
17+
import com.ifeel.components.R
18+
import com.ifeel.components.ui.theme.IfeelComponentsTheme
19+
import com.ifeel.components.ui.theme.color_brand_secondary_200
20+
import com.ifeel.components.ui.theme.color_danger_100
21+
import com.ifeel.components.ui.theme.color_text_700
22+
import com.ifeel.components.ui.theme.text.BodyTextStyle
23+
24+
private val cardShape = RoundedCornerShape(10.dp)
25+
26+
@Composable
27+
fun WarningCard(text: String, modifier: Modifier = Modifier) {
28+
Row(
29+
modifier = modifier
30+
.border(
31+
width = 1.dp,
32+
color = color_brand_secondary_200,
33+
shape = cardShape
34+
)
35+
.clip(shape = cardShape)
36+
.background(color = color_danger_100)
37+
.padding(12.dp)
38+
) {
39+
Image(
40+
painter = painterResource(id = R.drawable.warning_card_ic),
41+
contentDescription = null,
42+
modifier = Modifier
43+
.align(Alignment.CenterVertically)
44+
.padding(end = 8.dp),
45+
)
46+
47+
Text(
48+
text = text,
49+
style = BodyTextStyle.Body14Regular.toTextStyle(),
50+
color = color_text_700
51+
)
52+
}
53+
}
54+
55+
@Preview(showBackground = true)
56+
@Composable
57+
private fun WarningCardPreview() {
58+
IfeelComponentsTheme {
59+
WarningCard(
60+
modifier = Modifier.padding(20.dp),
61+
text = "Contraseña o email incorrectos. Por motivos de seguridad, después de 10 intentos fallidos tu acceso se bloqueará durante 60 minutos."
62+
)
63+
}
64+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="21dp"
3+
android:height="22dp"
4+
android:viewportWidth="21"
5+
android:viewportHeight="22">
6+
<path
7+
android:fillColor="#00000000"
8+
android:pathData="M10.5,11m-8.438,0a8.438,8.438 0,1 1,16.875 0a8.438,8.438 0,1 1,-16.875 0"
9+
android:strokeWidth="1.5"
10+
android:strokeColor="#E14237" />
11+
<path
12+
android:fillColor="#00000000"
13+
android:pathData="M16,5.5L5,16.5"
14+
android:strokeWidth="1.5"
15+
android:strokeColor="#E14237"
16+
android:strokeLineCap="round" />
17+
</vector>

0 commit comments

Comments
 (0)