@@ -34,53 +34,71 @@ import kotlin.text.Typography.nbsp
3434fun ExperienceCard (
3535 experience : Experience ,
3636 cardPadding : Dp ,
37+ wide : Boolean ,
3738 modifier : Modifier = Modifier
3839) {
39- val colorScheme = colorScheme
40+ colorScheme
4041 val uriHandler = LocalUriHandler .current
4142
4243 Box (
4344 modifier
4445 .clip(shapes.largeIncreased)
4546 .clickable { uriHandler.openUri(experience.companyUrl) }
4647 ) {
47- Row (Modifier .fillMaxWidth().padding(cardPadding)) {
48- Text (
49- remember {
50- " ${experience.start.replace(' ' , nbsp)} $mdash ${
51- experience.end.replace(
52- ' ' ,
53- nbsp
54- )
55- } " .toUpperCase(Locale .current)
56- },
57- style = typography.labelMedium,
58- color = colorScheme.outline,
59- modifier = Modifier .padding(top = 4 .dp, end = 16 .dp).weight(1f )
60- )
61- Column (Modifier .weight(3f )) {
62- FlowRow (itemVerticalAlignment = Alignment .CenterVertically ) {
63- Text (experience.position, style = typography.bodyLarge, fontWeight = FontWeight .Medium )
64- Text (" $bullet " , style = typography.bodyLarge, fontWeight = FontWeight .Medium )
65- Text (experience.company, style = typography.bodyLarge, fontWeight = FontWeight .Medium )
66- Icon (
67- painterResource(Res .drawable.open_in_browser),
68- null ,
69- modifier = Modifier .padding(start = 4 .dp).size(16 .dp)
70- )
71- }
72- Text (
73- experience.description,
74- style = typography.bodyMedium,
75- color = colorScheme.onSurfaceVariant,
76- modifier = Modifier .padding(top = 8 .dp)
77- )
78- if (experience.skills.isNotEmpty()) LabelRow (experience.skills, Modifier .padding(top = 16 .dp))
48+ if (wide) {
49+ Row (Modifier .fillMaxWidth().padding(cardPadding)) {
50+ ExperienceCardDurationText (experience, Modifier .weight(1f ))
51+ ExperienceCardMainContent (experience, Modifier .weight(3f ))
52+ }
53+ } else {
54+ Column (Modifier .fillMaxWidth().padding(cardPadding)) {
55+ ExperienceCardDurationText (experience)
56+ ExperienceCardMainContent (experience)
7957 }
8058 }
8159 }
8260}
8361
62+ @Composable
63+ fun ExperienceCardDurationText (experience : Experience , modifier : Modifier = Modifier ) {
64+ Text (
65+ remember {
66+ " ${experience.start.replace(' ' , nbsp)} $mdash ${
67+ experience.end.replace(
68+ ' ' ,
69+ nbsp
70+ )
71+ } " .toUpperCase(Locale .current)
72+ },
73+ style = typography.labelMedium,
74+ color = colorScheme.outline,
75+ modifier = Modifier .padding(top = 4 .dp, bottom = 8 .dp, end = 16 .dp).then(modifier)
76+ )
77+ }
78+
79+ @Composable
80+ fun ExperienceCardMainContent (experience : Experience , modifier : Modifier = Modifier ) {
81+ Column (modifier) {
82+ FlowRow (itemVerticalAlignment = Alignment .CenterVertically ) {
83+ Text (experience.position, style = typography.bodyLarge, fontWeight = FontWeight .Medium )
84+ Text (" $bullet " , style = typography.bodyLarge, fontWeight = FontWeight .Medium )
85+ Text (experience.company, style = typography.bodyLarge, fontWeight = FontWeight .Medium )
86+ Icon (
87+ painterResource(Res .drawable.open_in_browser),
88+ null ,
89+ modifier = Modifier .padding(start = 4 .dp).size(16 .dp)
90+ )
91+ }
92+ Text (
93+ experience.description,
94+ style = typography.bodyMedium,
95+ color = colorScheme.onSurfaceVariant,
96+ modifier = Modifier .padding(top = 8 .dp)
97+ )
98+ if (experience.skills.isNotEmpty()) LabelRow (experience.skills, Modifier .padding(top = 16 .dp))
99+ }
100+ }
101+
84102@Composable
85103fun LabelRow (list : List <String >, modifier : Modifier = Modifier ) {
86104 FlowRow (
0 commit comments