From a43e9f852a0dadb0ce4cc6ad09748c027fcac4a8 Mon Sep 17 00:00:00 2001 From: Jason Crist Date: Tue, 28 May 2024 07:44:28 -0400 Subject: [PATCH] eliminate state variable themeName Co-authored-by: Vicente Canales <1157901+vcanales@users.noreply.github.com> --- src/landing-page/landing-page.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/landing-page/landing-page.js b/src/landing-page/landing-page.js index e3ad3a1c..8b6aeaac 100644 --- a/src/landing-page/landing-page.js +++ b/src/landing-page/landing-page.js @@ -26,17 +26,11 @@ import { downloadFile } from '../utils'; import { CreateThemeModal } from './create-modal'; export default function LandingPage() { - const [ themeName, setThemeName ] = useState( '' ); const [ createModalType, setCreateModalType ] = useState( false ); - const currentTheme = useSelect( ( select ) => + const themeName = useSelect( ( select ) => select( coreStore ).getCurrentTheme() - ); - - useEffect( () => { - const name = currentTheme?.name?.raw || ''; - setThemeName( name ); - }, [ currentTheme ] ); + )?.name?.raw; const handleExportClick = async () => { const response = await downloadExportedTheme();