diff --git a/client/src/components/inventory.tsx b/client/src/components/inventory.tsx
index 0adf55d..363f3db 100644
--- a/client/src/components/inventory.tsx
+++ b/client/src/components/inventory.tsx
@@ -24,22 +24,29 @@ export function Inventory({levelInfo, openDoc, lemmaTab, setLemmaTab, enableAll=
}) {
const { t } = useTranslation()
+ // TODO: this state should be preserved when loading a different level.
+ const [tab, setTab] = useState<"tactic"|"theorem"|"definition">("theorem")
+
+ let newTheorems = levelInfo?.lemmas?.filter(item => item.new).length > 0
+ let newTactics = levelInfo?.tactics?.filter(item => item.new).length > 0
+ let newDefinitions = levelInfo?.definitions?.filter(item => item.new).length > 0
+
return (
- {/* TODO: Click on Tactic: show info
- TODO: click on paste icon -> paste into command line */}
-
{t("Tactics")}
- {levelInfo?.tactics &&
+
+
{ setTab("theorem") }}>{t("Theorems")}
+
{ setTab("tactic") }}>{t("Tactics")}
+
{ setTab("definition") }}>{t("Definitions")}
+
+ { (tab == "theorem") && levelInfo?.lemmas &&
+
+ }
+ { (tab == "tactic") && levelInfo?.tactics &&
}
- {t("Definitions")}
- {levelInfo?.definitions &&
+ { (tab == "definition") && levelInfo?.definitions &&
}
- {t("Theorems")}
- {levelInfo?.lemmas &&
-
- }
)
}
diff --git a/client/src/css/inventory.css b/client/src/css/inventory.css
index f18292c..ee8bf0b 100644
--- a/client/src/css/inventory.css
+++ b/client/src/css/inventory.css
@@ -55,7 +55,7 @@
.tab-bar {
border-bottom: 0.1em solid var(--clr-dark-gray);
- margin-bottom: 0.5em;
+ margin-bottom: 1em;
}
.tab {
@@ -70,6 +70,22 @@
display: inline-block;
}
+.tab-bar.major {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ padding-top: .5em;
+ font-weight: bold;
+}
+
+.tab-bar.major .tab {
+ flex: 1;
+ text-align: center;
+ font-size: 1.2em;
+ padding-left: 0;
+ padding-right: 0;
+}
+
.tab-bar.current .tab.active {
color: black;
border-bottom: 0.3em solid var(--clr-primary);