-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38ed80e
commit 90f6def
Showing
22 changed files
with
366 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import * as React from "react"; | ||
// eslint-disable-next-line import/no-internal-modules | ||
import css from "./styling/HomeScreen.module.scss"; | ||
import { Link } from "react-common/components/controls/Link"; | ||
import { Button } from "react-common/components/controls/Button"; | ||
import { classList } from "react-common/components/util"; | ||
import { showModal } from "../transforms/showModal"; | ||
import { resetRubricAsync } from "../transforms/resetRubricAsync"; | ||
|
||
const Welcome: React.FC = () => { | ||
return ( | ||
<div className={css.welcome}> | ||
<h1>{lf("Welcome to MakeCode Project Insights!")}</h1> | ||
<p> | ||
{lf("This tool is designed to help you evaluate student projects using a rubric.")}{" "} | ||
<Link target="_blank" href="https://makecode.com/teachertool"> | ||
{lf("Learn More.")} | ||
</Link> | ||
</p> | ||
</div> | ||
); | ||
}; | ||
|
||
interface CardProps { | ||
title: string; | ||
className?: string; | ||
icon?: string; | ||
onClick: () => void; | ||
} | ||
|
||
const Card: React.FC<CardProps> = ({ title, className, icon, onClick }) => { | ||
return ( | ||
<Button className={classList(css.cardButton, className)} title={title} onClick={onClick}> | ||
<div className={css.cardDiv}> | ||
{icon && ( | ||
<div className={css.cardIcon}> | ||
<i className={icon}></i> | ||
</div> | ||
)} | ||
<div className={css.cardTitle}> | ||
<h3>{title}</h3> | ||
</div> | ||
</div> | ||
</Button> | ||
); | ||
}; | ||
|
||
const GetStarted: React.FC = () => { | ||
const onNewRubricClickedAsync = async () => { | ||
pxt.tickEvent("teachertool.newrubric"); | ||
await resetRubricAsync(true); | ||
}; | ||
|
||
const onImportRubricClicked = () => { | ||
pxt.tickEvent("teachertool.importrubric"); | ||
showModal("import-rubric"); | ||
}; | ||
|
||
return ( | ||
<div className={css.getStarted}> | ||
<h2>{lf("Get Started")}</h2> | ||
{/* TODO: Replace with carousel */} | ||
<div className={css.cards}> | ||
<Card | ||
title={lf("New Rubric")} | ||
icon={"fas fa-plus-circle"} | ||
className={css.newRubric} | ||
onClick={onNewRubricClickedAsync} | ||
/> | ||
<Card | ||
title={lf("Import Rubric")} | ||
icon={"fas fa-file-upload"} | ||
className={css.importRubric} | ||
onClick={onImportRubricClicked} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export const HomeScreen: React.FC = () => { | ||
return ( | ||
<div className={css.page}> | ||
<div className={css.top} /> | ||
<Welcome /> | ||
<GetStarted /> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.