Skip to content

Commit 2cf8ad2

Browse files
committed
Prevent footer buttons from dimming when home view is active
- in footer, disable alt styles in two scenarios: Home is active or user hovers 'left' footer area.
1 parent bf22d13 commit 2cf8ad2

4 files changed

Lines changed: 20 additions & 15 deletions

File tree

‎apps/editor/src/views/prompt/frontend/Prompt.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ export const Prompt = () => {
285285
<Layout
286286
on_history_click={handle_history_click}
287287
on_donate_click={() => set_viewing_donations(true)}
288+
is_home_active={active_view === 'home'}
288289
>
289290
<div
290291
className={cn(styles.content, {

‎apps/editor/src/views/prompt/frontend/components/Layout/Footer/Footer.module.scss‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
cursor: pointer;
3232
text-decoration: none;
3333
transition:
34-
background-color 0.2s ease,
35-
color 0.2s ease;
34+
background-color 0.25s ease,
35+
color 0.25s ease;
3636

3737
&:focus {
3838
outline: none;
@@ -58,9 +58,9 @@
5858
border-color: var(--cwc-border-color-dimmed);
5959
color: var(--cwc-text-color-dimmed);
6060
transition:
61-
background-color 0.7s ease,
62-
border-color 0.7s ease,
63-
color 0.7s ease;
61+
background-color 0.5s ease,
62+
border-color 0.5s ease,
63+
color 0.5s ease;
6464
}
6565
}
6666

‎apps/editor/src/views/prompt/frontend/components/Layout/Footer/Footer.tsx‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ import cn from 'classnames'
77
import { CompactableActionButton } from '@ui/components/editor/prompt-view/CompactableActionButton'
88
import { Icon as UiIcon } from '@ui/components/editor/common/Icon'
99

10-
const DIMMED_ICONS_TIMEOUT = 10000
10+
const DIMMED_ICONS_TIMEOUT = 1000
1111

1212
type Props = {
1313
on_history_click?: () => void
1414
on_donate_click?: () => void
15+
is_home_active?: boolean
1516
}
1617

1718
export const Footer: React.FC<Props> = (props) => {
@@ -53,18 +54,19 @@ export const Footer: React.FC<Props> = (props) => {
5354
on_apply_click()
5455
}
5556

57+
const is_alt_style = is_alt && !props.is_home_active
58+
5659
return (
57-
<div
58-
className={styles.footer}
59-
ref={container_ref}
60-
onMouseEnter={handle_mouse_enter}
61-
onMouseLeave={handle_mouse_leave}
62-
>
63-
<div className={styles.footer__left}>
60+
<div className={styles.footer} ref={container_ref}>
61+
<div
62+
className={styles.footer__left}
63+
onMouseEnter={handle_mouse_enter}
64+
onMouseLeave={handle_mouse_leave}
65+
>
6466
<a
6567
href="https://discord.gg/KJySXsrSX5"
6668
className={cn(styles['footer__discord-button'], {
67-
[styles['footer__discord-button--alt']]: is_alt
69+
[styles['footer__discord-button--alt']]: is_alt_style
6870
})}
6971
title="Discord"
7072
target="_blank"
@@ -75,7 +77,7 @@ export const Footer: React.FC<Props> = (props) => {
7577
<button
7678
type="button"
7779
className={cn(styles['footer__donate-button'], {
78-
[styles['footer__donate-button--alt']]: is_alt
80+
[styles['footer__donate-button--alt']]: is_alt_style
7981
})}
8082
onClick={props.on_donate_click}
8183
title={t('header.buy-me-a-coffee')}

‎apps/editor/src/views/prompt/frontend/components/Layout/Layout.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ type Props = {
55
children: React.ReactNode
66
on_history_click?: () => void
77
on_donate_click?: () => void
8+
is_home_active?: boolean
89
}
910

1011
export const Layout: React.FC<Props> = (props) => {
@@ -14,6 +15,7 @@ export const Layout: React.FC<Props> = (props) => {
1415
<Footer
1516
on_history_click={props.on_history_click}
1617
on_donate_click={props.on_donate_click}
18+
is_home_active={props.is_home_active}
1719
/>
1820
</div>
1921
)

0 commit comments

Comments
 (0)