Added website menu view. Fixed pages filter.

This commit is contained in:
Mike Cao 2023-02-10 23:21:50 -08:00
parent d4437427c4
commit 4a689bf294
13 changed files with 100 additions and 85 deletions

View file

@ -1,15 +1,11 @@
export const urlFilter = data => {
const isValidUrl = url => {
return url !== '' && url !== null && !url.startsWith('#');
return url !== '' && url !== null;
};
const cleanUrl = url => {
try {
const { pathname, search } = new URL(url, location.origin);
if (search.startsWith('?')) {
return `${pathname}${search}`;
}
const { pathname } = new URL(url, location.origin);
return pathname;
} catch {