Skip to content

Commit

Permalink
teacher tool - don't default export components
Browse files Browse the repository at this point in the history
  • Loading branch information
eanders-ms committed Jan 26, 2024
1 parent 24ef5ef commit 79ec030
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 41 deletions.
14 changes: 6 additions & 8 deletions teachertool/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import * as NotificationService from "./services/notificationService";
import { downloadTargetConfigAsync } from "./services/backendRequests";
import { logDebug } from "./services/loggingService";

import HeaderBar from "./components/HeaderBar";
import MainPanel from "./components/MainPanel";
import Notifications from "./components/Notifications";
import CatalogModal from "./components/CatalogModal";
import { HeaderBar } from "./components/HeaderBar";
import { MainPanel } from "./components/MainPanel";
import { Notifications } from "./components/Notifications";
import { CatalogModal } from "./components/CatalogModal";

import { postNotification } from "./transforms/postNotification";
import { loadCatalogAsync } from "./transforms/loadCatalogAsync";

function App() {
export const App = () => {
const { state, dispatch } = useContext(AppStateContext);
const [inited, setInited] = useState(false);

Expand Down Expand Up @@ -58,6 +58,4 @@ function App() {
<Notifications />
</>
);
}

export default App;
};
4 changes: 1 addition & 3 deletions teachertool/src/components/ActiveRubricDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { showCatalogModal } from "../transforms/showCatalogModal";

interface IProps {}

const ActiveRubricDisplay: React.FC<IProps> = ({}) => {
export const ActiveRubricDisplay: React.FC<IProps> = ({}) => {
const { state: teacherTool, dispatch } = useContext(AppStateContext);

return (
Expand Down Expand Up @@ -42,5 +42,3 @@ const ActiveRubricDisplay: React.FC<IProps> = ({}) => {
</div>
);
};

export default ActiveRubricDisplay;
4 changes: 1 addition & 3 deletions teachertool/src/components/CatalogModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CatalogCriteria } from "../types/criteria";

interface IProps {}

const CatalogModal: React.FC<IProps> = ({}) => {
export const CatalogModal: React.FC<IProps> = ({}) => {
const { state: teacherTool } = useContext(AppStateContext);
const [checkedCriteriaIds, setCheckedCriteria] = useState<Set<string>>(new Set<string>());

Expand Down Expand Up @@ -77,5 +77,3 @@ const CatalogModal: React.FC<IProps> = ({}) => {
</Modal>
) : null;
};

export default CatalogModal;
4 changes: 1 addition & 3 deletions teachertool/src/components/DebugInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { runEvaluateAsync } from "../transforms/runEvaluateAsync";

interface IProps {}

const DebugInput: React.FC<IProps> = ({}) => {
export const DebugInput: React.FC<IProps> = ({}) => {
const [shareLink, setShareLink] = useState("https://makecode.microbit.org/S95591-52406-50965-65671");
const [rubric, setRubric] = useState("");

Expand Down Expand Up @@ -44,5 +44,3 @@ const DebugInput: React.FC<IProps> = ({}) => {
</div>
);
};

export default DebugInput;
4 changes: 1 addition & 3 deletions teachertool/src/components/EvalResultDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AppStateContext } from "../state/appStateContext";

interface IProps {}

const EvalResultDisplay: React.FC<IProps> = ({}) => {
export const EvalResultDisplay: React.FC<IProps> = ({}) => {
const { state: teacherTool } = useContext(AppStateContext);

return (
Expand All @@ -30,5 +30,3 @@ const EvalResultDisplay: React.FC<IProps> = ({}) => {
</>
);
};

export default EvalResultDisplay;
4 changes: 1 addition & 3 deletions teachertool/src/components/HeaderBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MenuBar } from "react-common/components/controls/MenuBar";

interface HeaderBarProps {}

const HeaderBar: React.FC<HeaderBarProps> = () => {
export const HeaderBar: React.FC<HeaderBarProps> = () => {
const appTheme = pxt.appTarget?.appTheme;

const brandIconClick = () => {};
Expand Down Expand Up @@ -93,5 +93,3 @@ const HeaderBar: React.FC<HeaderBarProps> = () => {
</header>
);
};

export default HeaderBar;
14 changes: 6 additions & 8 deletions teachertool/src/components/MainPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import * as React from "react";
// eslint-disable-next-line import/no-internal-modules
import css from "./styling/MainPanel.module.css";

import DebugInput from "./DebugInput";
import MakeCodeFrame from "./MakecodeFrame";
import EvalResultDisplay from "./EvalResultDisplay";
import ActiveRubricDisplay from "./ActiveRubricDisplay";
import SplitPane from "./SplitPane";
import { DebugInput } from "./DebugInput";
import { MakeCodeFrame } from "./MakecodeFrame";
import { EvalResultDisplay } from "./EvalResultDisplay";
import { ActiveRubricDisplay } from "./ActiveRubricDisplay";
import { SplitPane } from "./SplitPane";

interface IProps {}

const MainPanel: React.FC<IProps> = () => {
export const MainPanel: React.FC<IProps> = () => {
return (
<div className={css["main-panel"]}>
<SplitPane split={"vertical"} defaultSize={"80%"} primary={"left"}>
Expand All @@ -28,5 +28,3 @@ const MainPanel: React.FC<IProps> = () => {
</div>
);
};

export default MainPanel;
4 changes: 1 addition & 3 deletions teachertool/src/components/MakecodeFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getEditorUrl } from "../utils";

interface MakeCodeFrameProps {}

const MakeCodeFrame: React.FC<MakeCodeFrameProps> = () => {
export const MakeCodeFrame: React.FC<MakeCodeFrameProps> = () => {
const { state: teacherTool } = useContext(AppStateContext);

function createIFrameUrl(shareId: string): string {
Expand Down Expand Up @@ -41,5 +41,3 @@ const MakeCodeFrame: React.FC<MakeCodeFrameProps> = () => {
);
/* eslint-enable @microsoft/sdl/react-iframe-missing-sandbox */
};

export default MakeCodeFrame;
4 changes: 1 addition & 3 deletions teachertool/src/components/Notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AppStateContext } from "../state/appStateContext";

interface IProps {}

const Notifications: React.FC<IProps> = ({}) => {
export const Notifications: React.FC<IProps> = ({}) => {
const { state: teacherTool, dispatch } = useContext(AppStateContext);

return (
Expand All @@ -16,5 +16,3 @@ const Notifications: React.FC<IProps> = ({}) => {
</div>
);
};

export default Notifications;
4 changes: 1 addition & 3 deletions teachertool/src/components/SplitPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface IProps {
children: React.ReactNode;
}

const SplitPane: React.FC<IProps> = ({ className, split, children }) => {
export const SplitPane: React.FC<IProps> = ({ className, split, children }) => {
const [left, right] = React.Children.toArray(children);

return (
Expand All @@ -24,5 +24,3 @@ const SplitPane: React.FC<IProps> = ({ className, split, children }) => {
</div>
);
};

export default SplitPane;
2 changes: 1 addition & 1 deletion teachertool/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React from "react";
import ReactDOM from "react-dom";
// eslint-disable-next-line import/no-unassigned-import
import "./teacherTool.css";
import App from "./App";
import { App } from "./App";
import { AppStateProvider } from "./state/appStateContext";

function enableAnalytics() {
Expand Down

0 comments on commit 79ec030

Please sign in to comment.