diff --git a/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.css b/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.css index 7be5eacd6..1d41462cb 100644 --- a/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.css +++ b/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.css @@ -1,9 +1,8 @@ .level-mission-info-banner { display: flex; - gap: 0.5rem; + gap: 1.5rem; align-items: center; padding: 0.5rem 1.5rem; - border: 0.5rem solid transparent; background-color: var(--level-banner-background-colour); color: var(--level-banner-text-colour); text-align: left; @@ -16,9 +15,10 @@ } .level-title-area { - min-width: 10%; + margin: 1rem 0; font-weight: 800; font-size: 1.875rem; + white-space: nowrap; } .level-mission-info-banner > p { @@ -26,6 +26,23 @@ font-size: 1rem; } -.level-mission-info-banner:hover { - background-color: var(--level-banner-background-colour-hover); +.level-mission-info-banner .themed-button { + gap: 0.5rem; + height: auto; + padding: 0.75rem 1rem; + white-space: nowrap; +} + +.info-icon { + display: flex; + align-items: center; + box-sizing: border-box; + height: auto; + padding: 0 0.625rem; + border-radius: 50%; + background-color: var(--action-button-text-colour); + color: var(--action-button-background-colour); + font: 1rem serif; + font-weight: bold; + aspect-ratio: 1; } diff --git a/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.test.tsx b/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.test.tsx index eb41762ef..a9bdec539 100644 --- a/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.test.tsx +++ b/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.test.tsx @@ -1,4 +1,9 @@ -import { render, screen, fireEvent } from '@testing-library/react'; +import { + render, + screen, + fireEvent, + getDefaultNormalizer, +} from '@testing-library/react'; import { describe, expect, test, vi } from 'vitest'; import { LEVELS } from '@src/Levels'; @@ -16,9 +21,16 @@ describe('LevelMissionInfoBanner component tests', () => { /> ); - const button = screen.getByRole('button'); - const expectedContent = LEVELS[currentLevel].missionInfoShort ?? ''; - expect(button).toContainHTML(expectedContent); + const expectedContent = LEVELS[currentLevel].missionInfoShort; + + if (!expectedContent) + throw new Error(`No missionInfoShort found for level ${currentLevel}`); + + const expectedText = getDefaultNormalizer()( + expectedContent.slice(0, expectedContent.indexOf(' ')) + ); + const banner = screen.getByText(expectedText); + expect(banner).toContainHTML(expectedContent); }); test('fires the openOverlay callback on button click', () => { diff --git a/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.tsx b/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.tsx index a2d178be7..b1051f501 100644 --- a/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.tsx +++ b/frontend/src/components/LevelMissionInfoBanner/LevelMissionInfoBanner.tsx @@ -1,4 +1,5 @@ import { LEVELS } from '@src/Levels'; +import ThemedButton from '@src/components/ThemedButtons/ThemedButton'; import { LEVEL_NAMES } from '@src/models/level'; import './LevelMissionInfoBanner.css'; @@ -11,14 +12,20 @@ function LevelMissionInfoBanner({ openOverlay: () => void; }) { return ( - + + + Mission Info + + ); } export default LevelMissionInfoBanner;