File tree 3 files changed +8
-5
lines changed
3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
'use client'
2
2
import clsx from 'clsx'
3
3
import { Link } from 'waku/router/client'
4
+ import { encodeRFC3986URIComponent } from '@/utils/misc.ts'
4
5
import { getRomTitle } from '@/utils/rom.ts'
5
6
import { useRomCover } from '../hooks/use-rom-cover.ts'
6
7
@@ -13,7 +14,7 @@ export function GameEntry({ rom, width }) {
13
14
< Link
14
15
className = 'block'
15
16
style = { { width : width || 'auto' } }
16
- to = { `/library/platform/${ encodeURIComponent ( rom . platform ) } /rom/${ encodeURIComponent ( rom . file_name ) } ` }
17
+ to = { `/library/platform/${ encodeRFC3986URIComponent ( rom . platform ) } /rom/${ encodeRFC3986URIComponent ( rom . file_name ) } ` }
17
18
unstable_pending = {
18
19
< div className = 'z-1 absolute inset-0' >
19
20
< div className = 'grid h-4/5 w-full place-items-center' >
Original file line number Diff line number Diff line change
1
+ import { encodeRFC3986URIComponent } from './misc.ts'
2
+
1
3
const repositoryVersions = {
2
4
'batocera-linux/batocera-themes' : 'cc0de2f' ,
3
5
'HerbFargus/es-theme-tronkyfran' : 'a270311' ,
@@ -15,10 +17,6 @@ const repositoryVersions = {
15
17
'RetroPie/es-theme-carbon' : 'b09973e' ,
16
18
} as const
17
19
18
- function encodeRFC3986URIComponent ( str : string ) {
19
- return encodeURIComponent ( str ) . replaceAll ( / [ ! ' ( ) * ] / g, ( c ) => `%${ c . codePointAt ( 0 ) ?. toString ( 16 ) . toUpperCase ( ) } ` )
20
- }
21
-
22
20
export function getCDNUrl ( repo : keyof typeof repositoryVersions , filePpath : string ) {
23
21
const [ ghUser , ghRepoName ] = repo . split ( '/' )
24
22
const version = repositoryVersions [ repo ]
Original file line number Diff line number Diff line change @@ -25,3 +25,7 @@ export function humanizeDate(date: Date) {
25
25
}
26
26
return lightFormat ( date , 'yyyy-MM-dd HH:mm' )
27
27
}
28
+
29
+ export function encodeRFC3986URIComponent ( str : string ) {
30
+ return encodeURIComponent ( str ) . replaceAll ( / [ ! ' ( ) * ] / g, ( c ) => `%${ c . codePointAt ( 0 ) ?. toString ( 16 ) . toUpperCase ( ) } ` )
31
+ }
You can’t perform that action at this time.
0 commit comments