Skip to content

Commit 7b11ef5

Browse files
committed
PROD-3310 - make footer collapsible
1 parent 6141803 commit 7b11ef5

File tree

4 files changed

+68
-3
lines changed

4 files changed

+68
-3
lines changed

public/assets/icon-arrow.svg

Lines changed: 3 additions & 0 deletions
Loading

public/assets/icon-tmenu.svg

Lines changed: 5 additions & 0 deletions
Loading

src/lib/footer-navigation/FooterNavigation.module.scss

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,42 @@
8585
}
8686
}
8787
}
88+
89+
.toggleBar {
90+
background: #2A2A2A;
91+
padding: 12px 32px;
92+
@include maxViewWidth;
93+
94+
margin: 0 auto;
95+
display: flex;
96+
align-items: center;
97+
98+
color: #D4D4D4;
99+
100+
cursor: pointer;
101+
102+
@include mobile {
103+
padding: 12px 16px;
104+
}
105+
106+
+ .footerNavigation {
107+
padding-top: 16px;
108+
}
109+
110+
.icon {
111+
display: flex;
112+
width: 24px;
113+
height: 24px;
114+
align-items: center;
115+
justify-content: center;
116+
}
117+
118+
.toggl {
119+
transform: rotateZ(180deg);
120+
transition: 0.15s ease;
121+
}
122+
123+
&.isCollapsed .toggl {
124+
transform: rotateZ(0deg);
125+
}
126+
}

src/lib/footer-navigation/FooterNavigation.svelte

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
import { navItems } from 'lib/config/nav-menu/nav-items.config';
88
import { handleNavItemAction } from 'lib/utils/nav-item-action.handler';
99
import type { NavMenuItem } from 'lib/functions/nav-menu-item.model';
10+
import InlineSvg from 'lib/components/InlineSvg.svelte';
1011
import FooterBottomBar from './FooterBottomBar.svelte';
1112
import styles from './FooterNavigation.module.scss'
13+
import { classnames } from 'lib/utils/classnames';
1214
1315
const ctx = getAppContext()
1416
$: ({auth} = $ctx)
@@ -21,13 +23,19 @@
2123
2224
$: ({fullFooter} = $ctx.toolConfig)
2325
26+
let isCollapsed = true;
27+
2428
let supportVisible = false;
2529
let footerEl: Element | undefined = undefined;
2630
2731
function toggleSupportModal() {
2832
supportVisible = true;
2933
}
3034
35+
function toggleFooter() {
36+
isCollapsed = !isCollapsed;
37+
}
38+
3139
onMount(checkAndLoadFonts)
3240
3341
onMount(() => {
@@ -36,15 +44,25 @@
3644
</script>
3745

3846
<footer class={styles.footerWrap} bind:this={footerEl}>
39-
{#if fullFooter === true}
47+
{#if !fullFooter}
48+
<div class={classnames(styles.toggleBar, isCollapsed && styles.isCollapsed)} on:click={toggleFooter} on:keydown={() => {}}>
49+
<span class={styles.icon}>
50+
<InlineSvg src="/assets/icon-tmenu.svg" />
51+
</span>
52+
<span class={classnames(styles.icon, styles.toggl)}>
53+
<InlineSvg src="/assets/icon-arrow.svg" />
54+
</span>
55+
</div>
56+
{/if}
57+
{#if fullFooter === true || !isCollapsed}
4058
<div class={styles.footerNavigation}>
4159
<ul class={styles.menuSections}>
4260
{#each menuItems as menuItem}
4361
<li class={styles.menuSection}>
4462
{#if !!menuItem.label}
4563
<div class={styles.menuSectionHeading}>
4664
{menuItem.label}
47-
</div>
65+
</div>
4866
{/if}
4967
{#if menuItem.children?.length}
5068
<ul class={styles.menuSectionEntries}>
@@ -54,7 +72,7 @@
5472
<a target="_top" use:handleNavItemAction={child} href={child.url}>
5573
{child.label}
5674
</a>
57-
</li>
75+
</li>
5876
{/if}
5977
{/each}
6078
</ul>

0 commit comments

Comments
 (0)