Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alex/tree styling #24

Merged
merged 5 commits into from Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion nexus/dist/sidebar.js

Large diffs are not rendered by default.

151 changes: 135 additions & 16 deletions nexus/media/styles.css
Expand Up @@ -5,26 +5,145 @@
}

.tree-container {
position: relative;
background-color: #333;
border: 2px solid #ddd;
padding: 7px;
border-radius: 1px;
/* z-index: -2; */
}

.comp-with-children-container {
display: block;
position: relative;
left: 20px;
margin-top: 10px;
}

.comp-with-children-name,
.top-level-component,
.leaf-comp-name {
font-weight: normal;
margin-left: 10px;
margin-right: 8px;
padding: 4px 8px;
/* border: 2px solid purple;
border-radius: 10px; */
}

.comp-with-children-container::before {
content: '';
position: absolute;
transform: rotate(90deg);
height: 1px;
width: 30px;
background-color: #b08ac5;
left: -8px;
top: -9px;
z-index: 0;
}

.comp-with-children-name::before {
content: '';
position: absolute;
height: 1px;
width: 11px;
background-color: #b08ac5;
left: 16px;
top: 12px;
z-index: 0;
}

.comp-with-children-container::before:hover {
color: #7e74fa;
}

.comp-with-children-name::before:hover {
color: #7e74fa;
}

.leaf-comp-container::before {
content: '';
position: absolute;
transform: rotate(90deg);
height: 1px;
width: 39px;
background-color: #b08ac5;
left: -33px;
top: -6px;
z-index: 0;
}

.leaf-comp-name::before {
content: '';
position: absolute;
height: 1px;
width: 23px;
background-color: #b08ac5;
left: -13px;
top: 15px;
z-index: 0;
}

/* .comp-with-children-container::after {
content: '';
position: absolute;
height: 2px;
width: 10px;
background-color: purple;
left: 30px;
top: 15px;
} */

/* .info_icon::before {
content: '';
position: absolute;
height: 2px;
width: 10px;
background-color: purple;
left: 80px;
top: 12px;
z-index: 1;
} */

/* .info_icon-inner::before {
content: '';
position: absolute;
height: 2px;
width: 10px;
background-color: orange;
left: 0px;
top: 12px;
z-index: 1;
} */

/* .comp-with-children-name::before {
content: 'branch';
transform: rotate(90deg);
height: 3px;
width: 10px;
background-color: purple;
left: 5px;
} */

.leaf-comp-container {
display: block;
position: relative;
left: 40px;
margin-top: 10px;
margin-right: 5px;
}

.nav-leaf-comp-container {
margin-left: 8px;
/* margin-left: 2px; */
}

.node-icon {
position: relative;
bottom: -10px;
margin-right: 25px;
color: #b08ac5;
z-index: 2;
}

.add-file-container {
Expand Down Expand Up @@ -67,38 +186,36 @@
font-size: 14px;
}

.node_icon {
margin-right: 5px;
}

.info_icon {
color: #191637;
margin-left: 8px;
}
color: #b08ac5;
z-index: 2;

/* margin-left: 8px; */
}

#tips{
#tips {
background-color: #7e74fa;
padding: 10px;
border-radius: 5px;
}

