refactor(getIcon.jsx): if model is GPT-4, change background color to black.

This commit is contained in:
Daniel Avila 2023-04-02 15:23:28 -04:00
parent 24a82c8018
commit 871bc4c78b

View file

@ -6,7 +6,7 @@ import BingIcon from '../components/svg/BingIcon';
const getIcon = props => { const getIcon = props => {
// { size = 30, isCreatedByUser, model, chatGptLabel, error, ...props } // { size = 30, isCreatedByUser, model, chatGptLabel, error, ...props }
const { size = 30, isCreatedByUser, button } = props; const { size = 30, isCreatedByUser, button, model } = props;
if (isCreatedByUser) if (isCreatedByUser)
return ( return (
@ -38,9 +38,9 @@ const getIcon = props => {
const { chatGptLabel } = props; const { chatGptLabel } = props;
icon = <GPTIcon size={size * 0.7} />; icon = <GPTIcon size={size * 0.7} />;
bg = chatGptLabel bg = model && model.toLowerCase() === 'gpt-4' ? 'black' : (chatGptLabel
? `rgba(16, 163, 127, ${button ? 0.75 : 1})` ? `rgba(16, 163, 127, ${button ? 0.75 : 1})`
: `rgba(16, 163, 127, ${button ? 0.75 : 1})`; : `rgba(16, 163, 127, ${button ? 0.75 : 1})`);
name = chatGptLabel || 'ChatGPT'; name = chatGptLabel || 'ChatGPT';
} else if (endpoint === 'bingAI') { } else if (endpoint === 'bingAI') {
const { jailbreak } = props; const { jailbreak } = props;
@ -50,7 +50,7 @@ const getIcon = props => {
name = jailbreak ? 'Sydney' : 'BingAI'; name = jailbreak ? 'Sydney' : 'BingAI';
} else if (endpoint === 'chatGPTBrowser') { } else if (endpoint === 'chatGPTBrowser') {
icon = <GPTIcon size={size * 0.7} />; icon = <GPTIcon size={size * 0.7} />;
bg = `rgba(0, 163, 255, ${button ? 0.75 : 1})`; bg = model && model.toLowerCase() === 'gpt-4' ? 'black' : `rgba(0, 163, 255, ${button ? 0.75 : 1})`;
name = 'ChatGPT'; name = 'ChatGPT';
} else if (endpoint === null) { } else if (endpoint === null) {
icon = <GPTIcon size={size * 0.7} />; icon = <GPTIcon size={size * 0.7} />;