2021-04-05 07:12:51 +03:00
|
|
|
<script>
|
2023-05-16 04:31:45 +00:00
|
|
|
import { goto, stores } from '@sapper/app';
|
2023-05-15 15:36:23 +00:00
|
|
|
import { user } from '../../utils/store/user';
|
2023-07-19 07:22:42 +00:00
|
|
|
import { appStore } from '../../utils/store/app';
|
2023-05-16 04:31:45 +00:00
|
|
|
import { isCoursePage } from '../../utils/functions/app';
|
2021-08-18 19:47:02 +03:00
|
|
|
import PrimaryButton from '../PrimaryButton/index.svelte';
|
2022-11-28 11:23:46 +01:00
|
|
|
import { VARIANTS } from '../PrimaryButton/constants';
|
2021-04-05 07:12:51 +03:00
|
|
|
|
2021-08-18 19:47:02 +03:00
|
|
|
export let segment;
|
2021-08-18 20:23:56 +03:00
|
|
|
export let disableLogin;
|
2023-05-16 18:08:42 +01:00
|
|
|
export let logo;
|
|
|
|
|
export let orgName;
|
2021-08-18 19:47:02 +03:00
|
|
|
|
2023-05-16 04:31:45 +00:00
|
|
|
let { page } = stores();
|
2021-08-18 19:47:02 +03:00
|
|
|
let navClass = '';
|
2021-07-27 22:53:51 +03:00
|
|
|
|
2023-05-16 04:31:45 +00:00
|
|
|
const redirect = isCoursePage($page.path) ? `?redirect=${$page.path}` : '';
|
|
|
|
|
|
2021-07-18 19:12:39 +03:00
|
|
|
$: navClass = ['discussion'].includes(segment) ? 'hide' : '';
|
2021-04-05 07:12:51 +03:00
|
|
|
</script>
|
|
|
|
|
|
2021-07-27 22:53:51 +03:00
|
|
|
<nav
|
2023-05-16 04:31:45 +00:00
|
|
|
class="{navClass} bg-white sticky top-0 z-50 flex w-full p-2 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-05-16 18:08:42 +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`}
|
2021-07-27 22:53:51 +03:00
|
|
|
class="rounded h-10 w-10 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">
|
2021-08-18 19:47:02 +03:00
|
|
|
<a
|
|
|
|
|
class="block"
|
|
|
|
|
aria-current={segment === undefined || segment === 'dashboard'
|
|
|
|
|
? 'page'
|
|
|
|
|
: undefined}
|
|
|
|
|
href="dashboard"
|
|
|
|
|
>
|
|
|
|
|
Dashboard
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
|
2023-05-15 15:13:42 +00:00
|
|
|
<li class="hidden">
|
2021-08-18 19:47:02 +03:00
|
|
|
<a
|
|
|
|
|
class="block"
|
|
|
|
|
aria-current={segment === 'courses' ? 'page' : undefined}
|
|
|
|
|
href="courses"
|
|
|
|
|
>
|
|
|
|
|
Courses
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
|
2021-08-24 18:20:07 +03:00
|
|
|
<li class="hidden">
|
2021-08-18 19:47:02 +03:00
|
|
|
<a
|
|
|
|
|
class="block"
|
|
|
|
|
aria-current={segment === 'discussions' || segment === 'discussion'
|
|
|
|
|
? 'page'
|
|
|
|
|
: undefined}
|
|
|
|
|
href="discussions"
|
|
|
|
|
>
|
|
|
|
|
Discussion
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
|
2021-08-24 18:20:07 +03:00
|
|
|
<li class="hidden">
|
2021-08-18 19:47:02 +03:00
|
|
|
<a
|
|
|
|
|
class="block"
|
|
|
|
|
aria-current={segment === 'people' ? 'page' : undefined}
|
|
|
|
|
href="people"
|
|
|
|
|
>People
|
|
|
|
|
</a>
|
|
|
|
|
</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-07-19 07:22:42 +00:00
|
|
|
{#if $appStore.isStudentDomain}
|
|
|
|
|
<li><a class="block" href="/lms"> Go to LMS </a></li>
|
|
|
|
|
{/if}
|
2023-05-16 04:31:45 +00:00
|
|
|
{:else}
|
|
|
|
|
<li>
|
|
|
|
|
{#if !disableLogin}
|
2023-07-04 06:58:43 +01:00
|
|
|
<div class="flex">
|
2023-05-16 04:31:45 +00:00
|
|
|
<PrimaryButton
|
|
|
|
|
label="Login"
|
|
|
|
|
variant={VARIANTS.NONE}
|
|
|
|
|
className="py-3 px-6 mx-2 app-background-color"
|
2023-07-18 07:40:12 +00:00
|
|
|
onClick={() => {
|
|
|
|
|
goto('/login' + redirect);
|
|
|
|
|
}}
|
2023-05-16 04:31:45 +00:00
|
|
|
/>
|
|
|
|
|
<PrimaryButton
|
|
|
|
|
label="Sign Up"
|
|
|
|
|
variant={VARIANTS.CONTAINED}
|
|
|
|
|
className="py-3 px-6 mx-2"
|
|
|
|
|
onClick={() => goto('/signup' + redirect)}
|
|
|
|
|
/>
|
|
|
|
|
</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
|
|
|
/>
|
|
|
|
|
<span><SendAlt32 class="carbon-icon" /> Канал</span>
|
2021-06-01 07:19:19 +03:00
|
|
|
<SendAlt32 class="carbon-icon" />
|
|
|
|
|
<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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[aria-current] {
|
2021-05-06 08:22:25 +03:00
|
|
|
color: var(--main-primary-color);
|
2021-07-27 22:53:51 +03:00
|
|
|
position: relative;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
}
|
|
|
|
|
[aria-current]::after {
|
|
|
|
|
position: absolute;
|
|
|
|
|
content: '';
|
|
|
|
|
width: calc(100% - 3em);
|
|
|
|
|
height: 2px;
|
|
|
|
|
background-color: var(--main-primary-color);
|
|
|
|
|
display: block;
|
|
|
|
|
bottom: -17px;
|
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>
|