1
+ import SocialsList from "./SocialsList" ;
1
2
import Corner from "@/assets/corner.svg" ;
2
3
import Burger from "@/assets/icons/burger_menu_icon.svg" ;
3
4
import Lang from "@/assets/icons/lang.svg" ;
4
5
import { locale , translate } from "@/locales" ;
5
6
import styles from "@/styles/NavigationBar.module.scss" ;
6
- import { Commission } from "@/types/aliases" ;
7
+ import { Commission , SocialLink } from "@/types/aliases" ;
7
8
import { Schema } from "@/types/schema" ;
8
9
import Link from "next/link" ;
9
10
import { useRouter } from "next/router" ;
@@ -30,13 +31,21 @@ function SideMenu({
30
31
headToggle : toggle ,
31
32
children,
32
33
visible,
34
+ langs,
35
+ socials,
33
36
className,
34
37
} : {
35
38
headToggle : any ;
36
39
children : any ;
37
40
visible : boolean ;
41
+ langs : {
42
+ code ?: string | undefined ;
43
+ name ?: string | null | undefined ;
44
+ } [ ] ;
45
+ socials : SocialLink [ ] ;
38
46
className ?: string ;
39
47
} ) {
48
+ const router = useRouter ( ) ;
40
49
return (
41
50
< >
42
51
< Burger
@@ -49,6 +58,22 @@ function SideMenu({
49
58
>
50
59
< div className = { styles . sideMenu + " " + ( className || "" ) } >
51
60
{ children }
61
+ < div className = { styles . sideMenuLangs } >
62
+ < Lang className = { styles . sideLang } />
63
+ { langs . map ( ( l ) => (
64
+ < div
65
+ key = { l . code }
66
+ className = { styles . langItem }
67
+ onClick = { ( ) => {
68
+ router . push ( router . asPath , undefined , { locale : l . code } ) ;
69
+ toggle ( ) ;
70
+ } }
71
+ >
72
+ { l . name }
73
+ </ div >
74
+ ) ) }
75
+ < SocialsList socials = { socials } light = { true } />
76
+ </ div >
52
77
</ div >
53
78
</ div >
54
79
</ >
@@ -57,6 +82,7 @@ function SideMenu({
57
82
58
83
export default function NavigationBar ( props : {
59
84
commissions ?: Commission [ ] ;
85
+ socials ?: SocialLink [ ] ;
60
86
langs : Schema [ "languages" ] ;
61
87
} ) {
62
88
const [ menuVisible , setMenuVisible ] = useState ( false ) ;
@@ -191,6 +217,8 @@ export default function NavigationBar(props: {
191
217
< SideMenu
192
218
headToggle = { toggleMenu }
193
219
visible = { menuVisible }
220
+ langs = { props . langs }
221
+ socials = { props . socials || [ ] }
194
222
className = { styles . burgerContainer }
195
223
>
196
224
{ entries }
0 commit comments