Skip to content

Commit

Permalink
git(frontend): merge pr changes to svelte-5
Browse files Browse the repository at this point in the history
  • Loading branch information
zleyyij committed Jan 9, 2025
1 parent 0158b05 commit 0e96d35
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 41 deletions.
1 change: 0 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"@eslint/js": "^9.12.0",
"@sveltejs/adapter-static": "^3.0.6",
"@sveltejs/kit": "^2.7.2",
"@types/dompurify": "^3.2.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@types/eslint": "^9.6.1",
"@typescript-eslint/eslint-plugin": "^8.8.1",
Expand Down
9 changes: 1 addition & 8 deletions frontend/src/lib/components/editors/DocumentEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
const charCount = 500;
let showCommitModal = $state(false);
let commitModal: HTMLElement = $state();
let commitModal: HTMLElement | undefined = $state();
let commitMessageInput: string = $state('');
let previousFile: string | null = null;
Expand Down Expand Up @@ -60,9 +60,6 @@
await saveChangesHandler(commitMessage);
}
<<<<<<< HEAD
export let saveChangesHandler: (commitMessage: string) => Promise<void>;
=======
interface Props {
previewWindow: HTMLElement;
saveChangesHandler: (commitMessage: string) => Promise<void>;
Expand All @@ -74,7 +71,6 @@
saveChangesHandler = $bindable(),
createPullRequestHandler = $bindable()
}: Props = $props();
>>>>>>> svelte-5
async function cancelChangesHandler() {
if ($editorText !== get(currentFile)) {
Expand Down Expand Up @@ -149,8 +145,6 @@
<path d="M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z" />
</svg>
</button>
<<<<<<< HEAD
=======
<!-- Pull Request -->
<button onclick={createPullRequestHandler} class="pull-request" title="Create Pull Request">
<svg
Expand All @@ -169,7 +163,6 @@
</svg>
<span>Create Pull Request</span>
</button>
>>>>>>> svelte-5
</div>
<div class="editor-panes">
<textarea bind:value={$editorText} class="editor-pane"></textarea>
Expand Down
28 changes: 3 additions & 25 deletions frontend/src/lib/components/topbar/TopBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
import { me } from '$lib/main';
import { onMount } from 'svelte';
import { createEventDispatcher } from 'svelte';
<<<<<<< HEAD
import BranchButton from '../BranchButton.svelte';
import PullRequest from './PullRequest.svelte';
=======
import BranchButton from './BranchButton.svelte';
>>>>>>> svelte-5
import PullRequest from './PullRequest.svelte';
let username: string = $state('');
let profilePictureUrl = $state('');
Expand Down Expand Up @@ -36,12 +32,11 @@

<div class="top-bar">
<BranchButton />
<<<<<<< HEAD
<div class="right-items">
<PullRequest />
<div
on:click={settingsClickHandler}
on:keydown={settingsClickHandler}
onclick={settingsClickHandler}
onkeydown={settingsClickHandler}
role="button"
tabindex="0"
class="settings"
Expand All @@ -55,23 +50,6 @@
> -->
<img src={profilePictureUrl} alt="Profile" width="35rem" height="35rem" />
</div>
=======
<div
onclick={settingsClickHandler}
onkeydown={settingsClickHandler}
role="button"
tabindex="0"
class="settings"
title="Settings"
>
<p>{username}</p>
<!-- <svg xmlns="http://www.w3.org/2000/svg" height="2rem" viewBox="0 -960 960 960" width="2rem"
><path
d="m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"
/></svg
> -->
<img src={profilePictureUrl} alt="Profile" width="35rem" height="35rem" />
>>>>>>> svelte-5
</div>
</div>

Expand Down
7 changes: 0 additions & 7 deletions frontend/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@
}
});
});
<<<<<<< HEAD
=======
let createPullRequestHandler = $state(async (): Promise<void> => {
const title = `Pull request for ${$currentFile}`;
Expand Down Expand Up @@ -231,7 +229,6 @@
});
}
});
>>>>>>> svelte-5
</script>

<div style="--sidebar-width: {sidebarWidth}" class="container">
Expand Down Expand Up @@ -276,15 +273,11 @@
/>
{#if mode === SelectedMode.Documents}
{#if showEditor && $currentFile !== ''}
<<<<<<< HEAD
<DocumentEditor bind:saveChangesHandler bind:previewWindow />
=======
<DocumentEditor
bind:saveChangesHandler
bind:previewWindow={previewWindow!}
bind:createPullRequestHandler
/>
>>>>>>> svelte-5
{:else}
<span class="nofile-placeholder">
<p>
Expand Down

0 comments on commit 0e96d35

Please sign in to comment.