Implement ProgCode identity and real shared reading UI kit
Build and deploy / deploy (push) Successful in 2m39s
Build and deploy / deploy (push) Successful in 2m39s
This commit is contained in:
1 parent
99c848189e
commit
12562baeb5
2040 files changed
+184656
-181
No files matched your search
@@ -0,0 +1 @@
|
||||
export {Shortlinks} from './ui/Shortlinks';
|
||||
@@ -0,0 +1,12 @@
|
||||
"use client";
|
||||
import {useEffect} from 'react';
|
||||
import links from '../../../../data/shortlinks.json';
|
||||
export function Shortlinks(){
|
||||
useEffect(()=>{
|
||||
const id=new URLSearchParams(location.search).get('p');
|
||||
if(!id||!Object.hasOwn(links,id))return;
|
||||
const target=links[id];
|
||||
if(typeof target==='string'&&target.startsWith('/articles/'))location.replace(target);
|
||||
},[]);
|
||||
return null;
|
||||
}
|
||||
Reference in new issue
Block a user