Skip to content

Commit

Permalink
Merge pull request #168 from CodeCrowCorp/dev
Browse files Browse the repository at this point in the history
Fix: testing codecov changes
  • Loading branch information
gagansuie authored Jan 19, 2023
2 parents 6289578 + 82f54a3 commit 9854056
Show file tree
Hide file tree
Showing 33 changed files with 1,985 additions and 1,925 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage-website",
"version": "0.0.1",
"version": "0.0.2",
"license": "GPL-3.0",
"private": true,
"type": "module",
Expand Down
19 changes: 10 additions & 9 deletions src/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
// and what to do when importing types

declare namespace App {
interface Locals {
user: {
token: string
userId: string
}
}
// interface PageData {}
// interface Error {}
// interface Platform {}
interface Locals {
user: {
token?: string
userId?: string
user?: object
}
}
// interface PageData {}
// interface Error {}
// interface Platform {}
}
73 changes: 56 additions & 17 deletions src/hooks.server.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,64 @@
import { getUserDetails } from '$lib/stores/authStore'
import type { Handle } from '@sveltejs/kit'

export const handle: Handle = async ({ event, resolve }) => {
const token = event.url.searchParams.get('token') || event.cookies.get('token')
const userId = event.url.searchParams.get('userId') || event.cookies.get('userId')

if (!token || !userId) {
return await resolve(event)
}

if (token && userId) {
event.cookies.set('token', token)
event.cookies.set('userId', userId)
event.locals.user = {
userId,
token
}
}

return await resolve(event)
const userId = event.url.searchParams.get('userId') || event.cookies.get('userId') || ''
let token = event.url.searchParams.get('token') || event.cookies.get('token') || ''
let user

if (event.locals && event.locals.user) {
user = event.locals.user.user
}

if (!token || !userId) {
return await resolve(event)
}

if (token && userId) {
if (!user) {
const response = await getUserDetails(token, userId)
if (response) {
if (response.freshJwt) {
token = response.freshJwt
}
user = response
}
}

event.cookies.set('token', token)
event.cookies.set('userId', userId)
event.locals.user = {
userId,
token,
user
}
}

return await resolve(event)
}

// const isAdminPage = /^\/admin\/(.*)/.test(route.id)
// const isProfilePage = /^\/profile\/(.*)/.test(route.id)
// const isPremiumPage = /^\/premium\/(.*)/.test(route.id)
// await getRemoteConfigs()
// if (isMaintenanceModeEnabled) {
// if (locals.user.user.isAdmin) {
// throw redirect(302, '/maintenance')
// }
// } else {
// if (!locals.user) {
// throw redirect(302, '/browse')
// } else {
// if (locals.user.user.isBanned) {
// throw redirect(308, '/banned')
// }

// if (isAdminPage && !locals.user.user.isAdmin) {
// throw redirect(302, '/browse')
// }
// }
// }

// import { remoteConfigStore } from '$lib/stores/remoteConfigStore'
// import type { Handle, HandleServerError, RequestEvent } from '@sveltejs/kit'
// import type { MaybePromise } from '@sveltejs/kit/types/private'
Expand Down
75 changes: 22 additions & 53 deletions src/lib/assets/styles/tailwind-output.css
Original file line number Diff line number Diff line change
Expand Up @@ -1391,15 +1391,6 @@ html {
margin-top: 1.5rem;
justify-content: flex-end;
}
.modal-toggle {
position: fixed;
height: 0px;
width: 0px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
opacity: 0;
}
.navbar {
display: flex;
align-items: center;
Expand Down Expand Up @@ -2632,10 +2623,20 @@ html {
:where(.table *:last-child) :where(*:last-child) :where(th, td):last-child {
border-bottom-right-radius: 0.5rem;
}
.textarea-bordered {
--tw-border-opacity: 0.2;
}
.textarea:focus {
outline: 2px solid hsla(var(--bc) / 0.2);
outline-offset: 2px;
}
.textarea-primary {
--tw-border-opacity: 1;
border-color: hsl(var(--p) / var(--tw-border-opacity));
}
.textarea-primary:focus {
outline: 2px solid hsl(var(--p));
}
.textarea-info {
--tw-border-opacity: 1;
border-color: hsl(var(--in) / var(--tw-border-opacity));
Expand Down Expand Up @@ -3103,12 +3104,12 @@ html {
width: -moz-fit-content;
width: fit-content;
}
.w-96 {
width: 24rem;
}
.w-72 {
width: 18rem;
}
.w-96 {
width: 24rem;
}
.w-10 {
width: 2.5rem;
}
Expand Down Expand Up @@ -3150,9 +3151,6 @@ html {
.cursor-pointer {
cursor: pointer;
}
.resize-none {
resize: none;
}
.grid-flow-col {
grid-auto-flow: column;
}
Expand Down Expand Up @@ -3224,9 +3222,6 @@ html {
.rounded-md {
border-radius: 0.375rem;
}
.rounded {
border-radius: 0.25rem;
}
.rounded-lg {
border-radius: 0.5rem;
}
Expand Down Expand Up @@ -3354,9 +3349,9 @@ html {
padding-top: 1.25rem;
padding-bottom: 1.25rem;
}
.px-10 {
padding-left: 2.5rem;
padding-right: 2.5rem;
.px-4 {
padding-left: 1rem;
padding-right: 1rem;
}
.px-6 {
padding-left: 1.5rem;
Expand All @@ -3370,10 +3365,6 @@ html {
padding-top: 2rem;
padding-bottom: 2rem;
}
.px-4 {
padding-left: 1rem;
padding-right: 1rem;
}
.pt-16 {
padding-top: 4rem;
}
Expand All @@ -3395,9 +3386,6 @@ html {
.pb-5 {
padding-bottom: 1.25rem;
}
.pl-3 {
padding-left: 0.75rem;
}
.pl-5 {
padding-left: 1.25rem;
}
Expand Down Expand Up @@ -3550,10 +3538,6 @@ html {
--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.outline-none {
outline: 2px solid transparent;
outline-offset: 2px;
}
.ring {
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);
Expand Down Expand Up @@ -3634,61 +3618,42 @@ html {
.scrollbar-thumb-rounded::-webkit-scrollbar-thumb {
border-radius: 0.25rem;
}

.focus\:border:focus {
border-width: 1px;
}

.focus\:border-indigo-700:focus {
--tw-border-opacity: 1;
border-color: rgb(67 56 202 / var(--tw-border-opacity));
}

.focus\:outline-none:focus {
outline: 2px solid transparent;
outline-offset: 2px;
}

.focus\:ring-2:focus {
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}

.focus\:ring-white:focus {
--tw-ring-opacity: 1;
--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity));
}

.hover\:bg-gray-50:hover {
--tw-bg-opacity: 1;
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
}

.hover\:bg-gray-100:hover {
--tw-bg-opacity: 1;
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
}

.hover\:bg-blue-100:hover {
--tw-bg-opacity: 1;
background-color: rgb(219 234 254 / var(--tw-bg-opacity));
}

.hover\:text-gray-700:hover {
--tw-text-opacity: 1;
color: rgb(55 65 81 / var(--tw-text-opacity));
}

.hover\:text-blue-700:hover {
--tw-text-opacity: 1;
color: rgb(29 78 216 / var(--tw-text-opacity));
}

.hover\:underline:hover {
text-decoration-line: underline;
}

@media (prefers-color-scheme: dark) {

.dark\:border-gray-700 {
Expand Down Expand Up @@ -3736,7 +3701,6 @@ html {
color: rgb(255 255 255 / var(--tw-text-opacity));
}
}

@media (min-width: 640px) {

.sm\:col-span-2 {
Expand All @@ -3755,7 +3719,13 @@ html {
gap: 1.5rem;
}
}
@media (min-width: 768px) {

.md\:px-10 {
padding-left: 2.5rem;
padding-right: 2.5rem;
}
}
@media (min-width: 1024px) {

.lg\:order-2 {
Expand Down Expand Up @@ -3827,7 +3797,6 @@ html {
text-align: right;
}
}

@media (min-width: 1280px) {

.xl\:mb-0 {
Expand Down
Empty file.
22 changes: 22 additions & 0 deletions src/lib/components/Browse/ChannelSearch.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script>
import IconCreate from '$lib/assets/icons/IconCreate.svelte'
import IconSearch from '$lib/assets/icons/IconSearch.svelte'
</script>

<div class="flex gap-4 py-5 pl-5">
<div class="form-control">
<div class="input-group">
<input
type="text"
placeholder="Search channels"
class="input input-bordered input-primary w-72" />
<button class="btn btn-square">
<IconSearch />
</button>
</div>
</div>

<button class="btn btn-wide btn-primary gap-2">
<IconCreate />
Create a channel</button>
</div>
Original file line number Diff line number Diff line change
@@ -1,28 +1,8 @@
<script>
import IconCreate from '$lib/assets/icons/IconCreate.svelte'
import IconSearch from '$lib/assets/icons/IconSearch.svelte'
import IconLock from '$lib/assets/icons/IconLock.svelte'
import IconViewers from '$lib/assets/icons/IconViewers.svelte'
</script>

<div class="flex gap-4 py-5 pl-5">
<div class="form-control">
<div class="input-group">
<input
type="text"
placeholder="Search channels"
class="input input-bordered input-primary w-72" />
<button class="btn btn-square">
<IconSearch />
</button>
</div>
</div>

<button class="btn btn-wide btn-primary gap-2">
<IconCreate />
Create a channel</button>
</div>

<div class="overflow-x-auto w-full">
<table class="table table-zebra w-full">
<!-- head -->
Expand Down
Empty file.
File renamed without changes.
Loading

0 comments on commit 9854056

Please sign in to comment.