Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: testing codecov changes #168

Merged
merged 36 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
108fc94
fixed auth modal logic and responsive design
msisaifu Jan 16, 2023
734cf7d
fix logic
msisaifu Jan 16, 2023
274ddea
Chore: changed exported classes to exported functions
gagansuie Jan 16, 2023
636b308
Merge pull request #128 from gagan-suie/dev
gagansuie Jan 16, 2023
0ef025e
Merge pull request #123 from msisaifu/fix-oauth-login-prompt-mobile
gagansuie Jan 16, 2023
5361800
Build(deps-dev): bump @sveltejs/adapter-cloudflare from 1.0.0 to 1.0.3
dependabot[bot] Jan 16, 2023
ae30e9c
Build(deps-dev): bump eslint from 8.31.0 to 8.32.0
dependabot[bot] Jan 16, 2023
b65bb34
Build(deps-dev): bump prettier from 2.8.2 to 2.8.3
dependabot[bot] Jan 16, 2023
ef6225c
Build(deps-dev): bump @sveltejs/kit from 1.0.11 to 1.1.1
dependabot[bot] Jan 16, 2023
8b3a0e1
Merge branch 'dev' of https://github.com/CodeCrowCorp/mage-website in…
gagansuie Jan 16, 2023
b923529
Merge branch 'main' of https://github.com/CodeCrowCorp/mage-website i…
gagansuie Jan 16, 2023
e0520c7
Fix: authentication failure due to header naming
gagansuie Jan 16, 2023
27e53eb
Merge pull request #129 from gagan-suie/dev
gagansuie Jan 16, 2023
d01867f
Fix: removed duplicated route guard code
gagansuie Jan 17, 2023
d20a2a2
Chore: moved LoginPrompt to MainDrawer folder
gagansuie Jan 17, 2023
65b3d4b
Merge pull request #133 from gagan-suie/dev
gagansuie Jan 17, 2023
ee83954
Fix: updated window location for oauth
gagansuie Jan 17, 2023
ffcbf32
Merge pull request #134 from gagan-suie/dev
gagansuie Jan 17, 2023
c6c5598
Fix: input and textarea theming
gagansuie Jan 17, 2023
d21e5ce
Feat: added placeholder components
gagansuie Jan 17, 2023
29d7e9d
Merge pull request #151 from gagan-suie/dev
gagansuie Jan 17, 2023
b1f7eb0
Chore: refactored some channel features
gagansuie Jan 18, 2023
b4c343d
Merge pull request #154 from gagan-suie/dev
gagansuie Jan 18, 2023
f47f42a
Fix: test failures
gagansuie Jan 18, 2023
dde331b
Merge pull request #155 from gagan-suie/dev
gagansuie Jan 18, 2023
b3fc6a1
fix the browse url
msisaifu Jan 18, 2023
2e523c6
Merge pull request #158 from msisaifu/fix-browse-url
gagansuie Jan 18, 2023
330bea2
Merge branch 'main' of https://github.com/CodeCrowCorp/mage-website i…
gagansuie Jan 18, 2023
074b029
Merge branch 'dev' of https://github.com/CodeCrowCorp/mage-website in…
gagansuie Jan 18, 2023
72becd7
fixed the response object
msisaifu Jan 18, 2023
a77e618
Merge pull request #161 from msisaifu/fix-oauth-response
gagansuie Jan 18, 2023
ab0268b
Chore: renamed customUsername to username
gagansuie Jan 18, 2023
d87def8
Merge branch 'dev' of https://github.com/CodeCrowCorp/mage-website in…
gagansuie Jan 18, 2023
2d4b8be
Merge pull request #162 from gagan-suie/dev
gagansuie Jan 18, 2023
81c67d8
Fix: testing codecov changes
gagansuie Jan 19, 2023
82f54a3
Merge pull request #167 from gagan-suie/dev
gagansuie Jan 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading