diff --git a/src/WinXP/Windows/index.js b/src/WinXP/Windows/index.js index facc1eafa..ff459c741 100644 --- a/src/WinXP/Windows/index.js +++ b/src/WinXP/Windows/index.js @@ -66,6 +66,8 @@ const Window = memo(function({ } const dragRef = useRef(null); const ref = useRef(null); + const innerWindowRef = useRef(null); + const { width: windowWidth, height: windowHeight } = useWindowSize(); const { offset, size } = useElementResize(ref, { dragRef, @@ -92,6 +94,7 @@ const Window = memo(function({ x = offset.x; y = offset.y; } + return (
-
+
{component({ onClose: _onMouseUpClose, onMinimize: _onMouseUpMinimize, diff --git a/src/WinXP/apps/InternetExplorer/index.js b/src/WinXP/apps/InternetExplorer/index.js index 995503bb5..fb9ff50e2 100644 --- a/src/WinXP/apps/InternetExplorer/index.js +++ b/src/WinXP/apps/InternetExplorer/index.js @@ -2,6 +2,7 @@ import React, { useState } from 'react'; import styled from 'styled-components'; import { WindowDropDowns, Google } from 'components'; + import dropDownData from './dropDownData'; import ie from 'assets/windowsIcons/ie-paper.png'; import printer from 'assets/windowsIcons/17(32x32).png'; @@ -27,6 +28,7 @@ function InternetExplorer({ onClose }) { route: 'main', query: '', }); + function onSearch(str) { if (str.length) { setState({ diff --git a/src/WinXP/apps/Notepad/index.js b/src/WinXP/apps/Notepad/index.js index 5c05977e6..15d9f41ad 100644 --- a/src/WinXP/apps/Notepad/index.js +++ b/src/WinXP/apps/Notepad/index.js @@ -1,3 +1,4 @@ +/* eslint-disable react-hooks/exhaustive-deps */ import React, { useState, useRef, useContext, useEffect } from 'react'; import Frame from 'react-frame-component'; @@ -5,6 +6,8 @@ import styled from 'styled-components'; import { WindowDropDowns } from 'components'; import { getDropDownData } from './dropDownData'; +import { getNotepadIframeStyle } from './utils'; +import { applyScrollbarClass } from 'scrollbar'; import { Context as AppContext } from '../../index'; import { ADD_APP } from '../../constants/actions'; @@ -41,6 +44,16 @@ export default function Notepad({ onClose, isFocus }) { textareaRef.current && textareaRef.current.focus(); }, [isFocus]); + useEffect(() => { + applyScrollbarClass( + frameRef.current?.contentDocument.querySelector('.frame-content'), + ); + }, [ + textareaRef.current?.value?.length, + frameRef.current?.clientWidth, + frameRef.current?.clientHeight, + ]); + function selectText(start, end) { caretStart.current = start; caretEnd.current = end; @@ -242,46 +255,13 @@ export default function Notepad({ onClose, isFocus }) { }); } - const frameInitialContent = ` - - - - -
`; - return (
- - + +