mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
refactor: update key usage in components for improved rendering
This commit is contained in:
parent
9db6b605c5
commit
95c3550c42
3 changed files with 14 additions and 14 deletions
|
|
@ -22,7 +22,7 @@ export default function RootLayout({
|
||||||
<head />
|
<head />
|
||||||
<body>
|
<body>
|
||||||
{isDevEnv ? '' : <Script data-website-id="a1af6d7a-9286-4a1f-8385-ddad2a29fcbb" src="/umami/script.js" />}
|
{isDevEnv ? '' : <Script data-website-id="a1af6d7a-9286-4a1f-8385-ddad2a29fcbb" src="/umami/script.js" />}
|
||||||
<SessionProvider>
|
<SessionProvider key="session-provider">
|
||||||
<LHSessionProvider>
|
<LHSessionProvider>
|
||||||
<StyledComponentsRegistry>
|
<StyledComponentsRegistry>
|
||||||
<motion.main
|
<motion.main
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ const CourseClient = (props: any) => {
|
||||||
<div className="bg-white shadow-md shadow-gray-300/25 outline outline-1 outline-neutral-200/40 rounded-lg overflow-hidden">
|
<div className="bg-white shadow-md shadow-gray-300/25 outline outline-1 outline-neutral-200/40 rounded-lg overflow-hidden">
|
||||||
{course.chapters.map((chapter: any) => {
|
{course.chapters.map((chapter: any) => {
|
||||||
return (
|
return (
|
||||||
<div key={chapter} className="">
|
<div key={chapter.chapter_uuid || `chapter-${chapter.name}`} className="">
|
||||||
<div className="flex text-lg py-4 px-4 outline outline-1 outline-neutral-200/40 font-bold bg-neutral-50 text-neutral-600 items-center">
|
<div className="flex text-lg py-4 px-4 outline outline-1 outline-neutral-200/40 font-bold bg-neutral-50 text-neutral-600 items-center">
|
||||||
<h3 className="grow mr-3 break-words">{chapter.name}</h3>
|
<h3 className="grow mr-3 break-words">{chapter.name}</h3>
|
||||||
<p className="text-sm font-normal text-neutral-400 px-3 py-[2px] outline-1 outline outline-neutral-200 rounded-full whitespace-nowrap shrink-0">
|
<p className="text-sm font-normal text-neutral-400 px-3 py-[2px] outline-1 outline outline-neutral-200 rounded-full whitespace-nowrap shrink-0">
|
||||||
|
|
@ -175,7 +175,7 @@ const CourseClient = (props: any) => {
|
||||||
<div className="py-3">
|
<div className="py-3">
|
||||||
{chapter.activities.map((activity: any) => {
|
{chapter.activities.map((activity: any) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<div key={activity.activity_uuid} className="activity-container">
|
||||||
<p className="flex text-md"></p>
|
<p className="flex text-md"></p>
|
||||||
<div className="flex space-x-1 py-2 px-4 items-center">
|
<div className="flex space-x-1 py-2 px-4 items-center">
|
||||||
<div className="courseicon items-center flex space-x-2 text-neutral-400">
|
<div className="courseicon items-center flex space-x-2 text-neutral-400">
|
||||||
|
|
@ -232,7 +232,7 @@ const CourseClient = (props: any) => {
|
||||||
<div className="flex ">
|
<div className="flex ">
|
||||||
{activity.activity_type ===
|
{activity.activity_type ===
|
||||||
'TYPE_DYNAMIC' && (
|
'TYPE_DYNAMIC' && (
|
||||||
<>
|
<div>
|
||||||
<Link
|
<Link
|
||||||
className="flex grow pl-2 text-gray-500"
|
className="flex grow pl-2 text-gray-500"
|
||||||
href={
|
href={
|
||||||
|
|
@ -250,10 +250,10 @@ const CourseClient = (props: any) => {
|
||||||
<ArrowRight size={13} />
|
<ArrowRight size={13} />
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
</>
|
</div>
|
||||||
)}
|
)}
|
||||||
{activity.activity_type === 'TYPE_VIDEO' && (
|
{activity.activity_type === 'TYPE_VIDEO' && (
|
||||||
<>
|
<div>
|
||||||
<Link
|
<Link
|
||||||
className="flex grow pl-2 text-gray-500"
|
className="flex grow pl-2 text-gray-500"
|
||||||
href={
|
href={
|
||||||
|
|
@ -271,11 +271,11 @@ const CourseClient = (props: any) => {
|
||||||
<ArrowRight size={13} />
|
<ArrowRight size={13} />
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
</>
|
</div>
|
||||||
)}
|
)}
|
||||||
{activity.activity_type ===
|
{activity.activity_type ===
|
||||||
'TYPE_DOCUMENT' && (
|
'TYPE_DOCUMENT' && (
|
||||||
<>
|
<div>
|
||||||
<Link
|
<Link
|
||||||
className="flex grow pl-2 text-gray-500"
|
className="flex grow pl-2 text-gray-500"
|
||||||
href={
|
href={
|
||||||
|
|
@ -293,11 +293,11 @@ const CourseClient = (props: any) => {
|
||||||
<ArrowRight size={13} />
|
<ArrowRight size={13} />
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
</>
|
</div>
|
||||||
)}
|
)}
|
||||||
{activity.activity_type ===
|
{activity.activity_type ===
|
||||||
'TYPE_ASSIGNMENT' && (
|
'TYPE_ASSIGNMENT' && (
|
||||||
<>
|
<div>
|
||||||
<Link
|
<Link
|
||||||
className="flex grow pl-2 text-gray-500"
|
className="flex grow pl-2 text-gray-500"
|
||||||
href={
|
href={
|
||||||
|
|
@ -315,11 +315,11 @@ const CourseClient = (props: any) => {
|
||||||
<ArrowRight size={13} />
|
<ArrowRight size={13} />
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
</>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ function ActivityIndicators(props: Props) {
|
||||||
<div className="grid grid-flow-col justify-stretch space-x-6">
|
<div className="grid grid-flow-col justify-stretch space-x-6">
|
||||||
{course.chapters.map((chapter: any) => {
|
{course.chapters.map((chapter: any) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<React.Fragment key={chapter.id || `chapter-${chapter.name}`}>
|
||||||
<div className="grid grid-flow-col justify-stretch space-x-2">
|
<div className="grid grid-flow-col justify-stretch space-x-2">
|
||||||
{chapter.activities.map((activity: any) => {
|
{chapter.activities.map((activity: any) => {
|
||||||
return (
|
return (
|
||||||
|
|
@ -84,7 +84,7 @@ function ActivityIndicators(props: Props) {
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue