Skip to content

Commit

Permalink
fix(plugins/plugin-client-common): in Popup mode, use > rather than /…
Browse files Browse the repository at this point in the history
… for prompt in bottom input

Fixes #4887
  • Loading branch information
starpit committed Jun 14, 2020
1 parent 79675c3 commit e4651d8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
41 changes: 23 additions & 18 deletions plugins/plugin-client-common/src/components/Client/InputStripe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@
import * as React from 'react'
import { Tab as KuiTab, eventBus } from '@kui-shell/core'

import KuiContext from './context'
import Block from '../Views/Terminal/Block'
import KuiConfiguration from './KuiConfiguration'
import { InputOptions } from '../Views/Terminal/Block/Input'
import BlockModel, { Active } from '../Views/Terminal/Block/BlockModel'

import '../../../web/css/static/InputStripe.scss'

type Props = InputOptions & {
tab?: KuiTab
type Props = Partial<KuiConfiguration> &
InputOptions & {
tab?: KuiTab

/** tab uuid; this is grafted in for you, by TabContent */
uuid?: string
}
/** tab uuid; this is grafted in for you, by TabContent */
uuid?: string
}

interface State {
idx: number
Expand All @@ -54,19 +57,21 @@ export default class InputStripe extends React.PureComponent<Props, State> {

public render() {
return (
<div className="kui--input-stripe repl">
<Block
idx={this.state.idx}
uuid={this.props.uuid}
tab={this.props.tab}
model={this.state.model}
noOutput
noPromptContext
promptPlaceholder={this.props.promptPlaceholder}
>
{this.props.children}
</Block>
</div>
<KuiContext.Provider value={{ prompt: this.props.prompt || '\u276f' }}>
<div className="kui--input-stripe repl">
<Block
idx={this.state.idx}
uuid={this.props.uuid}
tab={this.props.tab}
model={this.state.model}
noOutput
noPromptContext
promptPlaceholder={this.props.promptPlaceholder}
>
{this.props.children}
</Block>
</div>
</KuiContext.Provider>
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ export abstract class InputProvider<S extends State = State> extends React.PureC
return (
!this.props.noPromptContext && (
<KuiContext.Consumer>
{config => !config.noPromptContext && <span className="repl-context">{this.props.model.cwd}</span>}
{config =>
!config.noPromptContext && this.props.model && <span className="repl-context">{this.props.model.cwd}</span>
}
</KuiContext.Consumer>
)
)
Expand Down

0 comments on commit e4651d8

Please sign in to comment.