Skip to content

Commit

Permalink
style: updated group link display
Browse files Browse the repository at this point in the history
Fixed upld.ts to import from Vite provided env vars
  • Loading branch information
VaiTon committed Sep 29, 2023
1 parent 222532d commit 424d673
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/lib/teachings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export type Teaching = {
name: string;
url: string;
telegram?: string;
};

export type TeachingYear = {
Expand Down
6 changes: 5 additions & 1 deletion src/lib/upld.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
const UPDL_URL = process.env.VITE_UPLD_URL;
const UPDL_URL = import.meta.env.VITE_UPLD_URL;

if (UPDL_URL == null) {
throw new Error('Missing VITE_UPLD_URL');
}

export function getLoginUrl(redirectUrl: string | URL): string {
return `${UPDL_URL}/login?redirect_uri=${redirectUrl}`;
Expand Down
15 changes: 6 additions & 9 deletions src/routes/dash/[course]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,18 @@
{@const disabled = !activeYears.includes(teaching)}
{@const href = base + '/' + teaching.url}
<li
class:disabled
class="flex xs:flex-1 justify-center border-base-content items-center m-2 border-2 rounded-md"
class="flex flex-row xs:flex-1 justify-center border-base-content items-center m-2 border-2 rounded-md join"
>
<a href={disabled ? null : href} class="text-center text-lg">
<a href={disabled ? null : href} class="text-center text-lg join-item">
{#if teaching.name}
<div>
{teaching.name}
{#if teaching.telegram}
<a href="https://t.me/{teaching.telegram}">👥</a>
{/if}
</div>
{teaching.name}
{:else}
{teaching.url}
{/if}
</a>
{#if teaching.telegram}
<a href="https://t.me/{teaching.telegram}" class="text-center text-lg join-item border-l-2">👥</a>
{/if}
</li>
{/each}
</div>
Expand Down

1 comment on commit 424d673

@vercel
Copy link

@vercel vercel bot commented on 424d673 Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

dynamik – ./

dynamik.vercel.app
dynamik-csunibo.vercel.app
dynamik-git-main-csunibo.vercel.app

Please sign in to comment.