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

feat: aside header top alert #118

Merged
merged 15 commits into from
Nov 23, 2023
Merged

feat: aside header top alert #118

merged 15 commits into from
Nov 23, 2023

Conversation

goshander
Copy link
Member

@goshander goshander commented Sep 29, 2023

I want to implement something like this
image

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@goshander goshander changed the title feat: aside header top block feat: aside header top alert Oct 2, 2023
return (
<AsideHeaderContextProvider value={asideHeaderContextValue}>
<AsideHeaderInnerContextProvider value={asideHeaderInnerContextValue}>
<div className={b({compact}, className)}>
{/* Top Panel */}
<TopPanel ref={topRef} />
Copy link
Collaborator

@DarkGenius DarkGenius Oct 2, 2023

Choose a reason for hiding this comment

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

Can we not render the component if topAlert is not set?

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@goshander goshander force-pushed the feat-aside-header-top-block branch from 88e7cc1 to caeb84e Compare October 17, 2023 13:34
@goshander goshander requested a review from DarkGenius October 31, 2023 12:33
@goshander
Copy link
Member Author

@DarkGenius i think need waiting this PR #140, right?

@DarkGenius
Copy link
Collaborator

@DarkGenius i think need waiting this PR #140, right?

Yes, it’s possible that after this PR is merged, changes will be required in your PR

@goshander goshander force-pushed the feat-aside-header-top-block branch from afbea1c to d2494b8 Compare November 8, 2023 12:30
import {AsideHeaderContextType} from './AsideHeaderContext';

export interface LayoutProps {
compact: boolean;
className?: string;
topRef?: React.RefObject<HTMLDivElement>;
topAlert?: AsideHeaderTopAlertProps;
updateTopSize?: () => void;
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's better to rename it to onCloseTopAlert. Because arbitrary code can be passed to this property.

@goshander goshander requested a review from DarkGenius November 16, 2023 10:16
Copy link
Collaborator

@DarkGenius DarkGenius left a comment

Choose a reason for hiding this comment

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

The top panel overlaps.
telegram-cloud-photo-size-2-5395780814719012458-y

@goshander goshander force-pushed the feat-aside-header-top-block branch from 2a4c5e1 to 18b751e Compare November 22, 2023 11:54
@@ -80,7 +80,7 @@ body {
&__settings-panel,
&__search-panel {
width: 300px;
height: 100%;
height: calc(100% - 40px);
Copy link
Member Author

Choose a reason for hiding this comment

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

fix drawer padding at 20px for remove unexpected scroll

}
return () => {
window.removeEventListener('resize', updateTopSizeDebounce);
setAsideTopPanelHeight(0);
Copy link
Member Author

Choose a reason for hiding this comment

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

set top panel size to zero for correct destroy component behaviour with iframe switching at storybook

@goshander
Copy link
Member Author

goshander commented Nov 22, 2023

The top panel overlaps.

fixed

@@ -2,6 +2,10 @@

$block: '.#{variables.$ns}aside-header';

:root {
--gn-aside-top-panel-height: 0px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is it not in the .g-root?

Copy link
Member Author

Choose a reason for hiding this comment

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

Then we can not change this value from document object

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can use the correct selector

Copy link
Member Author

Choose a reason for hiding this comment

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

We can use the correct selector

Ok, changed to getElementsByClassName selector

@@ -1,4 +1,4 @@
import React, {FC, useState} from 'react';
import React, {FC} from 'react';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe then we’ll remove FC import too?

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@goshander goshander merged commit efc4839 into main Nov 23, 2023
3 checks passed
@goshander goshander deleted the feat-aside-header-top-block branch November 23, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants