2021-04-05 07:12:51 +03:00
|
|
|
<script>
|
2023-08-02 19:35:27 +01:00
|
|
|
import { goto } from '$app/navigation';
|
|
|
|
|
import { page } from '$app/stores';
|
|
|
|
|
import { user } from '$lib/utils/store/user';
|
|
|
|
|
import { isCoursePage } from '$lib/utils/functions/app';
|
|
|
|
|
import PrimaryButton from '$lib/components/PrimaryButton/index.svelte';
|
|
|
|
|
import { VARIANTS } from '$lib/components/PrimaryButton/constants';
|
2021-04-05 07:12:51 +03:00
|
|
|
|
2023-08-18 19:28:41 +00:00
|
|
|
export let disableSignup = false;
|
2023-05-16 18:08:42 +01:00
|
|
|
export let logo;
|
|
|
|
|
export let orgName;
|
2023-08-14 06:22:03 +01:00
|
|
|
export let isOrgSite = false;
|
2023-09-26 11:23:54 +01:00
|
|
|
export let backgroundColor = 'bg-white dark:bg-black';
|
2021-08-18 19:47:02 +03:00
|
|
|
|
|
|
|
|
let navClass = '';
|
2021-07-27 22:53:51 +03:00
|
|
|
|
2023-08-04 12:41:12 +01:00
|
|
|
const redirect = isCoursePage($page.url.pathname) ? `?redirect=${$page.url.pathname}` : '';
|
2023-05-16 04:31:45 +00:00
|
|
|
|
2023-08-02 19:35:27 +01:00
|
|
|
$: navClass = '';
|
2021-04-05 07:12:51 +03:00
|
|
|
</script>
|
|
|
|
|
|
2021-07-27 22:53:51 +03:00
|
|
|
<nav
|
2023-08-16 04:24:24 +01:00
|
|
|
class="{navClass} {backgroundColor} sticky top-0 z-50 flex w-full px-2 py-1 border-t-0 border-r-0 border-b border-l-0 border-gray-300"
|
2021-07-27 22:53:51 +03:00
|
|
|
>
|
|
|
|
|
<ul class="flex w-full items-center">
|
2021-06-01 07:19:19 +03:00
|
|
|
<div class="logo">
|
2023-08-04 12:41:12 +01:00
|
|
|
<a href="/" title={`Go to ${orgName || 'ClassroomIO'} Home`} id="logo" data-hveid="8">
|
2021-07-27 22:53:51 +03:00
|
|
|
<img
|
2023-05-16 18:08:42 +01:00
|
|
|
src={logo || '/logo-192.png'}
|
|
|
|
|
alt={`${orgName || 'ClassroomIO'} logo`}
|
2023-08-16 04:24:24 +01:00
|
|
|
class="rounded h-9 w-9 inline-block mx-auto"
|
2021-06-01 07:19:19 +03:00
|
|
|
data-atf="1"
|
2021-07-27 22:53:51 +03:00
|
|
|
/>
|
|
|
|
|
</a>
|
2021-06-01 07:19:19 +03:00
|
|
|
</div>
|
2021-08-18 19:47:02 +03:00
|
|
|
|
|
|
|
|
{#if $user.isLoggedIn}
|
2023-05-15 15:13:42 +00:00
|
|
|
<li class="hidden">
|
2023-08-02 19:35:27 +01:00
|
|
|
<a class="block" href="dashboard"> Dashboard </a>
|
2021-08-18 19:47:02 +03:00
|
|
|
</li>
|
|
|
|
|
|
2023-05-15 15:13:42 +00:00
|
|
|
<li class="hidden">
|
2023-08-02 19:35:27 +01:00
|
|
|
<a class="block" href="courses"> Courses </a>
|
2021-08-18 19:47:02 +03:00
|
|
|
</li>
|
|
|
|
|
|
2021-08-24 18:20:07 +03:00
|
|
|
<li class="hidden">
|
2023-08-02 19:35:27 +01:00
|
|
|
<a class="block" href="discussions"> Discussion </a>
|
2021-08-18 19:47:02 +03:00
|
|
|
</li>
|
|
|
|
|
|
2021-08-24 18:20:07 +03:00
|
|
|
<li class="hidden">
|
2023-08-02 19:35:27 +01:00
|
|
|
<a class="block" href="people">People </a>
|
2021-08-18 19:47:02 +03:00
|
|
|
</li>
|
|
|
|
|
{/if}
|
|
|
|
|
|
2021-07-27 22:53:51 +03:00
|
|
|
<span class="flex-grow" />
|
2021-08-18 19:47:02 +03:00
|
|
|
|
2023-05-16 04:31:45 +00:00
|
|
|
{#if $user.isLoggedIn}
|
2023-08-14 06:22:03 +01:00
|
|
|
{#if isOrgSite}
|
2023-07-19 07:22:42 +00:00
|
|
|
<li><a class="block" href="/lms"> Go to LMS </a></li>
|
|
|
|
|
{/if}
|
2023-05-16 04:31:45 +00:00
|
|
|
{:else}
|
|
|
|
|
<li>
|
2023-08-18 19:28:41 +00:00
|
|
|
<div class="flex">
|
|
|
|
|
<PrimaryButton
|
|
|
|
|
label="Login"
|
|
|
|
|
variant={VARIANTS.TEXT}
|
|
|
|
|
onClick={() => goto('/login' + redirect)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
{#if !disableSignup}
|
2023-07-04 06:58:43 +01:00
|
|
|
<div class="flex">
|
2023-05-16 04:31:45 +00:00
|
|
|
<PrimaryButton
|
2023-08-18 19:28:41 +00:00
|
|
|
label="Signup"
|
|
|
|
|
variant={VARIANTS.CONTAINED}
|
|
|
|
|
onClick={() => goto('/signup' + redirect)}
|
2023-05-16 04:31:45 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
</li>
|
|
|
|
|
{/if}
|
2021-07-27 22:53:51 +03:00
|
|
|
<!-- <li class="hidden">
|
2021-06-01 07:19:19 +03:00
|
|
|
<a
|
|
|
|
|
class="flex items-center"
|
|
|
|
|
href="https://t.me/classroomio"
|
|
|
|
|
target="_blank"
|
|
|
|
|
>
|
2021-07-27 22:53:51 +03:00
|
|
|
<img
|
2021-06-01 07:19:19 +03:00
|
|
|
alt="File:Telegram logo.svg"
|
|
|
|
|
class="mr-1"
|
|
|
|
|
src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Telegram_alternative_logo.svg/50px-Telegram_alternative_logo.svg.png"
|
|
|
|
|
decoding="async"
|
|
|
|
|
width="25"
|
|
|
|
|
height="25"
|
|
|
|
|
srcset="https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Telegram_alternative_logo.svg/50px-Telegram_alternative_logo.svg.png 1.5x, https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Telegram_logo.svg/1024px-Telegram_logo.svg.png 2x"
|
|
|
|
|
data-file-width="25"
|
|
|
|
|
data-file-height="25"
|
2021-07-27 22:53:51 +03:00
|
|
|
/>
|
2023-08-04 12:41:12 +01:00
|
|
|
<span><SendAlt32 class="carbon-icon dark:text-white" /> Канал</span>
|
|
|
|
|
<SendAlt32 class="carbon-icon dark:text-white" />
|
2021-06-01 07:19:19 +03:00
|
|
|
<span>Канал</span>
|
|
|
|
|
</a>
|
2021-07-27 22:53:51 +03:00
|
|
|
</li> -->
|
2021-06-01 07:19:19 +03:00
|
|
|
<!-- <li class="new-question">
|
|
|
|
|
<NewQuestion />
|
|
|
|
|
</li> -->
|
|
|
|
|
</ul>
|
|
|
|
|
</nav>
|
|
|
|
|
|
2021-04-05 07:12:51 +03:00
|
|
|
<style>
|
|
|
|
|
ul {
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
padding: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* clearfix */
|
|
|
|
|
ul::after {
|
2021-07-18 19:12:39 +03:00
|
|
|
content: '';
|
2021-04-05 07:12:51 +03:00
|
|
|
display: block;
|
|
|
|
|
clear: both;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-07 03:43:37 +03:00
|
|
|
/* li.new-question {
|
2021-04-05 07:12:51 +03:00
|
|
|
margin-top: 10px;
|
2021-05-07 03:43:37 +03:00
|
|
|
} */
|
2021-04-05 07:12:51 +03:00
|
|
|
|
|
|
|
|
a {
|
|
|
|
|
text-decoration: none;
|
2021-09-24 13:20:40 +03:00
|
|
|
color: var(--main-primary-color);
|
2021-07-27 22:53:51 +03:00
|
|
|
padding: 0 1.5em;
|
2021-04-05 07:12:51 +03:00
|
|
|
font-weight: 700;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2021-05-07 03:43:37 +03:00
|
|
|
flex-direction: column;
|
2021-04-05 07:12:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media only screen and (max-width: 1002px) {
|
|
|
|
|
nav.hide {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
ul {
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
2021-11-07 01:31:59 +02:00
|
|
|
|
|
|
|
|
a {
|
|
|
|
|
padding: 0 0.5em;
|
|
|
|
|
}
|
2021-04-05 07:12:51 +03:00
|
|
|
}
|
|
|
|
|
</style>
|