Skip to content

Commit 0cbec73

Browse files
committed
fix logo not displaying in FireFox. Closes #229
1 parent f723e2f commit 0cbec73

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

hyperglass/ui/components/footer/footer.tsx

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import { useMemo } from 'react';
21
import { Flex, HStack, useToken } from '@chakra-ui/react';
3-
import { If, Then } from 'react-if';
2+
import { useMemo } from 'react';
43
import { useConfig } from '~/context';
54
import { DynamicIcon } from '~/elements';
6-
import { useStrf, useMobile, useColorValue, useBreakpointValue } from '~/hooks';
5+
import { useBreakpointValue, useColorValue, useMobile, useStrf } from '~/hooks';
6+
import { isLink, isMenu } from '~/types';
77
import { FooterButton } from './button';
88
import { ColorModeToggle } from './color-mode';
99
import { FooterLink } from './link';
10-
import { isLink, isMenu } from '~/types';
1110

1211
import type { ButtonProps, LinkProps } from '@chakra-ui/react';
1312
import type { Link, Menu } from '~/types';
@@ -85,16 +84,15 @@ export const Footer = (): JSX.Element => {
8584
);
8685
}
8786
})}
88-
<If condition={web.credit.enable}>
89-
<Then>
90-
<FooterButton
91-
key="credit"
92-
side="right"
93-
content={content.credit}
94-
title={<DynamicIcon icon={{ fi: 'FiCode' }} boxSize={size} />}
95-
/>
96-
</Then>
97-
</If>
87+
{web.credit.enable && (
88+
<FooterButton
89+
key="credit"
90+
side="right"
91+
content={content.credit}
92+
title={<DynamicIcon icon={{ fi: 'FiCode' }} boxSize={size} />}
93+
/>
94+
)}
95+
9896
<ColorModeToggle size={size} />
9997
</HStack>
10098
);

hyperglass/ui/components/header/title.tsx

+17-15
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Flex, Button, VStack } from '@chakra-ui/react';
1+
import { Button, Flex, VStack } from '@chakra-ui/react';
22
import { motion } from 'framer-motion';
33
import { isSafari } from 'react-device-detect';
4-
import { Switch, Case } from 'react-if';
4+
import { Case, Switch } from 'react-if';
55
import { useConfig } from '~/context';
6-
import { useFormState, useFormInteractive, useMobile } from '~/hooks';
6+
import { useFormInteractive, useFormState, useMobile } from '~/hooks';
77
import { Logo } from './logo';
88
import { SubtitleOnly } from './subtitle-only';
99
import { TitleOnly } from './title-only';
@@ -13,7 +13,7 @@ import type { MotionProps } from 'framer-motion';
1313

1414
type DWrapperProps = Omit<StackProps, 'transition'> & MotionProps;
1515
type MWrapperProps = Omit<StackProps, 'transition'> & MotionProps;
16-
type TextOnlyProps = Partial<MotionProps & Omit<StackProps, 'transition'>>;
16+
type WrapperProps = Partial<MotionProps & Omit<StackProps, 'transition'>>;
1717

1818
const AnimatedVStack = motion(VStack);
1919
const AnimatedFlex = motion(Flex);
@@ -28,6 +28,7 @@ const MWrapper = (props: MWrapperProps): JSX.Element => {
2828
layout
2929
spacing={1}
3030
alignItems={formInteractive ? 'center' : 'flex-start'}
31+
maxWidth="25%"
3132
{...props}
3233
/>
3334
);
@@ -46,6 +47,7 @@ const DWrapper = (props: DWrapperProps): JSX.Element => {
4647
animate={formInteractive}
4748
transition={{ damping: 15, type: 'spring', stiffness: 100 }}
4849
variants={{ results: { scale: 0.5 }, form: { scale: 1 } }}
50+
maxWidth="25%"
4951
{...props}
5052
/>
5153
);
@@ -71,7 +73,7 @@ const TitleWrapper = (props: DWrapperProps | MWrapperProps): JSX.Element => {
7173
/**
7274
* Title sub-component if `title_mode` is set to `text_only`.
7375
*/
74-
const TextOnly = (props: TextOnlyProps): JSX.Element => {
76+
const TextOnly = (props: WrapperProps): JSX.Element => {
7577
return (
7678
<TitleWrapper {...props}>
7779
<TitleOnly />
@@ -83,8 +85,8 @@ const TextOnly = (props: TextOnlyProps): JSX.Element => {
8385
/**
8486
* Title sub-component if `title_mode` is set to `logo_only`. Renders only the logo.
8587
*/
86-
const LogoOnly = (): JSX.Element => (
87-
<TitleWrapper>
88+
const LogoOnly = (props: WrapperProps): JSX.Element => (
89+
<TitleWrapper {...props}>
8890
<Logo />
8991
</TitleWrapper>
9092
);
@@ -93,8 +95,8 @@ const LogoOnly = (): JSX.Element => (
9395
* Title sub-component if `title_mode` is set to `logo_subtitle`. Renders the logo with the
9496
* subtitle underneath.
9597
*/
96-
const LogoSubtitle = (): JSX.Element => (
97-
<TitleWrapper>
98+
const LogoSubtitle = (props: WrapperProps): JSX.Element => (
99+
<TitleWrapper {...props}>
98100
<Logo />
99101
<SubtitleOnly />
100102
</TitleWrapper>
@@ -103,8 +105,8 @@ const LogoSubtitle = (): JSX.Element => (
103105
/**
104106
* Title sub-component if `title_mode` is set to `all`. Renders the logo, title, and subtitle.
105107
*/
106-
const All = (): JSX.Element => (
107-
<TitleWrapper>
108+
const All = (props: WrapperProps): JSX.Element => (
109+
<TitleWrapper {...props}>
108110
<Logo />
109111
<TextOnly mt={2} />
110112
</TitleWrapper>
@@ -149,16 +151,16 @@ export const Title = (props: FlexProps): JSX.Element => {
149151
>
150152
<Switch>
151153
<Case condition={titleMode === 'text_only'}>
152-
<TextOnly />
154+
<TextOnly width={web.logo.width} />
153155
</Case>
154156
<Case condition={titleMode === 'logo_only'}>
155-
<LogoOnly />
157+
<LogoOnly width={web.logo.width} />
156158
</Case>
157159
<Case condition={titleMode === 'logo_subtitle'}>
158-
<LogoSubtitle />
160+
<LogoSubtitle width={web.logo.width} />
159161
</Case>
160162
<Case condition={titleMode === 'all'}>
161-
<All />
163+
<All width={web.logo.width} />
162164
</Case>
163165
</Switch>
164166
</Button>

0 commit comments

Comments
 (0)