File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import {useRouter} from 'next/router';
2
2
import config from '@/config' ;
3
3
import FooterLink from './FooterLink' ;
4
4
import FooterSeparator from './FooterSeparator' ;
5
+ import FooterVersionSelector from './FooterVersionSelector' ;
5
6
6
7
export default function Footer ( ) {
7
8
const router = useRouter ( ) ;
@@ -19,6 +20,8 @@ export default function Footer() {
19
20
< FooterLink href = "/examples" > Examples</ FooterLink >
20
21
< FooterSeparator />
21
22
< FooterLink href = "/blog" > Blog</ FooterLink >
23
+ < FooterSeparator />
24
+ < FooterVersionSelector />
22
25
</ div >
23
26
< div >
24
27
< FooterLink href = { config . blueskyUrl } target = "_blank" >
Original file line number Diff line number Diff line change
1
+ import { ChangeEvent } from 'react' ;
2
+
3
+ export default function FooterVersionSelector ( ) {
4
+ function onChange ( event : ChangeEvent < HTMLSelectElement > ) {
5
+ const version = event . target . value ;
6
+ window . location . href = `https://${ version } .next-intl.dev` ;
7
+ }
8
+
9
+ return (
10
+ < select
11
+ className = "inline-flex appearance-none items-center bg-transparent py-3 text-xs text-slate-500 transition-colors hover:text-slate-900 dark:text-slate-400 dark:hover:text-white"
12
+ defaultValue = "v4"
13
+ onChange = { onChange }
14
+ >
15
+ < option value = "v3" > v3</ option >
16
+ < option value = "v4" > v4</ option >
17
+ </ select >
18
+ ) ;
19
+ }
You can’t perform that action at this time.
0 commit comments