Skip to content
Closed
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
6 changes: 6 additions & 0 deletions src/assets/images/LogoIMS.svg

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update title in index.html as well

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/components/Accordion/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export const HeaderWrapper = styled.div`
display: flex;
justify-content: space-between;

margin-right: 28px;

height: 36px;
`;

Expand Down
11 changes: 4 additions & 7 deletions src/components/Layout/Layout.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

display: grid;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smth wrong with styles. Logo should be in same level as en/ru languages

grid-template-columns: minmax(0px, 463px) 1fr;
grid-template-rows: 80px 1fr;
grid-template-rows: 72px 1fr;

min-height: 100%;

Expand All @@ -16,15 +16,13 @@
display: flex;
align-items: center;
justify-content: end;

padding: 17px 24px;
}

.sideBar {
grid-area: 1/1/3/2;
grid-row: span 2;

width: 100%;
padding: 26px 0px 0px 30px;
padding: 16px 24px;

background: #{$beige};
}
Expand All @@ -33,7 +31,6 @@
height: 80px;
width: 100%;

padding: 20px 0 0 24px;
margin-bottom: 25px;
}

Expand All @@ -49,6 +46,6 @@

@media (max-width: 1365px) {
.root {
grid-template-columns: minmax(0px, 25%) 1fr;
grid-template-columns: minmax(260px, 25%) 1fr;
}
}
6 changes: 3 additions & 3 deletions src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export interface IProps {
export const Layout: FC<IProps> = ({ children }) => {
return (
<div className={styles.root}>
<header className={styles.header}>
<Language />
</header>
<SidePanelWrapper>
<SidePanel className={styles.sideBar} />
</SidePanelWrapper>
<header className={styles.header}>
<Language />
</header>
<main className={styles.main}>
<ScgPage />
{children}
Expand Down
28 changes: 7 additions & 21 deletions src/components/SidePanel/SidePanel.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,7 @@
@import '~@assets/styles/variables/colors.scss';

.logo {
max-height: 28px;
height: 100%;
max-width: 302px;
width: 100%;

margin-bottom: 62px;

cursor: pointer;

@media (max-width: 1919px) {
padding-right: 24px;
}
margin-bottom: 19.5px;
}

.search {
Expand Down Expand Up @@ -46,15 +35,13 @@
}

.searchFieldWrap {
margin-right: 24px;
margin-top: 36px;
}

.searchField {
margin-bottom: 24px;
margin-left: -6px;

width: 100%;
min-height: 40px;
margin-bottom: 36px;

border: 1px solid $white;

Expand All @@ -71,19 +58,14 @@
display: flex;
flex-direction: column;
gap: 4px;

margin-bottom: 51px;
}

.accordionContent {
display: flex;
flex-direction: column;
gap: 46px;

height: calc(100vh - $logoSearchHeight);

margin-bottom: 24px;

@include scrollable;

overflow-x: hidden;
Expand All @@ -97,6 +79,10 @@
}
}

.decompositionAndHistoryPanels {
margin-top: 36px;
}

.plusWrapper {
position: fixed;
left: 403px;
Expand Down
29 changes: 4 additions & 25 deletions src/components/SidePanel/SidePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { useDispatch } from 'react-redux';
import { useNavigate } from 'react-router';
import { getHistory } from '@api/requests/userHistory';
import Clock from '@assets/images/Clock.svg';
import LogoIMS from '@assets/images/LogoIMS.svg';
import Plus from '@assets/images/plus.svg';
import Sections from '@assets/images/Sections.svg';
import { Accordion } from '@components/Accordion';
import ErrorBoundary from '@components/ErrorBoundary/ErrorBoundary';
import { HistoryPanel } from '@components/HistoryPanel';
import { SearchField } from '@components/SearchField';
import { useSelector } from '@hooks';
import { selectUser, setFormat } from '@store/commonSlice';
import { selectRequests, setRequests } from '@store/requestHistorySlice';
import styles from './SidePanel.module.scss';

Expand All @@ -21,11 +21,6 @@ interface IProps {
}

export const SidePanel: FC<IProps> = ({ className }) => {
const navigate = useNavigate();
const dispatch = useDispatch();

const user = useSelector(selectUser);

const { onAddClick } = useDecompositionContext();

const translate = useTranslate();
Expand All @@ -34,35 +29,19 @@ export const SidePanel: FC<IProps> = ({ className }) => {

const requests = useSelector(selectRequests);

useEffect(() => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave as it was for now

if (!user) return;
setIsLoading(true);
(async () => {
const history = await getHistory(user.sc_addr);

if (!history) return;
dispatch(setRequests(history));
setIsLoading(false);
})();
}, [dispatch, user]);

return (
<div className={className}>
<div className={styles.sideBarContent}>
<div className={styles.searchFieldWrap}>
<LogoIMS className={styles.logo} />

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to add logic for logo click like it was added here

<SearchField className={styles.searchField} />
</div>
<div
className={classNames(styles.accordionContent, {
[styles.accordionContent_userCanEdit]: !!user?.can_edit,
[styles.accordionContent_admin]: !!user?.is_admin,
})}
>
<div className={styles.accordionContent_admin}>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to leave logic as it was without possibility to change sections

<div>
<Accordion
header={translate({ ru: 'Разделы', en: 'Sections' })}
leftIcon={<Sections />}
rightIcon={!!user?.is_admin || !!user?.can_edit ? <Plus /> : null}
rightIcon={<Plus />}
onRightClick={onAddClick}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave as it was

expanded
>
Expand Down