Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(web): add dataSource, layerSidePanel component in beta #633

Merged
merged 31 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
956d530
chore(web): add dataSource, layerSidePanel component in beta
pyshx Aug 21, 2023
d115363
merge main
pyshx Sep 3, 2023
170ef99
Merge branch 'main' into chore/layers-panel-wip
pyshx Sep 3, 2023
d89314a
update Modal
pyshx Sep 3, 2023
23f0847
chore(sever): refactor around NLS layers
pyshx Sep 3, 2023
9e901bb
Merge branch 'chore/server-refactor-nls' into chore/layers-panel-wip
pyshx Sep 3, 2023
9811d5c
add basic support for layers in beta
pyshx Sep 4, 2023
4e5abdd
reverted server changes
pyshx Sep 4, 2023
3819731
remove redundant files
pyshx Sep 4, 2023
ebc5451
Merge branch 'main' into chore/layers-panel-wip
pyshx Sep 4, 2023
6d9abe5
refactor
pyshx Sep 4, 2023
4108258
translation
pyshx Sep 4, 2023
89c3700
refactor
pyshx Sep 4, 2023
b6f9d6e
fix visiblity for layers
pyshx Sep 5, 2023
405600c
refactor layerAPI and fix visiblity
pyshx Sep 5, 2023
cbe3577
remove from value option from data source manager
pyshx Sep 5, 2023
0f11c1b
Merge branch 'main' into chore/layers-panel-wip
pyshx Sep 5, 2023
75dbab8
fix type error
pyshx Sep 5, 2023
289e918
Merge branch 'chore/layers-panel-wip' of github.com:reearth/reearth i…
pyshx Sep 5, 2023
22b7b71
update addLayer.svg
pyshx Sep 5, 2023
eecee0e
remove inline style from data source manager
pyshx Sep 5, 2023
08225b4
refactor structure of datasource components
pyshx Sep 5, 2023
20b5630
resolve comments and refactors
pyshx Sep 5, 2023
c92f084
fix selected layer
pyshx Sep 5, 2023
02d48b6
refactor leftpanel layer
pyshx Sep 5, 2023
c570fb1
use local state with setter instead of global state
pyshx Sep 5, 2023
efe0b97
fix type ci
pyshx Sep 5, 2023
06a98ce
remove pollInterval and use refetchQueries
pyshx Sep 6, 2023
055da68
refactors
pyshx Sep 6, 2023
db394b7
Merge branch 'main' into chore/layers-panel-wip
pyshx Sep 6, 2023
0ded4ff
use betas toggle instead of togglebutton
pyshx Sep 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const config: CodegenConfig = {
URL: "string",
Lang: "string",
TranslatedString: "{ [lang in string]?: string } | null",
JSON: "any",
KaWaite marked this conversation as resolved.
Show resolved Hide resolved
},
},
},
Expand Down
12 changes: 12 additions & 0 deletions web/src/beta/components/Icon/Icons/addLayer.svg
KaWaite marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions web/src/beta/components/Icon/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import Bin from "./Icons/bin.svg";
import Install from "./Icons/install.svg";
import UploadSimple from "./Icons/uploadSimple.svg";
import Search from "./Icons/search.svg";
import AddLayerIcon from "./Icons/addLayer.svg";

// MSIC
import CheckCircle from "./Icons/checkCircle.svg";
Expand Down Expand Up @@ -107,6 +108,7 @@ import PublicGitHubRepo from "./Icons/publicGitHubRepo.svg";
import Marketplace from "./Icons/marketplace.svg";

export default {
addLayer: AddLayerIcon,
file: File,
dl: InfoTable,
infobox: Infobox,
Expand Down
21 changes: 14 additions & 7 deletions web/src/beta/components/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type Props = {
children?: ReactNode;
isVisible?: boolean;
onClose?: () => void;
onTabChange?: (tabId: string) => void;
sidebarTabs?: SidebarTab[];
};

Expand All @@ -35,6 +36,7 @@ const Modal: React.FC<Props> = ({
children,
isVisible,
onClose,
onTabChange,
sidebarTabs,
}) => {
const [TabsFields, setTabsFields] = useState<SwitchField<SidebarTab>[]>([]);
Expand All @@ -56,8 +58,9 @@ const Modal: React.FC<Props> = ({
const handleTabChange = useCallback(
(tabId: string) => {
handleActivate(tabId);
onTabChange?.(tabId);
},
[handleActivate],
[handleActivate, onTabChange],
);

return (
Expand All @@ -79,11 +82,13 @@ const Modal: React.FC<Props> = ({
)}
<ContentWrapper>
{tabs.length > 0 && <Content>{tabs.find(tab => tab.active === true)?.content}</Content>}
<Content> {children}</Content>
<ButtonWrapper>
{tabs.find(tab => tab.active === true)?.tabButton1 ?? button1}
{tabs.find(tab => tab.active === true)?.tabButton2 ?? button2}
</ButtonWrapper>
{children && <Content> {children}</Content>}
KaWaite marked this conversation as resolved.
Show resolved Hide resolved
{button1 || button2 ? (
<ButtonWrapper>
{tabs.find(tab => tab.active === true)?.tabButton1 ?? button1}
{tabs.find(tab => tab.active === true)?.tabButton2 ?? button2}
</ButtonWrapper>
) : null}
</ContentWrapper>
</InnerWrapper>
</Wrapper>
Expand All @@ -99,6 +104,7 @@ const NavBarWrapper = styled.div`
flex-direction: column;
padding: 16px;
gap: 10px;
background: ${({ theme }) => theme.bg[0]};
border-right: 1px solid ${({ theme }) => theme.bg[3]};
`;

Expand All @@ -107,13 +113,14 @@ const Tab = styled.button<{ isSelected?: boolean }>`
padding: 4px 8px;
border-radius: 4px;
background: ${({ isSelected, theme }) => (isSelected ? theme.bg[2] : "transparent")};
color: ${({ isSelected, theme }) => (isSelected ? theme.content.main : theme.bg[2])};
color: ${({ isSelected, theme }) => (isSelected ? theme.content.main : theme.content.weak)};
`;

const ContentWrapper = styled.div`
display: flex;
flex-direction: column;
flex: 1;
background: ${({ theme }) => theme.bg[0]};
`;

const Content = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion web/src/beta/components/SidePanelSectionField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const SidePanelSectionField: React.FC<{
};

const Field = styled.div`
background: ${({ theme }) => theme.bg[1]};
background: ${({ theme }) => theme.bg[0]};
KaWaite marked this conversation as resolved.
Show resolved Hide resolved
border-radius: 4px;
`;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Meta, StoryObj } from "@storybook/react";

import DataSourceManager from ".";

const meta: Meta<typeof DataSourceManager> = { component: DataSourceManager };
export default meta;
type Story = StoryObj<typeof DataSourceManager>;
export const Default: Story = { args: {} };
Loading
Loading