Skip to content

Commit

Permalink
Improve UI + WIP content
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed May 4, 2024
1 parent fcdc388 commit 186e1e2
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fun CourseCard(
imageUrl = course.imageUrl,
onClick = onCourseClick
)
Spacer(Modifier.height(12.dp))
Spacer(Modifier.height(16.dp))
Title(
modifier = Modifier.padding(horizontal = 16.dp),
text = course.name,
Expand All @@ -50,7 +50,7 @@ fun CourseCard(
modifier = Modifier.padding(horizontal = 16.dp),
text = course.tagline
)
Spacer(Modifier.height(12.dp))
Spacer(Modifier.height(16.dp))
}
}
}
Expand All @@ -65,7 +65,7 @@ private fun Banner(
KamelImage(
modifier = modifier
.fillMaxWidth()
.height(160.dp),
.height(148.dp),
contentScale = ContentScale.FillWidth,
resource = asyncPainterResource(imageUrl),
contentDescription = null
Expand Down
18 changes: 15 additions & 3 deletions server/src/main/kotlin/ivy/learn/data/cms/TopicsContent.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
package ivy.learn.data.cms

import ivy.learn.data.cms.course.GeneralProgramming
import ivy.learn.data.cms.course.programming.ProgrammingBasics
import ivy.learn.data.cms.dsl.TopicsDsl

object TopicsContent : TopicsDsl({
topic("General Programming") {
course(GeneralProgramming)
topic("Programming") {
course(ProgrammingBasics)
}
topic("Functional Programming") {

}
topic("Object Oriented Programming") {

}
topic("Kotlin") {

}
topic("Compose") {

}
})
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package ivy.learn.data.cms.course

import ivy.learn.data.cms.course.programming.ProgrammingBasics
import ivy.learn.data.cms.dsl.CoursesDsl

object CoursesContent : CoursesDsl({
course(GeneralProgramming)
course(ProgrammingBasics)
})

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package ivy.learn.data.cms.course.programming

import ivy.learn.data.cms.dsl.CourseDsl

object ProgrammingBasics : CourseDsl({
name = "Programming Basics"
tagline = "Learn the basics of programming from a different perspective."
imageUrl =
"https://i.ibb.co/nMLdcD5/DALL-E-2024-05-04-20-50-03-A-wide-banner-image-for-a-course-titled-Programming-Basics-with-the-tagli.webp"
lesson(
name = "What is programming?",
tagline = "Learn the basics of programming",
imageUrl = "tbd"
)
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package ivy.learn.data.cms.course.programming

import ivy.learn.data.cms.dsl.CourseDsl

object ProgrammingFundamentals : CourseDsl({
name = "Programming Fundamentals"
tagline = "Learn the basics of programming from a different perspective."
imageUrl =
"https://i.ibb.co/nMLdcD5/DALL-E-2024-05-04-20-50-03-A-wide-banner-image-for-a-course-titled-Programming-Basics-with-the-tagli.webp"
})
8 changes: 4 additions & 4 deletions server/src/test/kotlin/ivy/learn/api/CoursesApiTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import io.kotest.matchers.shouldBe
import ivy.data.source.CoursesDataSource
import ivy.data.source.model.CourseResponse
import ivy.di.Di
import ivy.learn.data.cms.course.GeneralProgramming
import ivy.learn.data.cms.course.programming.ProgrammingBasics
import ivy.learn.testsupport.ApiTest
import org.junit.Test

Expand All @@ -16,12 +16,12 @@ class CoursesApiTest : ApiTest() {
val datasource: CoursesDataSource = Di.get()

// When
val result = datasource.fetchCourseById(GeneralProgramming.course.id)
val result = datasource.fetchCourseById(ProgrammingBasics.course.id)

// Then
result.shouldBeRight() shouldBe CourseResponse(
course = GeneralProgramming.course,
lessons = GeneralProgramming.lessons,
course = ProgrammingBasics.course,
lessons = ProgrammingBasics.lessons,
)
}
}

0 comments on commit 186e1e2

Please sign in to comment.