How to change elements of interface only for viewer version of page (by changing source code)?

I’m trying to modifying source code of Grafana, to remove this button only for viewer version of page(https://i.stack.imgur.com/ZrZQE.png). Thats just example. I’m trying to understand how to change elements of interface only for viewer version of page. I’m running Grafana with WSL Ubuntu version 22.04.

I found code responding for this button, it located in /grafana/public/app/core/components/AppChrome/NavToolbar/NavToolbar.tsx.

<div className={styles.menuButton}>
        <IconButton
          name="bars"
          tooltip={t('navigation.toolbar.toggle-menu', 'Toggle menu')}
          tooltipPlacement="bottom"
          size="xl"
          onClick={onToggleMegaMenu}
        />
      </div>

Editing this code effects all pages not only for user.

I’m new in FrontEnd and Grafana, can someone, please, explain me how to change elements of interface only for viewer.

Why do you want to remove it?

Its example. I want to understand how to customize only viewer version of page