working on search
This commit is contained in:
@@ -5,6 +5,7 @@ import { useTinyRouter } from 'svelte-tiny-router';
|
||||
import { logout, user } from '../user.svelte.js';
|
||||
import { t } from '../translations.svelte.js';
|
||||
|
||||
let key = $state(null);
|
||||
const router = useTinyRouter();
|
||||
const modules = $state([]);
|
||||
|
||||
@@ -27,6 +28,12 @@ function go(path){
|
||||
return false;
|
||||
}
|
||||
|
||||
async function search(e){
|
||||
e.preventDefault();
|
||||
router.navigate(`/search?key=${key}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
onMount(fetchModules);
|
||||
</script>
|
||||
|
||||
@@ -37,6 +44,10 @@ onMount(fetchModules);
|
||||
</style>
|
||||
|
||||
<nav>
|
||||
<form onsubmit={search}>
|
||||
<input type="text" bind:value={key} />
|
||||
<button type="submit">{t('search')}</button>
|
||||
</form>
|
||||
<a href="#" onclick={() => go('/user')}>{t('users')}</a>
|
||||
<a href="#" onclick={() => go('/company')}>{t('companies')}</a>
|
||||
<a href="#" onclick={() => go('/project')}>{t('projects')}</a>
|
||||
|
||||
Reference in New Issue
Block a user