Radish alpha
r
Radicle desktop app
Radicle
Git (anonymous pull)
Log in to clone via SSH
Remove unified/split view switch from settings
Rūdolfs Ošiņš committed 1 year ago
commit aa955a8a1d5de19276b788a4af48d0cdfbecb9f5
parent f20df85d5eb85560c102f0e81254e17bf984c3e4
3 files changed +0 -97
deleted src/components/DiffViewSwitch.svelte
@@ -1,66 +0,0 @@
-
<script lang="ts" module>
-
  type DiffView = "unified" | "split";
-

-
  export const diffView = writable<DiffView>(loadDiffView());
-

-
  function loadDiffView(): DiffView {
-
    const storedDiffView = localStorage
-
      ? localStorage.getItem("diffView")
-
      : null;
-

-
    if (storedDiffView === null) {
-
      return "unified";
-
    } else {
-
      return storedDiffView as DiffView;
-
    }
-
  }
-

-
  export function storeDiffView(newDiffView: DiffView): void {
-
    diffView.set(newDiffView);
-
    if (localStorage) {
-
      localStorage.setItem("diffView", newDiffView);
-
    } else {
-
      console.warn(
-
        "localStorage isn't available, not able to persist the selected diff view without it.",
-
      );
-
    }
-
  }
-
</script>
-

-
<script lang="ts">
-
  import { writable } from "svelte/store";
-

-
  import Icon from "./Icon.svelte";
-
  import Button from "./Button.svelte";
-
</script>
-

-
<style>
-
  .container {
-
    display: flex;
-
    align-items: center;
-
  }
-
</style>
-

-
<div class="container">
-
  <Button
-
    flatRight
-
    active={$diffView === "unified"}
-
    variant="ghost"
-
    onclick={() => {
-
      storeDiffView("unified");
-
    }}>
-
    <Icon name="unified" />
-
    Unified
-
  </Button>
-

-
  <Button
-
    flatLeft
-
    variant="ghost"
-
    active={$diffView === "split"}
-
    onclick={() => {
-
      storeDiffView("split");
-
    }}>
-
    <Icon name="split" />
-
    Split
-
  </Button>
-
</div>
modified src/components/Icon.svelte
@@ -60,9 +60,7 @@
      | "seedling"
      | "seedling-filled"
      | "settings"
-
      | "split"
      | "sun"
-
      | "unified"
      | "user"
      | "warning";
  }
@@ -1030,19 +1028,6 @@
    <path d="M4 4L5 4L5 7H4V4Z" />
    <path d="M11 9L12 9V12H11V9Z" />
    <path d="M7 4L8 4V7L7 7V4Z" />
-
  {:else if name === "split"}
-
    <path d="M2 3H3L3 13H2L2 3Z" />
-
    <path d="M9 3H10V8H9V3Z" />
-
    <path d="M6 8H7L7 13H6L6 8Z" />
-
    <path d="M3 2L6 2V3L3 3L3 2Z" />
-
    <path d="M10 2L13 2V3L10 3V2Z" />
-
    <path d="M3 13L6 13L6 14H3L3 13Z" />
-
    <path d="M10 13H13V14H10V13Z" />
-
    <path d="M13 3L14 3L14 13H13L13 3Z" />
-
    <path d="M4 6L8 6V7L4 7V6Z" />
-
    <path d="M8 9H12L12 10L8 10V9Z" />
-
    <path d="M9 11L10 11V13L9 13L9 11Z" />
-
    <path d="M6 3L7 3V5H6V3Z" />
  {:else if name === "sun"}
    <path d="M8 2H9V3H8V2Z" />
    <path d="M14 8V9H13V8H14Z" />
@@ -1068,15 +1053,6 @@
    <path d="M6 9L7 9L7 10H6V9Z" />
    <path d="M9 9L10 9L10 10H9L9 9Z" />
    <path d="M9 6H10V7H9V6Z" />
-
  {:else if name === "unified"}
-
    <path d="M3 2.5L11 2.5V3.5L3 3.5V2.5Z" />
-
    <path d="M2 6.5L11 6.5V7.5L2 7.5V6.5Z" />
-
    <path d="M3 10.5H11V11.5L3 11.5V10.5Z" />
-
    <path d="M5 4.5L13 4.5V5.5L5 5.5V4.5Z" />
-
    <path d="M5 8.5L14 8.5V9.5L5 9.5V8.5Z" />
-
    <path d="M5 12.5L13 12.5V13.5L5 13.5V12.5Z" />
-
    <path d="M2 3.5L3 3.5L3 10.5H2L2 3.5Z" />
-
    <path d="M13 5.5L14 5.5L14 12.5H13L13 5.5Z" />
  {:else if name === "user"}
    <path d="M5 3H6V4H5V3Z" />
    <path d="M5 6L5 8H4V6H5Z" />
modified src/components/Settings.svelte
@@ -3,7 +3,6 @@

  import AnnounceSwitch from "./AnnounceSwitch.svelte";
  import Border from "./Border.svelte";
-
  import DiffViewSwitch from "./DiffViewSwitch.svelte";
  import Icon from "./Icon.svelte";
  import NakedButton from "./NakedButton.svelte";
  import Popover from "./Popover.svelte";
@@ -43,12 +42,6 @@
          class="global-flex"
          style:justify-content="space-between"
          style:width="100%">
-
          Diff view <DiffViewSwitch />
-
        </div>
-
        <div
-
          class="global-flex"
-
          style:justify-content="space-between"
-
          style:width="100%">
          Theme <ThemeSwitch />
        </div>
        <div