mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-03 17:08:13 +00:00
Fixes for Bombay
This commit is contained in:
1 parent
50cdba6752
commit
ad660d3dbf
7 files changed
+34
-17
No files matched your search
@@ -5,6 +5,7 @@ import {
|
||||
} from "@fortawesome/pro-solid-svg-icons";
|
||||
import {
|
||||
dndSidePanelWidth,
|
||||
lastSelectedTab,
|
||||
selectedTab,
|
||||
sidePanelHeight,
|
||||
sidePanelVisible,
|
||||
@@ -39,8 +40,14 @@ export const SidePanel = () => {
|
||||
>
|
||||
<button
|
||||
onClick={() => {
|
||||
selectedTab.value = null;
|
||||
sidePanelVisible.value = !sidePanelVisible.value;
|
||||
if (sidePanelVisible.value) {
|
||||
lastSelectedTab.value = selectedTab.value;
|
||||
selectedTab.value = null;
|
||||
sidePanelVisible.value = false;
|
||||
} else {
|
||||
selectedTab.value = lastSelectedTab.value;
|
||||
sidePanelVisible.value = true;
|
||||
}
|
||||
}}
|
||||
className="absolute left-[-25px] flex rounded-l-lg bg-ui-controls px-2 py-3 align-middle text-sm text-white hover:bg-ui-controls-button"
|
||||
style={{ top: sidePanelHeight.value / 2 - 10 }}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useEffect } from "react";
|
||||
import { useSignals } from "@preact/signals-react/runtime";
|
||||
import {
|
||||
lastSelectedTab,
|
||||
selectedTab,
|
||||
sidePanelHeight,
|
||||
sidePanelVisible,
|
||||
@@ -36,12 +37,14 @@ export const SidePanelMenu = () => {
|
||||
className={[
|
||||
"flex flex-col items-center rounded-lg px-2 py-3",
|
||||
tab.value === selectedTab?.value?.value
|
||||
? "bg-assets-selectedTab"
|
||||
: "",
|
||||
? "bg-assets-selectedTab opacity-100"
|
||||
: "opacity-50",
|
||||
].join(" ")}
|
||||
onClick={() => {
|
||||
selectedTab.value = tab;
|
||||
sidePanelVisible.value = true;
|
||||
if (!sidePanelVisible.value) {
|
||||
sidePanelVisible.value = true;
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
|
||||
@@ -24,17 +24,20 @@ export const AnimationTab = () => {
|
||||
<button
|
||||
className={[
|
||||
"bg-assets-background text-nowrap rounded-lg px-3 py-1 text-sm",
|
||||
"disabled:text-gray-500",
|
||||
animationFilter.value === AssetFilterOption.MINE
|
||||
? "border-2 border-brand-primary"
|
||||
: "",
|
||||
].join(" ")}
|
||||
onClick={() => (animationFilter.value = AssetFilterOption.MINE)}
|
||||
disabled={!animationItems.value.some((item) => item.isMine)}
|
||||
>
|
||||
My Animations
|
||||
</button>
|
||||
<button
|
||||
className={[
|
||||
"bg-assets-background rounded-lg px-3 py-1 text-sm",
|
||||
"disabled:text-gray-500",
|
||||
animationFilter.value === AssetFilterOption.BOOKMARKED
|
||||
? "border-2 border-brand-primary"
|
||||
: "",
|
||||
@@ -42,6 +45,7 @@ export const AnimationTab = () => {
|
||||
onClick={() =>
|
||||
(animationFilter.value = AssetFilterOption.BOOKMARKED)
|
||||
}
|
||||
disabled={!animationItems.value.some((item) => item.isBookmarked)}
|
||||
>
|
||||
Bookmarked
|
||||
</button>
|
||||
|
||||
@@ -24,22 +24,26 @@ export const AudioTab = () => {
|
||||
<button
|
||||
className={[
|
||||
"bg-assets-background text-nowrap rounded-lg px-3 py-1 text-sm",
|
||||
"disabled:text-gray-500",
|
||||
audioFilter.value === AssetFilterOption.MINE
|
||||
? "border-2 border-brand-primary"
|
||||
: "",
|
||||
].join(" ")}
|
||||
onClick={() => (audioFilter.value = AssetFilterOption.MINE)}
|
||||
disabled={!audioItems.value.some((item) => item.isMine)}
|
||||
>
|
||||
My Audios
|
||||
</button>
|
||||
<button
|
||||
className={[
|
||||
"bg-assets-background rounded-lg px-3 py-1 text-sm",
|
||||
"disabled:text-gray-500",
|
||||
audioFilter.value === AssetFilterOption.BOOKMARKED
|
||||
? "border-2 border-brand-primary"
|
||||
: "",
|
||||
].join(" ")}
|
||||
onClick={() => (audioFilter.value = AssetFilterOption.BOOKMARKED)}
|
||||
disabled={!audioItems.value.some((item) => item.isBookmarked)}
|
||||
>
|
||||
Bookmarked
|
||||
</button>
|
||||
|
||||
@@ -24,22 +24,26 @@ export const CameraTab = () => {
|
||||
<button
|
||||
className={[
|
||||
"bg-assets-background text-nowrap rounded-lg px-3 py-1 text-sm",
|
||||
"disabled:text-gray-500",
|
||||
cameraFilter.value === AssetFilterOption.MINE
|
||||
? "border-2 border-brand-primary"
|
||||
: "",
|
||||
].join(" ")}
|
||||
onClick={() => (cameraFilter.value = AssetFilterOption.MINE)}
|
||||
disabled={!cameraItems.value.some((item) => item.isMine)}
|
||||
>
|
||||
My Cameras
|
||||
</button>
|
||||
<button
|
||||
className={[
|
||||
"bg-assets-background rounded-lg px-3 py-1 text-sm",
|
||||
"disabled:text-gray-500",
|
||||
cameraFilter.value === AssetFilterOption.BOOKMARKED
|
||||
? "border-2 border-brand-primary"
|
||||
: "",
|
||||
].join(" ")}
|
||||
onClick={() => (cameraFilter.value = AssetFilterOption.BOOKMARKED)}
|
||||
disabled={!cameraItems.value.some((item) => item.isBookmarked)}
|
||||
>
|
||||
Bookmarked
|
||||
</button>
|
||||
|
||||
@@ -17,6 +17,7 @@ export const ObjectsTab = ({ type }: Props) => {
|
||||
|
||||
const assetFilter =
|
||||
type === AssetType.CHARACTER ? characterFilter : objectFilter;
|
||||
const items = type === AssetType.CHARACTER ? characterItems : objectItems;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -36,22 +37,26 @@ export const ObjectsTab = ({ type }: Props) => {
|
||||
<button
|
||||
className={[
|
||||
"bg-assets-background text-nowrap rounded-lg px-3 py-1 text-sm",
|
||||
"disabled:text-gray-500",
|
||||
assetFilter.value === AssetFilterOption.MINE
|
||||
? "border-2 border-brand-primary"
|
||||
: "",
|
||||
].join(" ")}
|
||||
onClick={() => (assetFilter.value = AssetFilterOption.MINE)}
|
||||
disabled={!items.value.some((item) => item.isMine)}
|
||||
>
|
||||
My {type === AssetType.CHARACTER ? "Characters" : "Objects"}
|
||||
</button>
|
||||
<button
|
||||
className={[
|
||||
"bg-assets-background rounded-lg px-3 py-1 text-sm",
|
||||
"disabled:text-gray-500",
|
||||
assetFilter.value === AssetFilterOption.BOOKMARKED
|
||||
? "border-2 border-brand-primary"
|
||||
: "",
|
||||
].join(" ")}
|
||||
onClick={() => (assetFilter.value = AssetFilterOption.BOOKMARKED)}
|
||||
disabled={!items.value.some((item) => item.isBookmarked)}
|
||||
>
|
||||
Bookmarked
|
||||
</button>
|
||||
@@ -63,18 +68,7 @@ export const ObjectsTab = ({ type }: Props) => {
|
||||
</button>
|
||||
</div>
|
||||
<div className="mt-2 overflow-y-auto px-2 pt-2">
|
||||
<ItemElements
|
||||
items={
|
||||
type === AssetType.CHARACTER
|
||||
? characterItems.value
|
||||
: objectItems.value
|
||||
}
|
||||
assetFilter={
|
||||
type === AssetType.CHARACTER
|
||||
? characterFilter.value
|
||||
: objectFilter.value
|
||||
}
|
||||
/>
|
||||
<ItemElements items={items.value} assetFilter={assetFilter.value} />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -7,6 +7,7 @@ export const sidePanelVisible = signal(true);
|
||||
export const dndSidePanelWidth = signal(-1);
|
||||
|
||||
export const selectedTab = signal<Tab | null>(null);
|
||||
export const lastSelectedTab = signal<Tab | null>(null);
|
||||
|
||||
export const animationFilter = signal<AssetFilterOption>(AssetFilterOption.ALL);
|
||||
export const audioFilter = signal<AssetFilterOption>(AssetFilterOption.ALL);
|
||||
|
||||
Reference in new issue
Block a user