-
Notifications
You must be signed in to change notification settings - Fork 8
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
Conversation
Preview is ready. |
return ( | ||
<AsideHeaderContextProvider value={asideHeaderContextValue}> | ||
<AsideHeaderInnerContextProvider value={asideHeaderInnerContextValue}> | ||
<div className={b({compact}, className)}> | ||
{/* Top Panel */} | ||
<TopPanel ref={topRef} /> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
88e7cc1
to
caeb84e
Compare
@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 |
afbea1c
to
d2494b8
Compare
src/components/AsideHeader/types.tsx
Outdated
import {AsideHeaderContextType} from './AsideHeaderContext'; | ||
|
||
export interface LayoutProps { | ||
compact: boolean; | ||
className?: string; | ||
topRef?: React.RefObject<HTMLDivElement>; | ||
topAlert?: AsideHeaderTopAlertProps; | ||
updateTopSize?: () => void; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2a4c5e1
to
18b751e
Compare
@@ -80,7 +80,7 @@ body { | |||
&__settings-panel, | |||
&__search-panel { | |||
width: 300px; | |||
height: 100%; | |||
height: calc(100% - 40px); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
fixed |
@@ -2,6 +2,10 @@ | |||
|
|||
$block: '.#{variables.$ns}aside-header'; | |||
|
|||
:root { | |||
--gn-aside-top-panel-height: 0px; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
I want to implement something like this