Skip to content

Instantly share code, notes, and snippets.

@decpk
Created January 28, 2021 08:14
Show Gist options
  • Select an option

  • Save decpk/d4ae187f7f6acf09f378a516856434fb to your computer and use it in GitHub Desktop.

Select an option

Save decpk/d4ae187f7f6acf09f378a516856434fb to your computer and use it in GitHub Desktop.
CourseComplexity without destructuring
const CourseComplexity = function ( props ) {
const studentTypeClass = ["badge", "badge-pill"];
if (courseComplexityType === "Beginner")
studentTypeClass.push("badge-primary");
else if (courseComplexityType === "Intermediate")
studentTypeClass.push(" badge-warning");
return (
<span className={studentTypeClass.join(" ")}>{ props.courseComplexityType }</span>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment