diff --git a/apps/remix-ide/src/app/plugins/openaigpt.tsx b/apps/remix-ide/src/app/plugins/openaigpt.tsx index e3450558ce5..118c2c7e7aa 100644 --- a/apps/remix-ide/src/app/plugins/openaigpt.tsx +++ b/apps/remix-ide/src/app/plugins/openaigpt.tsx @@ -31,7 +31,7 @@ export class OpenAIGpt extends Plugin { })).json() console.log(result) - this.call('terminal', 'log', { type: 'typewriterlog', value: result.choices[0].message.content }) + this.call('terminal', 'log', { type: 'typewritersuccess', value: result.choices[0].message.content }) return result.data } } \ No newline at end of file diff --git a/libs/remix-ui/terminal/src/lib/reducers/terminalReducer.ts b/libs/remix-ui/terminal/src/lib/reducers/terminalReducer.ts index 73d2bf116db..388fb478ee7 100644 --- a/libs/remix-ui/terminal/src/lib/reducers/terminalReducer.ts +++ b/libs/remix-ui/terminal/src/lib/reducers/terminalReducer.ts @@ -1,4 +1,4 @@ -import { CLEAR_CONSOLE, CMD_HISTORY, EMPTY_BLOCK, ERROR, HTML, INFO, KNOWN_TRANSACTION, LISTEN_ON_NETWORK, LOG, TYPEWRITERLOG, NEW_TRANSACTION, SCRIPT, UNKNOWN_TRANSACTION, WARN } from '../types/terminalTypes' +import { CLEAR_CONSOLE, CMD_HISTORY, EMPTY_BLOCK, ERROR, HTML, INFO, KNOWN_TRANSACTION, LISTEN_ON_NETWORK, LOG, TYPEWRITERLOG, TYPEWRITERWARNING, TYPEWRITERSUCCESS, NEW_TRANSACTION, SCRIPT, UNKNOWN_TRANSACTION, WARN } from '../types/terminalTypes' export const initialState = { journalBlocks: [ @@ -156,6 +156,16 @@ export const registerScriptRunnerReducer = (state, action) => { ...state, journalBlocks: initialState.journalBlocks.push({ message: action.payload.message, typewriter: true, style: 'text-log', provider: action.payload.provider }) } + case TYPEWRITERWARNING: + return { + ...state, + journalBlocks: initialState.journalBlocks.push({ message: action.payload.message, typewriter: true, style: 'text-warning', provider: action.payload.provider }) + } + case TYPEWRITERSUCCESS: + return { + ...state, + journalBlocks: initialState.journalBlocks.push({ message: action.payload.message, typewriter: true, style: 'text-success', provider: action.payload.provider }) + } case INFO: return { ...state, diff --git a/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts b/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts index bb180744793..d9537fcfd44 100644 --- a/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts +++ b/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts @@ -16,6 +16,8 @@ export const NEW_CALL = 'newCall' export const HTML = 'html' export const LOG = 'log' export const TYPEWRITERLOG = 'typewriterlog' +export const TYPEWRITERWARNING = 'typewriterwarning' +export const TYPEWRITERSUCCESS = 'typewritersuccess' export const INFO = 'info' export const WARN = 'warn' export const ERROR = 'error'