1
- import { Flex , Button , VStack } from '@chakra-ui/react' ;
1
+ import { Button , Flex , VStack } from '@chakra-ui/react' ;
2
2
import { motion } from 'framer-motion' ;
3
3
import { isSafari } from 'react-device-detect' ;
4
- import { Switch , Case } from 'react-if' ;
4
+ import { Case , Switch } from 'react-if' ;
5
5
import { useConfig } from '~/context' ;
6
- import { useFormState , useFormInteractive , useMobile } from '~/hooks' ;
6
+ import { useFormInteractive , useFormState , useMobile } from '~/hooks' ;
7
7
import { Logo } from './logo' ;
8
8
import { SubtitleOnly } from './subtitle-only' ;
9
9
import { TitleOnly } from './title-only' ;
@@ -13,7 +13,7 @@ import type { MotionProps } from 'framer-motion';
13
13
14
14
type DWrapperProps = Omit < StackProps , 'transition' > & MotionProps ;
15
15
type MWrapperProps = Omit < StackProps , 'transition' > & MotionProps ;
16
- type TextOnlyProps = Partial < MotionProps & Omit < StackProps , 'transition' > > ;
16
+ type WrapperProps = Partial < MotionProps & Omit < StackProps , 'transition' > > ;
17
17
18
18
const AnimatedVStack = motion ( VStack ) ;
19
19
const AnimatedFlex = motion ( Flex ) ;
@@ -28,6 +28,7 @@ const MWrapper = (props: MWrapperProps): JSX.Element => {
28
28
layout
29
29
spacing = { 1 }
30
30
alignItems = { formInteractive ? 'center' : 'flex-start' }
31
+ maxWidth = "25%"
31
32
{ ...props }
32
33
/>
33
34
) ;
@@ -46,6 +47,7 @@ const DWrapper = (props: DWrapperProps): JSX.Element => {
46
47
animate = { formInteractive }
47
48
transition = { { damping : 15 , type : 'spring' , stiffness : 100 } }
48
49
variants = { { results : { scale : 0.5 } , form : { scale : 1 } } }
50
+ maxWidth = "25%"
49
51
{ ...props }
50
52
/>
51
53
) ;
@@ -71,7 +73,7 @@ const TitleWrapper = (props: DWrapperProps | MWrapperProps): JSX.Element => {
71
73
/**
72
74
* Title sub-component if `title_mode` is set to `text_only`.
73
75
*/
74
- const TextOnly = ( props : TextOnlyProps ) : JSX . Element => {
76
+ const TextOnly = ( props : WrapperProps ) : JSX . Element => {
75
77
return (
76
78
< TitleWrapper { ...props } >
77
79
< TitleOnly />
@@ -83,8 +85,8 @@ const TextOnly = (props: TextOnlyProps): JSX.Element => {
83
85
/**
84
86
* Title sub-component if `title_mode` is set to `logo_only`. Renders only the logo.
85
87
*/
86
- const LogoOnly = ( ) : JSX . Element => (
87
- < TitleWrapper >
88
+ const LogoOnly = ( props : WrapperProps ) : JSX . Element => (
89
+ < TitleWrapper { ... props } >
88
90
< Logo />
89
91
</ TitleWrapper >
90
92
) ;
@@ -93,8 +95,8 @@ const LogoOnly = (): JSX.Element => (
93
95
* Title sub-component if `title_mode` is set to `logo_subtitle`. Renders the logo with the
94
96
* subtitle underneath.
95
97
*/
96
- const LogoSubtitle = ( ) : JSX . Element => (
97
- < TitleWrapper >
98
+ const LogoSubtitle = ( props : WrapperProps ) : JSX . Element => (
99
+ < TitleWrapper { ... props } >
98
100
< Logo />
99
101
< SubtitleOnly />
100
102
</ TitleWrapper >
@@ -103,8 +105,8 @@ const LogoSubtitle = (): JSX.Element => (
103
105
/**
104
106
* Title sub-component if `title_mode` is set to `all`. Renders the logo, title, and subtitle.
105
107
*/
106
- const All = ( ) : JSX . Element => (
107
- < TitleWrapper >
108
+ const All = ( props : WrapperProps ) : JSX . Element => (
109
+ < TitleWrapper { ... props } >
108
110
< Logo />
109
111
< TextOnly mt = { 2 } />
110
112
</ TitleWrapper >
@@ -149,16 +151,16 @@ export const Title = (props: FlexProps): JSX.Element => {
149
151
>
150
152
< Switch >
151
153
< Case condition = { titleMode === 'text_only' } >
152
- < TextOnly />
154
+ < TextOnly width = { web . logo . width } />
153
155
</ Case >
154
156
< Case condition = { titleMode === 'logo_only' } >
155
- < LogoOnly />
157
+ < LogoOnly width = { web . logo . width } />
156
158
</ Case >
157
159
< Case condition = { titleMode === 'logo_subtitle' } >
158
- < LogoSubtitle />
160
+ < LogoSubtitle width = { web . logo . width } />
159
161
</ Case >
160
162
< Case condition = { titleMode === 'all' } >
161
- < All />
163
+ < All width = { web . logo . width } />
162
164
</ Case >
163
165
</ Switch >
164
166
</ Button >
0 commit comments