Skip to content

Commit 53150cc

Browse files
committed
Add in function to return correct logo based on project type
1 parent fbc4d4f commit 53150cc

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/components/Menus/Sidebar/SidebarBar.jsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ const SidebarBar = (props) => {
6464
}
6565
};
6666

67+
const getProjectTypeLogo = (projectType) => {
68+
switch (projectType) {
69+
case "python":
70+
return pythonLogo;
71+
case "code_editor_scratch":
72+
return htmlLogo; // TODO - Replace this with scratch logo when available
73+
case "html":
74+
return htmlLogo;
75+
default:
76+
return null;
77+
}
78+
};
79+
6780
return (
6881
<div
6982
className={classNames("sidebar__bar", {
@@ -73,7 +86,7 @@ const SidebarBar = (props) => {
7386
<div className={`sidebar__bar-options--top`}>
7487
<img
7588
className="editor-logo"
76-
src={project.project_type === "python" ? pythonLogo : htmlLogo}
89+
src={getProjectTypeLogo(project.project_type)}
7790
alt={t("header.editorLogoAltText")}
7891
/>
7992
{topMenuOptions.map((menuOption, i) => (

0 commit comments

Comments
 (0)