feat(NewCharButton): Update NewCharButton
* Refactor NewCharButton * Remove BarIcon at NewCharButton * Replaced BaseRoundedButton and SVG
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
import { onDestroy } from "svelte";
|
import { onDestroy } from "svelte";
|
||||||
import { isEqual } from "lodash";
|
import { isEqual } from "lodash";
|
||||||
import SidebarAvatar from "./SidebarAvatar.svelte";
|
import SidebarAvatar from "./SidebarAvatar.svelte";
|
||||||
|
import BaseRoundedButton from "../UI/BaseRoundedButton.svelte";
|
||||||
let openPresetList = false;
|
let openPresetList = false;
|
||||||
let sideBarMode = 0;
|
let sideBarMode = 0;
|
||||||
let editMode = false;
|
let editMode = false;
|
||||||
@@ -101,7 +102,9 @@
|
|||||||
{#if menuMode === 0}
|
{#if menuMode === 0}
|
||||||
{#each charImages as charimg, i}
|
{#each charImages as charimg, i}
|
||||||
<div class="group relative flex items-center px-2">
|
<div class="group relative flex items-center px-2">
|
||||||
<SidebarIndicator isActive={$selectedCharID === i} />
|
<SidebarIndicator
|
||||||
|
isActive={$selectedCharID === i && sideBarMode !== 1}
|
||||||
|
/>
|
||||||
{#if charimg !== ""}
|
{#if charimg !== ""}
|
||||||
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
||||||
<div
|
<div
|
||||||
@@ -169,7 +172,8 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
<BarIcon
|
<div class="flex flex-col items-center space-y-2 px-2">
|
||||||
|
<BaseRoundedButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (sideBarMode === 1) {
|
if (sideBarMode === 1) {
|
||||||
reseter();
|
reseter();
|
||||||
@@ -178,8 +182,19 @@
|
|||||||
reseter();
|
reseter();
|
||||||
sideBarMode = 1;
|
sideBarMode = 1;
|
||||||
}
|
}
|
||||||
}}><PlusIcon /></BarIcon
|
}}
|
||||||
|
><svg viewBox="0 0 24 24" width="1.2em" height="1.2em"
|
||||||
|
><path
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-width="2"
|
||||||
|
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
|
||||||
|
/></svg
|
||||||
|
></BaseRoundedButton
|
||||||
>
|
>
|
||||||
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<BarIcon
|
<BarIcon
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
16
src/lib/UI/BaseRoundedButton.svelte
Normal file
16
src/lib/UI/BaseRoundedButton.svelte
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
export let isDisabled: boolean = false;
|
||||||
|
export let onClick: () => void;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<button
|
||||||
|
disabled={isDisabled}
|
||||||
|
on:click={onClick}
|
||||||
|
class="flex h-[56px] w-[56px] cursor-pointer select-none items-center justify-center
|
||||||
|
transition-colors rounded-full
|
||||||
|
border border-gray-500 text-gray-300
|
||||||
|
hover:border-gray-300
|
||||||
|
{isDisabled ? '!cursor-not-allowed' : ''}"
|
||||||
|
>
|
||||||
|
<slot />
|
||||||
|
</button>
|
||||||
Reference in New Issue
Block a user