Skip to content

Commit

Permalink
Merge pull request #438 from matthewgisonno/bugfix/header-spacing-and…
Browse files Browse the repository at this point in the history
…-font-size

Header Spacing and Font Sizes
  • Loading branch information
lovesitecore authored Apr 2, 2024
2 parents 99eabe6 + 8542a33 commit 5ed197d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
10 changes: 9 additions & 1 deletion src/Project/Sugcon2024/Sugcon/src/Theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ const Button = defineStyleConfig({
px: '42px',
py: '24px',
},
navButtonLinkSm: {
fontSize: '22px',
},
navButtonLinkLg: {
fontSize: '18px',
},
},
// Two variants: outline and solid
variants: {
Expand Down Expand Up @@ -81,6 +87,9 @@ const Link = defineStyleConfig({
},
sizes: {
sm: {
fontSize: '22px',
},
md: {
fontSize: '16px',
},
lg: {
Expand All @@ -97,7 +106,6 @@ const Link = defineStyleConfig({
fontSize: '16px',
},
navLink: {
fontSize: '18px',
fontWeight: 'bold',
color: 'sugcon.800',
textDecoration: 'none',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
useSitecoreContext,
} from '@sitecore-jss/sitecore-jss-nextjs';
import clsx from 'clsx';
import { Box } from '@chakra-ui/react';
import { Box, Flex } from '@chakra-ui/react';

interface Fields {
Image: ImageField;
Expand Down Expand Up @@ -72,15 +72,15 @@ export const Default = (props: LogoProps): JSX.Element => {
px="0"
mr="15px"
>
<Box w={{ base: 155, lg: 190 }}>
<Flex w={{ base: 155, lg: 190 }}>
{sitecoreContext?.pageState === 'edit' || !props?.fields?.TargetUrl?.value?.href ? (
<Image />
) : (
<JssLink field={props?.fields?.TargetUrl}>
<Image />
</JssLink>
)}
</Box>
</Flex>
<Text
tag="span"
className="image-caption field-imagecaption"
Expand Down
3 changes: 3 additions & 0 deletions src/Project/Sugcon2024/Sugcon/src/components/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ const NavigationItemWithChildren = ({ element, pageEditing }: NavigationItemProp
<Button
{...buttonProps}
variant="navButtonLink"
size={{ base: 'navButtonLinkSm', lg: 'navButtonLinkLg' }}
mr={{ base: '-23px', lg: '0' }}
rightIcon={isOpen ? <ChevronUpIcon /> : <ChevronDownIcon />}
className={clsx(element?.Styles)}
Expand Down Expand Up @@ -231,6 +232,7 @@ const NavigationItem = ({ element, pageEditing }: NavigationItemProps): JSX.Elem
field={getLinkField(element)}
editable={pageEditing}
variant="navLink"
size={{ base: 'sm', lg: 'lg' }}
>
{getNavigationText(element)}
</Link>
Expand All @@ -247,6 +249,7 @@ const renderChildNavigationItem = ({
<Link
as={SitecoreLink}
variant="navLink"
size={{ base: 'sm', lg: 'lg' }}
className={clsx(element?.Styles)}
field={getLinkField(element)}
editable={pageEditing}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const Default = ({ route }: HeaderDefaultProps): JSX.Element => {
shadow="xl"
minH={{ base: HeaderHeights.Mobile, lg: HeaderHeights.Desktop }}
>
<LayoutFlex align="center" flexGrow="1">
<LayoutFlex my="0" align="center" flexGrow="1">
{route && <Placeholder name="headless-header" rendering={route} />}
</LayoutFlex>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ type SizeConfig = {
};

export const responsiveButtonSizeConfig: SizeConfig = {
base: 'sm',
md: 'sm',
base: 'lg',
md: 'lg',
lg: 'sm',
xl: 'lg',
};
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const route = {
componentName: 'Logo',
dataSource: '{20C73871-7E77-4F6E-9D35-C518AB120F44}',
...Logo.args,
fields: {
...Logo.args.fields,
ImageCaption: null,
},
},
{
...PrimaryNavigation.args.rendering,
Expand Down

0 comments on commit 5ed197d

Please sign in to comment.