Skip to content

Commit a3cfba4

Browse files
committed
media panel hiding bug fixed. scroll area fixed
1 parent 74ab21c commit a3cfba4

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
.remixui_home_rightPanel {
3737
right: 0;
3838
position: absolute;
39-
z-index: 3;
39+
z-index: 3000;
4040
}
4141
.remixui_home_remixHomeMedia {
4242
overflow-y: auto;

libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
8080

8181
const remiAudioEl = useRef(null)
8282
const inputValue = useRef(null)
83+
const rightPanel = useRef(null)
8384

8485
useEffect(() => {
8586
plugin.call('theme', 'currentTheme').then((theme) => {
@@ -97,7 +98,7 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
9798
window.addEventListener('click', (event) => {
9899
const target = event.target as Element
99100
const id = target.id
100-
if (id !== 'remixIDEHomeTwitterbtn' && id !== 'remixIDEHomeMediumbtn') {
101+
if (id !== 'remixIDEHomeTwitterbtn' && id !== 'remixIDEHomeMediumbtn' && !rightPanel.current.contains(event.target)) {
101102
// todo check event.target
102103
setState(prevState => { return { ...prevState, showMediaPanel: 'none' } })
103104
}
@@ -125,7 +126,6 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
125126
}
126127

127128
const createNewFile = async () => {
128-
plugin.verticalIcons.select('filePanel')
129129
await plugin.call('filePanel', 'createNewFile')
130130
}
131131

@@ -262,22 +262,21 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
262262
<h4>File</h4>
263263
<p className="mb-1">
264264
<i className="mr-2 far fa-file"></i>
265-
<label className="ml-1 mb-1 remixui_home_text" onClick={() => createNewFile()}>New File</label>
265+
<span className="ml-1 mb-1 remixui_home_text" onClick={() => createNewFile()}>New File</span>
266266
</p>
267267
<p className="mb-1">
268268
<i className="mr-2 far fa-file-alt"></i>
269-
<label className="ml-1 remixui_home_labelIt remixui_home_bigLabelSize} remixui_home_text" htmlFor="openFileInput">
269+
<span className="ml-1 remixui_home_labelIt remixui_home_bigLabelSize remixui_home_text">
270270
Open Files
271-
</label>
272-
<input title="open file" type="file" id="openFileInput" onChange={(event) => {
273-
event.stopPropagation()
274-
plugin.verticalIcons.select('filePanel')
275-
uploadFile(event.target)
276-
}} multiple />
271+
<input title="open file" type="file" onChange={(event) => {
272+
event.stopPropagation()
273+
uploadFile(event.target)
274+
}} multiple />
275+
</span>
277276
</p>
278277
<p className="mb-1">
279278
<i className="mr-1 far fa-hdd"></i>
280-
<label className="ml-1 remixui_home_text" onClick={() => connectToLocalhost()}>Connect to Localhost</label>
279+
<span className="ml-1 remixui_home_text" onClick={() => connectToLocalhost()}>Connect to Localhost</span>
281280
</p>
282281
<p className="mt-3 mb-0"><label>LOAD FROM:</label></p>
283282
<div className="btn-group">
@@ -303,7 +302,7 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
303302
</p>
304303
<p className="mb-1">
305304
<i className="mr-2 fab fa-ethereum remixui_home_image"></i>
306-
<label className="remixui_home_text" onClick={() => switchToPreviousVersion()}>Old experience</label>
305+
<span className="remixui_home_text" onClick={() => switchToPreviousVersion()}>Old experience</span>
307306
</p>
308307
</div>
309308
</div>
@@ -334,9 +333,14 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
334333
}}
335334
></button>
336335
</div>
337-
<div className="mr-3 d-flex bg-light remixui_home_panels" style={ { visibility: state.showMediaPanel === 'none' ? 'hidden' : 'visible' } } id="remixIDEMediaPanels">
336+
<div
337+
className="mr-3 d-flex bg-light remixui_home_panels"
338+
style={ { visibility: state.showMediaPanel === 'none' ? 'hidden' : 'visible' } }
339+
id="remixIDEMediaPanels"
340+
ref={rightPanel}
341+
>
338342
<div id="remixIDE_MediumBlock" className="p-2 mx-1 mt-3 mb-0 remixui_home_remixHomeMedia" style={ { maxHeight: maxHeight } }>
339-
<div id="medium-widget" className="px-3 remixui_home_media" hidden={state.showMediaPanel !== 'medium'} style={ { maxHeight: elHeight } }>
343+
<div id="medium-widget" className="px-3 remixui_home_media" hidden={state.showMediaPanel !== 'medium'} style={ { maxHeight: '10000px' } }>
340344
<div
341345
id="retainable-rss-embed"
342346
data-rss="https://medium.com/feed/remix-ide"
@@ -353,7 +357,7 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
353357
<div id="remixIDE_TwitterBlock" className="p-2 mx-1 mt-3 mb-0 remixui_home_remixHomeMedia" hidden={state.showMediaPanel !== 'twitter'} style={ { maxHeight: maxHeight, marginRight: '28px' } } >
354358
<div className="remixui_home_media" style={ { minHeight: elHeight } } >
355359
<a className="twitter-timeline"
356-
data-width="330"
360+
data-width="375"
357361
data-theme={ state.themeQuality.name }
358362
data-chrome="nofooter noheader transparent"
359363
data-tweet-limit="18"

0 commit comments

Comments
 (0)