parent
0ace78c403
commit
fff73d490f
@ -0,0 +1,29 @@ |
|||||||
|
@layer components { |
||||||
|
.teacher-bar { |
||||||
|
@apply flex flex-wrap gap-4; |
||||||
|
|
||||||
|
&__item { |
||||||
|
@apply flex gap-0.5 items-center; |
||||||
|
|
||||||
|
> div.p-avatar { |
||||||
|
@apply flex-none; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
&__item-caption { |
||||||
|
@apply flex flex-col flex-grow text-caption; |
||||||
|
|
||||||
|
span:first-child { |
||||||
|
@apply line-clamp-1 font-semibold; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
&--simple { |
||||||
|
@apply flex-nowrap; |
||||||
|
|
||||||
|
.teacher-bar__item { |
||||||
|
@apply w-1/2; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,30 @@ |
|||||||
|
.p-card { |
||||||
|
@apply rounded-lg shadow-lg; |
||||||
|
|
||||||
|
.p-card-body { |
||||||
|
@apply flex flex-col gap-4 p-4; |
||||||
|
} |
||||||
|
|
||||||
|
.p-card-header { |
||||||
|
img { |
||||||
|
@apply rounded-t-lg; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.p-card-title { |
||||||
|
@apply text-body-2-bold line-clamp-2 min-h-[2rem]; |
||||||
|
} |
||||||
|
|
||||||
|
.p-card-subtitle { |
||||||
|
@apply text-body-1 text-gray-50; |
||||||
|
} |
||||||
|
|
||||||
|
.p-card-content { |
||||||
|
&:empty { |
||||||
|
@apply hidden; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.p-card-footer { |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,5 @@ |
|||||||
|
@layer components { |
||||||
|
.course-card { |
||||||
|
@apply bg-gray-15; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,38 @@ |
|||||||
|
<template> |
||||||
|
<div |
||||||
|
class="teacher-bar" |
||||||
|
:class="{ 'teacher-bar--simple': isSimpleLayout }" |
||||||
|
> |
||||||
|
<div |
||||||
|
v-for="user in teachers" |
||||||
|
:key="user.id" |
||||||
|
class="teacher-bar__item" |
||||||
|
> |
||||||
|
<Avatar |
||||||
|
:image="`${user.illustrationUrl}?w=80&h=80&fit=crop`" |
||||||
|
shape="circle" |
||||||
|
/> |
||||||
|
<div |
||||||
|
v-if="isSimpleLayout" |
||||||
|
class="teacher-bar__item-caption" |
||||||
|
> |
||||||
|
<span v-text="user.fullName" /> |
||||||
|
<span v-t="'Coach'" /> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script setup> |
||||||
|
import Avatar from 'primevue/avatar'; |
||||||
|
|
||||||
|
// eslint-disable-next-line no-undef |
||||||
|
const props = defineProps({ |
||||||
|
teachers: { |
||||||
|
required: true, |
||||||
|
type: Array |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
const isSimpleLayout = props.teachers.length < 3; |
||||||
|
</script> |
||||||
@ -1,46 +1,19 @@ |
|||||||
<template> |
<template> |
||||||
<div |
<CourseCard |
||||||
v-for="course in courses" |
v-for="course in courses" |
||||||
:key="course.id" |
:key="course.id" |
||||||
> |
|
||||||
<CourseCard |
|
||||||
:course="course" |
:course="course" |
||||||
/> |
/> |
||||||
</div> |
|
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script setup> |
||||||
|
|
||||||
import CourseCard from './CourseCard.vue'; |
import CourseCard from './CourseCard.vue'; |
||||||
export default { |
|
||||||
name: 'CourseCardList', |
// eslint-disable-next-line no-undef |
||||||
components: { |
defineProps({ |
||||||
CourseCard |
courses: { |
||||||
}, |
type: Array, |
||||||
props: { |
default: () => [], |
||||||
courses: Array, |
|
||||||
}, |
|
||||||
data() { |
|
||||||
return { |
|
||||||
deck: false |
|
||||||
}; |
|
||||||
}, |
|
||||||
methods: { |
|
||||||
isList: function (){ |
|
||||||
if (!this.deck) { |
|
||||||
return 'primary'; |
|
||||||
} |
|
||||||
return 'secondary'; |
|
||||||
}, |
|
||||||
isDeck: function (){ |
|
||||||
if (this.deck) { |
|
||||||
return 'primary'; |
|
||||||
} |
|
||||||
return 'secondary'; |
|
||||||
}, |
|
||||||
changeLayout: function () { |
|
||||||
this.deck = !this.deck; |
|
||||||
}, |
}, |
||||||
} |
}); |
||||||
}; |
|
||||||
</script> |
</script> |
||||||
|
|||||||
Loading…
Reference in new issue