Created
December 31, 2023 07:24
-
-
Save adevinwild/324915ea165d8e866f6f3f52f614a3de to your computer and use it in GitHub Desktop.
A simple dev indicator for React using TailwindCSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isDev = process.env.NODE_ENV === "development"; | |
const DevIndicator = () => { | |
if (!isDev) { | |
return null; | |
} | |
return ( | |
<> | |
<div className="w-full h-full fixed ring-4 opacity-80 ring-orange-300 ring-inset z-[9999]"></div> | |
<div className="fixed bottom-4 opacity-80 left-4 py-1 px-2 bg-orange-300 ring-1 ring-orange-400 text-orange-600 rounded z-[9999]"> | |
<span className="font-mono text-sm font-bold">DEV MODE</span> | |
</div> | |
</> | |
); | |
}; | |
export default DevIndicator; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment