浏览代码

refac: styling

Timothy Jaeryang Baek 4 月之前
父节点
当前提交
2aa82d98cc
共有 2 个文件被更改,包括 12 次插入5 次删除
  1. 4 1
      src/lib/components/common/Folder.svelte
  2. 8 4
      src/lib/components/layout/Sidebar.svelte

+ 4 - 1
src/lib/components/common/Folder.svelte

@@ -145,9 +145,12 @@
 
 				{#if onAdd}
 					<button
-						class="absolute z-10 right-2 self-center flex items-center"
+						class="absolute z-10 right-2 invisible group-hover:visible self-center flex items-center dark:text-gray-300"
 						on:pointerup={(e) => {
 							e.stopPropagation();
+						}}
+						on:click={(e) => {
+							e.stopPropagation();
 							onAdd();
 						}}
 					>

+ 8 - 4
src/lib/components/layout/Sidebar.svelte

@@ -597,11 +597,15 @@
 					className="px-2 mt-0.5"
 					name={$i18n.t('Channels')}
 					dragAndDrop={false}
-					onAdd={$user.role === 'admin'
-						? () => {
+					onAdd={async () => {
+						if ($user.role === 'admin') {
+							await tick();
+
+							setTimeout(() => {
 								showCreateChannel = true;
-							}
-						: null}
+							}, 0);
+						}
+					}}
 					onAddLabel={$i18n.t('Create Channel')}
 				>
 					{#each $channels as channel}