Skip to content

Commit

Permalink
Merge pull request #17 from KreativeThinker/main
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
KreativeThinker authored Apr 13, 2024
2 parents 8dcb4a8 + 849bb7b commit 760db1b
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 127 deletions.
4 changes: 2 additions & 2 deletions src/lib/components/NewIdea.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
});
async function deleteIdea() {
const { data, error } = await supabase.from('ideas').delete().eq('team', $user.team);
const { data, error } = await supabase.from('ideas').delete().eq('team', $user.team).select();
if (error) {
console.log('Error retrieving idea', error.message);
}
Expand Down Expand Up @@ -110,7 +110,7 @@
type="url"
name="url"
value={idea.url || ''}
pattern="^https://github\.com(?:/\S*)?$"
pattern="^(?:https:\/\/github\.com\/[^\/]+\/[^\/]+)?$"
placeholder="https://github.com/<userame>/<repository>"
/>
<input
Expand Down
4 changes: 3 additions & 1 deletion src/lib/components/Tag.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
export { className as class };
</script>

<p class="w-fit rounded-full bg-foreground px-3 text-background {className}"><slot /></p>
<p class="line-clamp-1 rounded-full bg-foreground px-4 text-background {className}">
<slot />
</p>
12 changes: 5 additions & 7 deletions src/routes/(protected)/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@
}
</script>

<img
src="{base}/assets/Asset 1.png"
class="gradient fixed left-1/2 top-1/2 -z-10 h-1/2 -translate-y-1/3 translate-x-[-50%] lg:h-screen"
alt="Gradient"
/>
<Loading {loading}>
<div class="absolute left-0 top-0 -z-10 h-full w-full overflow-hidden">
<img
src="{base}/assets/Asset 1.png"
class="gradient absolute left-[calc(50%-550px)] top-52 -z-10 m-auto h-[1024px] w-[1024px] rotate-[128deg] overflow-hidden"
alt="Gradient"
/>
</div>
{#if !$auth_user.id}
<Section>
<div class="m-auto max-w-xl space-y-8">
Expand Down
54 changes: 25 additions & 29 deletions src/routes/(protected)/projects/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@
projects = data;
for (let project of projects) {
project.issues.reverse();
project.difficulty =
project.difficulty.slice(0, 1).toUpperCase() + project.difficulty.slice(1);
if (project.difficulty) {
project.difficulty =
project.difficulty.slice(0, 1).toUpperCase() + project.difficulty.slice(1);
}
}
}
});
Expand All @@ -57,22 +59,15 @@
async function save(e: SubmitEvent) {
const formData = new FormData(e.target as HTMLFormElement);
let url = formData.get('url') as string;
const urlPattern: RegExp = /^https:\/\/github\.com\/([^/]+)\/([^/]+)$/;
const match: RegExpMatchArray | null = url.match(urlPattern);
if (match) {
const { data, error } = await supabase.from('project_submissions').insert([
{
url: url,
team: $user.team as string
}
]);
const { data, error } = await supabase.from('project_submissions').insert([
{
url: url,
team: $user.team as string
}
]);
if (error) console.log('Error Saving Submission:', error.message);
if (!error) add = false;
} else {
console.log('URL does not match the pattern.');
}
if (error) console.log('Error Saving Submission:', error.message);
if (!error) add = false;
}
function toggle(e: Event) {
Expand All @@ -89,6 +84,7 @@
class="absolute right-4 top-4 h-16 w-16 border-0 p-4 text-3xl text-zinc-400 hover:bg-negative hover:text-foreground"
on:click={() => {
$: view = false;
$: viewReadme = true;
}}>X</button
>
<div class="mb-8 flex flex-col py-4">
Expand Down Expand Up @@ -118,7 +114,7 @@
{:else}
<div class="space-y-8">
{#each projects[focused].issues as issue}
<div class="flex w-full justify-between">
<div class="flex w-full flex-col justify-between space-y-4 md:flex-row md:space-y-0">
<a href={issue.url}><h3 class="m-0 text-foreground">{issue.title}</h3></a>
<div class="flex space-x-4">
{#each issue.labels as label}
Expand Down Expand Up @@ -165,16 +161,16 @@
</Glass>
{/each}
</div>
<div class="fixed bottom-0 right-0 z-10 p-5">
<button
data-primary
class="relative z-10 flex h-12 w-12 items-center justify-center overflow-hidden rounded-2xl bg-foreground text-3xl text-background"
on:click={() => {
add = true;
}}
>+
</button>
</div>
<!-- <div class="fixed bottom-0 right-0 z-10 p-5"> -->
<!-- <button -->
<!-- data-primary -->
<!-- class="relative z-10 flex h-12 w-12 items-center justify-center overflow-hidden rounded-2xl bg-foreground text-3xl text-background" -->
<!-- on:click={() => { -->
<!-- add = true; -->
<!-- }} -->
<!-- >+ -->
<!-- </button> -->
<!-- </div> -->
</Section>

{#if add}
Expand All @@ -198,7 +194,7 @@
class="w-full"
type="url"
name="url"
pattern="^https://github\.com(?:/\S*)?$"
pattern="^https:\/\/github\.com\/([^\/]+)\/([^\/]+)$"
placeholder="https://github.com/<userame>/<repository>"
/>
<input
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<div
class="absolute bottom-0 right-0 hidden h-3/4 w-1/2 overflow-hidden rounded-tl-3xl bg-white xl:block"
>
<img src="{base}/hero_image.png" />
<img src="{base}/hero_image.png" alt="hero" />
</div>

<div class="w-full max-w-2xl xl:mb-24 xl:w-1/2">
Expand Down
85 changes: 0 additions & 85 deletions src/routes/login/+page.svelte

This file was deleted.

3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"moduleResolution": "bundler",
"esModuleInterop": true
"moduleResolution": "bundler"

}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
Expand Down

0 comments on commit 760db1b

Please sign in to comment.