Skip to content

Commit

Permalink
add different types of typewriter
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed Jun 27, 2023
1 parent ca2c2a9 commit 5df4236
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 11 additions & 1 deletion libs/remix-ui/terminal/src/lib/reducers/terminalReducer.ts
Original file line number Diff line number Diff line change
@@ -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: [
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions libs/remix-ui/terminal/src/lib/types/terminalTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 5df4236

Please sign in to comment.