wizard avatar fix

master
Tudor Stanciu 2020-06-06 14:21:54 +03:00
parent ed71b11daf
commit 680c6724b6
1 changed files with 10 additions and 1 deletions

View File

@ -73,12 +73,21 @@ const Wizard = ({ dismissBot }) => {
setTimeout(dismissBot, 3000); setTimeout(dismissBot, 3000);
}; };
const getAvatar = () => {
const basePath = "public/icons/wizard.png";
if (process.env.PUBLIC_URL) {
return `${process.env.PUBLIC_URL}/${basePath}`;
} else {
return basePath;
}
};
return ( return (
<ThemeProvider theme={botTheme}> <ThemeProvider theme={botTheme}>
<ChatBot <ChatBot
handleEnd={handleEnd} handleEnd={handleEnd}
steps={steps} steps={steps}
botAvatar="public/icons/wizard.png" botAvatar={getAvatar()}
headerTitle="Zirhan" headerTitle="Zirhan"
/> />
</ThemeProvider> </ThemeProvider>