Skip to content

Commit

Permalink
Add indentation ability to prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackymancs4 committed Mar 25, 2020
1 parent 80c5bc5 commit 063a164
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ElectronClient/gui/MainScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class MainScreenComponent extends React.Component {
const folderItems = this.props.folders;
const startFolders = folderItems
.map(a => {
return { key: a.id, value: a.id, label: a.title };
return { key: a.id, value: a.id, label: a.title, indentDepth: a.parent_id == '' ? 0 : 1 };
});

this.setState({
Expand Down
4 changes: 3 additions & 1 deletion ElectronClient/gui/PromptDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class PromptDialog extends React.Component {
this.styles_ = {};

const paddingTop = 20;
const indentDepthWidth = 50;

this.styles_.modalLayer = {
zIndex: 9999,
Expand Down Expand Up @@ -117,10 +118,11 @@ class PromptDialog extends React.Component {
fontFamily: theme.fontFamily,
backgroundColor: theme.backgroundColor,
}),
option: provided =>
option: (provided, state) =>
Object.assign(provided, {
color: theme.color,
fontFamily: theme.fontFamily,
paddingLeft: `${8 + (state.data.indentDepth || 0) * indentDepthWidth}px`,
}),
multiValueLabel: provided =>
Object.assign(provided, {
Expand Down

0 comments on commit 063a164

Please sign in to comment.