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

task/WG-425: Fix asset panel css #321

Merged
merged 3 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion react/src/components/AssetsPanel/AssetsPanel.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@

.middleSection > div {
flex: 1;
overflow: auto;
max-height: 95%;
}
62 changes: 37 additions & 25 deletions react/src/components/AssetsPanel/AssetsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React, { useState } from 'react';
import styles from './AssetsPanel.module.css';
import FeatureFileTree from '@hazmapper/components/FeatureFileTree';
import { FeatureCollection, Project, TapisFilePath } from '@hazmapper/types';
import { Button } from '@tacc/core-components';
import { Flex, Layout, Button } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { useFeatures, useImportFeature } from '@hazmapper/hooks';
import FileBrowserModal from '../FileBrowserModal/FileBrowserModal';

Expand Down Expand Up @@ -50,7 +51,11 @@ const DownloadFeaturesButton: React.FC<DownloadFeaturesButtonProps> = ({
});

return (
<Button isLoading={isDownloading} onClick={() => triggerDownload()}>
<Button
loading={isDownloading}
onClick={() => triggerDownload()}
type="primary"
>
Export to GeoJSON
</Button>
);
Expand Down Expand Up @@ -105,30 +110,37 @@ const AssetsPanel: React.FC<Props> = ({
'png',
];

const { Content, Header, Footer } = Layout;

return (
<div className={styles.root}>
<div className={styles.topSection}>
<FileBrowserModal
isOpen={isModalOpen}
toggle={toggleModal}
onImported={handleFileImport}
allowedFileExtensions={allowedFileExtensions}
/>
<Button onClick={toggleModal} type="secondary" iconNameBefore="add">
Import from DesignSafe
</Button>
</div>
<div className={styles.middleSection}>
<FeatureFileTree
projectId={project.id}
isPublicView={isPublicView}
featureCollection={featureCollection}
/>
</div>
<div className={styles.bottomSection}>
<DownloadFeaturesButton project={project} isPublicView={isPublicView} />
</div>
</div>
<>
<Flex vertical className={styles.root} flex={1}>
<Header className={styles.topSection}>
<Button onClick={toggleModal} icon={<PlusOutlined />}>
Import from DesignSafe
</Button>
</Header>
<Content className={styles.middleSection}>
<FeatureFileTree
projectId={project.id}
isPublicView={isPublicView}
featureCollection={featureCollection}
/>
</Content>
<Footer className={styles.bottomSection}>
<DownloadFeaturesButton
project={project}
isPublicView={isPublicView}
/>
</Footer>
</Flex>
<FileBrowserModal
isOpen={isModalOpen}
toggle={toggleModal}
onImported={handleFileImport}
allowedFileExtensions={allowedFileExtensions}
/>
</>
);
};

Expand Down
2 changes: 1 addition & 1 deletion react/src/components/Panel/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Panel: React.FC<LayoutProps & { panelTitle: string }> = ({

return (
<Layout {...props}>
<Flex vertical className={styles.root}>
<Flex vertical className={styles.root} flex={1}>
<Header className={styles.header}>{panelTitle}</Header>
<Content>{children}</Content>
</Flex>
Expand Down
11 changes: 2 additions & 9 deletions react/src/pages/MapProject/MapProject.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,11 @@
height: 100vh;
}

.container {
.basePanelContainer {
height: calc(
100vh - var(--hazmapper-header-navbar-height) -
100% - var(--hazmapper-header-navbar-height) -
var(--hazmapper-control-bar-height)
);
width: 100%;
display: flex;
flex: 1;
}

.basePanelContainer {
height: 100%;
background-color: var(--global-color-primary--xx-light);
position: fixed;
left: var(--hazmapper-panel-navbar-width);
Expand Down
1 change: 0 additions & 1 deletion react/src/pages/MapProject/MapProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ const LoadedMapProject: React.FC<LoadedMapProject> = ({
<Sider width="auto">
<Flex
style={{
overflowY: 'auto',
height: '100%',
}}
>
Expand Down
Loading