CLASSROOMIO-T-3: Make pages mobile friendly

This commit is contained in:
rotimi-best
2021-09-17 06:33:49 +03:00
parent 11d6b0616a
commit 2edfee4990
16 changed files with 152 additions and 82 deletions
+11 -3
View File
@@ -19,6 +19,7 @@
import { handleAuthChange } from '../utils/functions/api';
import { user, profile } from '../utils/store/user';
import { getSupabase } from '../utils/functions/supabase';
import { isMobile } from '../utils/store/useMobile';
export let segment;
export let config;
@@ -95,7 +96,13 @@
return /courses\/[a-z 0-9 -]/.test(path);
}
function handleResize() {
isMobile.update(() => window.innerWidth <= 760);
}
onMount(() => {
handleResize();
const _isMvpUser = localStorage.getItem('mvp');
console.log('mounting layout', isMvpUser, path, _isMvpUser);
@@ -103,9 +110,9 @@
localStorage.setItem('mvp', 'true');
allowUser = true;
} else if (!_isMvpUser) {
if (!!path) {
goto('/courses');
}
// if (!!path) {
// goto('/courses');
// }
return;
}
@@ -134,6 +141,7 @@
$: path = $page.path.replace('/', '');
</script>
<svelte:window on:resize={handleResize} />
<Tailwindcss />
<!-- <Nav {segment} /> -->