Skip to content

Commit

Permalink
Demo
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed Aug 16, 2023
1 parent 9a75dc6 commit ac5c61f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions client/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ const Home = (props: Props) => {
</button>
</div>
<div className="w-full max-w-3xl lg:w-3/4">
{/* <div className="grid grid-cols-2 gap-10 sm:mt-8 lg:mt-0 lg:grid-cols-3 lg:gap-6">
<div className="grid grid-cols-2 gap-10 sm:mt-8 lg:mt-0 lg:grid-cols-3 lg:gap-6">
{props.lessons
.filter((lesson) => lesson.slug !== 'hello-codeamigo')
.filter((lesson) => lesson.slug === 'hello-codeamigo')
.map((lesson) => {
return (
<div
Expand Down Expand Up @@ -104,17 +104,16 @@ const Home = (props: Props) => {
</div>
);
})}
</div> */}
</div>
<div className="mt-8 grid grid-cols-2 gap-10 lg:grid-cols-3 lg:gap-6">
{props.lessons
.filter((lesson) => lesson.slug !== 'hello-codeamigo')
.sort((a, _b) => (a.slug === 'intro-to-python' ? -1 : 1))
.map((lesson) => {
const isWhitelisted =
(meData?.me?.email &&
INTRO_TO_JS_WHITELIST.includes(meData?.me?.email) &&
lesson.slug === 'intro-to-js') ||
lesson.slug === 'intro-to-python';
meData?.me?.email &&
INTRO_TO_JS_WHITELIST.includes(meData?.me?.email) &&
lesson.slug === 'intro-to-js';

return (
<div
Expand All @@ -136,7 +135,7 @@ const Home = (props: Props) => {
</div>
<div className="px-3 pb-4 pt-2 text-xs">
<pre className="text-white">{lesson.title}</pre>
{isWhitelisted || lesson.slug === 'intro-to-python' ? (
{isWhitelisted ? (
<>
<span className="mt-3 inline-flex h-6 cursor-default select-none items-center whitespace-nowrap rounded bg-green-950 px-2 text-xs font-semibold text-green-500">
Enroll
Expand Down

0 comments on commit ac5c61f

Please sign in to comment.