Skip to content

Commit fcaaf83

Browse files
committed
Отображать плашку для бонусных тестовых заданий
1 parent 990f785 commit fcaaf83

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

hwproj.front/src/components/Common/HomeworkTags.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ export const isBonusWork = (tagsOwner: { tags?: string[] }) => tagsOwner.tags?.i
1111

1212
export const TestTip: FC = () => <sup style={{color: "#2979ff"}}> тест</sup>
1313
const BonusTip: FC = () => <sup style={{color: "green"}}> бонус</sup>
14+
const TestBonusTip: FC = () => <sup style={{color: "#2979ff"}}> бонус</sup>
1415

1516
export const getTip = (tagsOwner: { tags?: string[] }) => {
1617
const tags = tagsOwner.tags
1718
if (tags == null) return null
19+
20+
if (tags.includes(BonusTag)) {
21+
if (tags.includes(TestTag)) return <TestBonusTip/>
22+
return <BonusTip/>
23+
}
1824
if (tags.includes(TestTag)) return <TestTip/>
19-
if (tags.includes(BonusTag)) return <BonusTip/>
2025
return null
2126
}

0 commit comments

Comments
 (0)