Merge branch 'RadiusProxy:main' into main

This commit is contained in:
Exp1o1 2024-05-18 21:33:02 -05:00 committed by GitHub
commit bd9b5def0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 47 additions and 0 deletions

35
public/splash.json Normal file
View file

@ -0,0 +1,35 @@
[
{
"splash": "testt22"
},
{
"splash": "https://discord.gg/qsXnhSPtAK"
},
{
"splash": "--placeholder--"
},
{
"splash": "--placeholder--"
},
{
"splash": "--placeholder--"
},
{
"splash": "--placeholder--"
},
{
"splash": "--placeholder--"
},
{
"splash": "--placeholder--"
},
{
"splash": "--placeholder--"
},
{
"splash": "--placeholder--"
},
{
"splash": "--placeholder--"
}
]

View file

@ -10,7 +10,18 @@ import store from 'store2'
export default function Home() {
const router = useRouter()
const [shortcuts, setShortcuts] = useState<Item[]>([])
const [splashText, setSplashText] = useState<string>('')
useEffect(() => {
fetch('/splash.json')
.then(response => response.json())
.then(data => {
const randomIndex = Math.floor(Math.random() * data.length);
setSplashText(data[randomIndex].splash);
})
.catch(error => console.error('Error fetching splash text:', error));
store.set('shortcuts', [], false)
const data: Item[] = store('shortcuts')
setShortcuts(data)
@ -36,6 +47,7 @@ export default function Home() {
<Search className="h-4 w-4 text-muted-foreground absolute top-1/2 -translate-y-1/2 left-3" />
</div>
</div>
<p style={{ fontSize: '1rem', fontWeight: 'normal', marginTop: '0.4rem' }}>{splashText}</p>
{shortcuts.length > 0 && (
<div className="py-2 flex flex-wrap gap-2 justify-center">
{shortcuts.map((shortcut: Item) => {