.leaf-Node h3, .leaf-Node a {
.leaf-Node h3,
.leaf-Node a {
display: inline;
}



.data-key{
.data-key {
color: rgb(155, 18, 155);
font-family: monospace;
}

.node_icon:hover,
.comp-with-children-name:hover,
.fav_icon:hover,
.info_icon:hover {
.info_icon:hover,
.top-level-component:hover {
cursor: pointer;
z-index: 2;
}

.container-intro {
Expand All @@ -117,9 +234,11 @@

.fav_icon:hover {
color: #7e74fa;
z-index: 2;
}

.fav_icon {
margin: 3px;
color: #191637;
/* margin: 3px; */
color: #b08ac5;
z-index: 2;
}
4 changes: 3 additions & 1 deletion nexus/out/NexusProvider.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion nexus/out/extension.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 37 additions & 9 deletions nexus/src/webview/Leaf.jsx
Expand Up @@ -22,15 +22,43 @@ class Leaf extends Component {
<>
<div className="leaf-comp-container">
<h1 className="leaf-comp-name">{this.props.node.name}</h1>
{!propsArray.length ?
<Tippy placement='bottom' content={<div id='tips'><div><p className='data-key'>data-fetching:</p> {this.props.node.dataFetching}</div> </div>} class='box'>
<a class='fav_icon'><FontAwesomeIcon icon={faCircleInfo}/></a>
</Tippy>
:
<Tippy placement='bottom' content={<div id='tips'><div><p className='data-key'>props:</p><p>{propsArray}</p></div> <div><p className='data-key'> data-fetching:</p> {this.props.node.dataFetching}</div> </div>} class='box'>
<a class='fav_icon'><FontAwesomeIcon icon={faCircleInfo}/></a>
</Tippy>
}
{!propsArray.length ? (
<Tippy
placement="bottom"
content={
<div id="tips">
<div>
<p className="data-key">data-fetching:</p> {this.props.node.dataFetching}
</div>{' '}
</div>
}
class="box"
>
<a class="fav_icon info_icon">
<FontAwesomeIcon className="info_icon-inner" icon={faCircleInfo} />
</a>
</Tippy>
) : (
<Tippy
placement="bottom"
content={
<div id="tips">
<div>
<p className="data-key">props:</p>
<p>{propsArray}</p>
</div>{' '}
<div>
<p className="data-key"> data-fetching:</p> {this.props.node.dataFetching}
</div>{' '}
</div>
}
class="box"
>
<a class="fav_icon info_icon">
<FontAwesomeIcon className="info_icon-inner" icon={faCircleInfo} />
</a>
</Tippy>
)}
</div>
</>
);
Expand Down
54 changes: 41 additions & 13 deletions nexus/src/webview/NodeWithChildren.jsx
Expand Up @@ -8,7 +8,6 @@ import { faCirclePlus, faCircleInfo, faCircleMinus } from '@fortawesome/free-sol
import Tippy from '@tippyjs/react';

class NodeWithChildren extends Component {

constructor(props) {
super(props);
this.state = {
Expand Down Expand Up @@ -80,31 +79,60 @@ class NodeWithChildren extends Component {
<div className="comp-with-children-container">
{this.state.expanded ? (
<a className="node_icon" onClick={this.handleClick}>
<FontAwesomeIcon icon={faCircleMinus} className="fav_icon" />
<FontAwesomeIcon className="fav_icon" icon={faCircleMinus} />
</a>
) : (
<a className="node_icon" onClick={this.handleClick}>
<FontAwesomeIcon icon={faCirclePlus} className="fav_icon" />
<FontAwesomeIcon className="fav_icon" icon={faCirclePlus} />
</a>
)}
<h1 class="comp-with-children-name" onClick={this.handleClick}>
{this.props.node.name}
</h1>
{!propsArray.length ?
<Tippy placement='bottom' content={<div id='tips'> <div><p className='data-key'>data-fetching: </p>{this.props.node.dataFetching}</div> </div>} class='box'>
<a class='fav_icon'><FontAwesomeIcon icon={faCircleInfo}/></a>
</Tippy>
:
<Tippy placement='bottom' content={<div id='tips'><div><p className='data-key'>props:</p>{propsArray}</div> <div><p className='data-key'>data-fetching:</p> {this.props.node.dataFetching}</div> </div>} class='box'>
<a class='fav_icon'><FontAwesomeIcon icon={faCircleInfo}/></a>
</Tippy>
}
{!propsArray.length ? (
<Tippy
placement="bottom"
content={
<div id="tips">
{' '}
<div>
<p className="data-key">data-fetching: </p>
{this.props.node.dataFetching}
</div>{' '}
</div>
}
class="box"
>
<a class="fav_icon info_icon">
<FontAwesomeIcon className="info_icon-inner" icon={faCircleInfo} />
</a>
</Tippy>
) : (
<Tippy
placement="bottom"
content={
<div id="tips">
<div>
<p className="data-key">props:</p>
{propsArray}
</div>{' '}
<div>
<p className="data-key">data-fetching:</p> {this.props.node.dataFetching}
</div>{' '}
</div>
}
class="box"
>
<a class="fav_icon info_icon">
<FontAwesomeIcon className="info_icon-inner" icon={faCircleInfo} />
</a>
</Tippy>
)}

{childrenComp}
</div>
);
}

}

export default NodeWithChildren;
2 changes: 1 addition & 1 deletion nexus/src/webview/SidebarContainer.jsx
Expand Up @@ -106,7 +106,7 @@ class SidebarContainer extends Component {
<FontAwesomeIcon icon={faCirclePlus} className="fav_icon" />
</a>
)}
<h1 className="comp-with-children-name" onClick={this.handleClick}>
<h1 className="top-level-component" onClick={this.handleClick}>
{this.state.node.name}
</h1>
</div>
Expand Down