diff --git a/client/package-lock.json b/client/package-lock.json index 21e180cb..b541060b 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -75,6 +75,7 @@ "@types/redux-logger": "^3.0.9", "@types/store": "^2.0.2", "@types/storejs": "^2.0.3", + "@types/styled-components": "^5.1.34", "@types/uuid": "^8.3.0", "@typescript-eslint/eslint-plugin": "^4.28.1", "@typescript-eslint/parser": "^4.28.1", @@ -5257,6 +5258,17 @@ "integrity": "sha512-VF/KPGUEKxi7j3//HaPCKaKbMtKOnWYf+aLzZcBQrhQAcHevA4OA2HwFpeJ6S6JD7xpS06G3K7oZkyIfp9lfeQ==", "dev": true }, + "node_modules/@types/styled-components": { + "version": "5.1.34", + "resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-5.1.34.tgz", + "integrity": "sha512-mmiVvwpYklFIv9E8qfxuPyIt/OuyIrn6gMOAMOFUO3WJfSrSE+sGUoa4PiZj77Ut7bKZpaa6o1fBKS/4TOEvnA==", + "dev": true, + "dependencies": { + "@types/hoist-non-react-statics": "*", + "@types/react": "*", + "csstype": "^3.0.2" + } + }, "node_modules/@types/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/@types/tmp/-/tmp-0.0.33.tgz", diff --git a/client/package.json b/client/package.json index 8389ec75..6a1cbce5 100644 --- a/client/package.json +++ b/client/package.json @@ -86,6 +86,7 @@ "@types/redux-logger": "^3.0.9", "@types/store": "^2.0.2", "@types/storejs": "^2.0.3", + "@types/styled-components": "^5.1.34", "@types/uuid": "^8.3.0", "@typescript-eslint/eslint-plugin": "^4.28.1", "@typescript-eslint/parser": "^4.28.1", diff --git a/client/src/components/author/category-list-item.tsx b/client/src/components/author/category-list-item.tsx index 4b2a7474..39089420 100644 --- a/client/src/components/author/category-list-item.tsx +++ b/client/src/components/author/category-list-item.tsx @@ -159,7 +159,7 @@ export function CategoryListItem(props: { if (!topic) { return null; } - let topicName = + const topicName = topic.categoryParent === category.id ? `${category.name}` : topic.name || ""; diff --git a/client/src/components/author/question-edit.tsx b/client/src/components/author/question-edit.tsx index a44d35fd..18ba6643 100644 --- a/client/src/components/author/question-edit.tsx +++ b/client/src/components/author/question-edit.tsx @@ -27,7 +27,6 @@ import { import ParaphraseList from "components/author/question-paraphrase-list"; import TopicsList from "components/author/question-topics-list"; import { SubjectQuestionGQL } from "types-gql"; -import questions from "store/slices/questions"; export function QuestionEditCard(props: { subjectType: SubjectTypes; diff --git a/client/src/components/author/topics-list.tsx b/client/src/components/author/topics-list.tsx index 2ed22449..6d2c3667 100644 --- a/client/src/components/author/topics-list.tsx +++ b/client/src/components/author/topics-list.tsx @@ -49,7 +49,7 @@ export function TopicCard(props: { label="Topic" variant="outlined" value={ - Boolean(topic.categoryParent) + topic.categoryParent ? `(Category Default) ${topic.name}` : topic.name } @@ -118,7 +118,6 @@ export function TopicsList(props: { }): JSX.Element { const { classes, topics } = props; const { height: windowHeight } = useWithWindowSize(); - const topicsToDisplay = topics.filter((t) => !t.categoryParent); function onDragEnd(result: DropResult) { if (!result.destination) {