Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore the original home icon size #243

Merged
merged 3 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions src/core/public/chrome/ui/header/home_icon.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ describe('Home icon,', () => {
});

it('uses the home icon by default', () => {
const props = mockProps();
const props = {
...mockProps(),
branding: {
useExpandedHeader: true,
},
};
const component = shallow(<HomeIcon {...props} />);
const icon = component.find('EuiIcon');
expect(icon.prop('data-test-subj')).toEqual('homeIcon');
Expand Down Expand Up @@ -53,9 +58,9 @@ describe('Home icon,', () => {
};
const component = shallow(<HomeIcon {...props} />);
const icon = component.find('EuiIcon');
expect(icon.prop('data-test-subj')).toEqual('homeIcon');
expect(icon.prop('data-test-subj')).toEqual('defaultMark');
expect(icon.prop('type')).toEqual(props.logos.Mark.url);
expect(icon.prop('size')).toEqual('m');
expect(icon.prop('size')).toEqual('l');
expect(icon.prop('title')).toEqual('Wazuh dashboards home');

expect(component).toMatchSnapshot();
Expand Down
4 changes: 2 additions & 2 deletions src/core/public/chrome/ui/header/home_icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface Props {
*/
export const HomeIcon = ({ branding, logos }: Props) => {
// Removed prop unnecessary useExpandedHeader Wazuh dashboards
const { applicationTitle = 'Wazuh dashboards' } = branding;
const { applicationTitle = 'Wazuh dashboards', useExpandedHeader } = branding;

const { url: markURL, type: markType } = logos.Mark;

Expand All @@ -27,7 +27,7 @@ export const HomeIcon = ({ branding, logos }: Props) => {
let markIconSize: IconSize = 'l';

// If no custom branded mark was set, use `home` icon Wazuh dashboards
if (markType !== 'custom') {
if (markType !== 'custom' && useExpandedHeader) {
testSubj = 'homeIcon';
// Home icon should be medium to fit in with other icons
markIconSize = 'm';
Expand Down
Loading