Hello-World-Software-Studios / calculator

Carpenter's tool for wall layout
0 stars 1 forks source link

Import `NO_NAME_TO_DISPLAY` from a single file #45

Closed ecumene closed 3 years ago

JPM709 commented 3 years ago

It now lives in a file called reusableCode.js, where it can be imported into any component that needs to check for a name to render.

const NO_NAME_TO_DISPLAY = "No Project Selected";

const checkForNameToDisplay = (displayName) => displayName == null
    ? NO_NAME_TO_DISPLAY
    : displayName;

export default checkForNameToDisplay;