Skip to content

Commit

Permalink
add additional image field optinos
Browse files Browse the repository at this point in the history
  • Loading branch information
jontallboy committed Jun 10, 2024
1 parent 9ef9109 commit 9e385ae
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Menu } from '@hubspot/cms-components';
import { Menu, logInfo } from '@hubspot/cms-components';
import {
ImageField,
MenuField,
Expand All @@ -9,10 +9,19 @@ import logo from '../../../assets/sprocket.svg';
import headerStyles from '../../../styles/header.module.css';

export function Component({ fieldValues }: any) {
const { src, alt, width, height, max_height, max_width } = fieldValues.logo;

return (
<header className={headerStyles.wrapper}>
<nav>
<img src={fieldValues.logo.src} alt="Logo" width={100} />
<img
src={src}
alt={alt}
width={width}
height={height}
max-height={max_height}
max-width={max_width}
/>
<Menu fieldPath="menu" />
</nav>
</header>
Expand All @@ -26,7 +35,7 @@ export const fields = (
<ImageField
name="logo"
label="Logo"
default={{ src: logo }}
default={{ src: logo, height: 100, alt: 'Logo for navigation' }}
resizable={true}
/>
<MenuField name="menu" label="Menu" default={DEFAULT_MENU_ID} />
Expand Down

0 comments on commit 9e385ae

Please sign in to comment.