Skip to content

Commit

Permalink
feat(cerebro): added custiomization option for placeholder text on se…
Browse files Browse the repository at this point in the history
…arch bar

Now in Cerebro Config there's a new text field to customize the placeholder text on the searchbar.
By default it's always "Cerebro search"

fix #672
  • Loading branch information
aalonsolopez committed Dec 17, 2024
1 parent bcabb5b commit 735c01b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const schema = {
isMigratedPlugins: { type: 'boolean', default: false },
openAtLogin: { type: 'boolean', default: true },
winPosition: { type: 'array', default: [] },
searchBarPlaceholder: { type: 'string', default: 'Cerebro Search' },
}

const store = new Store({
Expand Down
2 changes: 1 addition & 1 deletion app/main/components/Cerebro/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ function Cerebro({
<Autocomplete autocompleteCalculator={autocompleteValue} />
<div className={styles.inputWrapper}>
<input
placeholder="Cerebro Search"
placeholder={config.get('searchBarPlaceholder')}
type="text"
id="main-input"
ref={mainInput}
Expand Down
9 changes: 8 additions & 1 deletion app/plugins/core/settings/Settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ function Settings({ get, set }) {
cleanOnHide: get('cleanOnHide'),
selectOnShow: get('selectOnShow'),
pluginsSettings: get('plugins'),
openAtLogin: get('openAtLogin')
openAtLogin: get('openAtLogin'),
searchBarPlaceholder: get('searchBarPlaceholder')
}))

const changeConfig = (key, value) => {
Expand Down Expand Up @@ -57,6 +58,12 @@ function Settings({ get, set }) {
value={state.proxy}
onChange={(value) => changeConfig('proxy', value)}
/>
<Text
type="text"
label="Search bar placeholder"
value={state.searchBarPlaceholder}
onChange={(value) => changeConfig('searchBarPlaceholder', value)}
/>
<Checkbox
label="Open at login"
value={state.openAtLogin}
Expand Down

0 comments on commit 735c01b

Please sign in to comment.