Skip to content

Commit

Permalink
chore(web): various bug fixes and refactoring (#713)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaWaite authored Sep 28, 2023
1 parent 3ed4641 commit 2536415
Show file tree
Hide file tree
Showing 27 changed files with 218 additions and 1,234 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ListItem from "@reearth/beta/components/ListItem";
// import ListItem from "@reearth/beta/components/ListItem";
import SidePanelSectionField from "@reearth/beta/components/SidePanelSectionField";
import type { LayerNameUpdateProps } from "@reearth/beta/features/Editor/useLayers";
import type { NLSLayer } from "@reearth/services/api/layersApi/utils";
Expand All @@ -21,27 +21,27 @@ type GroupSectionFieldProps = {
const GroupSectionField: React.FC<GroupSectionFieldProps> = ({
layers,
selectedLayerId,
selectedSceneSetting,
// selectedSceneSetting,
onLayerDelete,
onLayerNameUpdate,
onLayerSelect,
onSceneSettingSelect,
// onSceneSettingSelect,
onDataSourceManagerOpen,
}) => {
const t = useT();

return (
<>
<StyledSidePanelSectionField title={t("Scene")}>
{/* {groups.map(({ schemaGroupId, title }) => (
{/* <StyledSidePanelSectionField title={t("Scene")}> */}
{/* {groups.map(({ schemaGroupId, title }) => (
<GroupSectionFieldText key={schemaGroupId} size="footnote">
{title}
</GroupSectionFieldText>
))} */}
<ListItem isSelected={selectedSceneSetting} onItemClick={onSceneSettingSelect}>
{/* <ListItem isSelected={selectedSceneSetting} onItemClick={onSceneSettingSelect}>
{t("Main")}
</ListItem>
</StyledSidePanelSectionField>
</StyledSidePanelSectionField> */}
<StyledSidePanelSectionField title={t("Layers")}>
<Layers
layers={layers}
Expand Down
14 changes: 8 additions & 6 deletions web/src/beta/features/Editor/tabs/map/LeftPanel/Layers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as Popover from "@reearth/beta/components/Popover";
import PopoverMenuContent from "@reearth/beta/components/PopoverMenuContent";
import type { LayerNameUpdateProps } from "@reearth/beta/features/Editor/useLayers";
import type { NLSLayer } from "@reearth/services/api/layersApi/utils";
import { useT } from "@reearth/services/i18n";
import { styled } from "@reearth/services/theme";

import LayerItem from "./LayerItem";
Expand All @@ -26,6 +27,7 @@ const Layers: React.FC<LayersProps> = ({
onLayerSelect,
onDataSourceManagerOpen,
}) => {
const t = useT();
const [isAddMenuOpen, setAddMenuOpen] = useState(false);

const toggleAddMenu = useCallback(() => {
Expand All @@ -46,18 +48,18 @@ const Layers: React.FC<LayersProps> = ({
size="md"
items={[
{
name: "Add Layer from Resource",
name: t("Add Layer from Resource"),
icon: "file",
onClick: () => {
onDataSourceManagerOpen();
toggleAddMenu();
},
},
{
name: "Add Sketch Layer",
icon: "pencilSimple",
onClick: () => {},
},
// {
// name: t("Add Sketch Layer"),
// icon: "pencilSimple",
// onClick: () => {},
// },
]}
/>
</Popover.Content>
Expand Down
12 changes: 0 additions & 12 deletions web/src/beta/features/Editor/tabs/map/LeftPanel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// import Loading from "@reearth/beta/components/Loading";
import SidePanelCommon from "@reearth/beta/features/Editor/SidePanel";
import GroupSectionField from "@reearth/beta/features/Editor/tabs/map/LeftPanel/GroupField";
import type { NLSLayer } from "@reearth/services/api/layersApi/utils";
import { useT } from "@reearth/services/i18n";
// import { useTheme } from "@reearth/services/theme";

import type { LayerNameUpdateProps } from "../../../useLayers";

Expand All @@ -29,17 +27,7 @@ const MapSidePanel: React.FC<Props> = ({
onDataSourceManagerOpen,
}) => {
const t = useT();
// const theme = useTheme();

// const { useSceneQuery } = useSceneFetcher();

// const { scene } = useSceneQuery({ sceneId });

// const groups = scene?.property?.schema?.groups;

// return !groups ? (
// <Loading animationSize={80} animationColor={theme.select.main} />
// ) : (
return (
<SidePanelCommon
location="left"
Expand Down

This file was deleted.

Loading

0 comments on commit 2536415

Please sign in to comment.