Skip to content

Commit

Permalink
eliminate state variable themeName
Browse files Browse the repository at this point in the history
Co-authored-by: Vicente Canales <1157901+vcanales@users.noreply.github.com>
  • Loading branch information
pbking and vcanales authored May 28, 2024
1 parent 1649256 commit a43e9f8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/landing-page/landing-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit a43e9f8

Please sign in to comment.