IconGrid: massive refactor including component extraction

This patch extracts InfoPanel from IconGridItem, adds style tweaks to
match the spec, and in general reduces prop-drilling by tapping into
recoil state for most config, and making use of IconContext to style
member icons where appropriate :)
This commit is contained in:
rektdeckard
2020-07-29 12:27:50 -04:00
parent c269343014
commit 6941250d10
4 changed files with 283 additions and 94 deletions

View File

@@ -1,21 +1,28 @@
.grid {
/* grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); */
.grid-container {
padding: 0px 16px 8px;
/* background-color: #35313D;
color: white; */
}
/* display: grid; */
/* grid-template-columns: repeat(auto-fill, 160px);
.grid {
/* display: grid;
grid-area: auto;
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
grid-gap: 10px;
grid-auto-rows: minmax(160px, auto); */
grid-auto-rows: 160px;
grid-auto-columns: auto;
max-width: 1120px; */
display: flex;
flex-flow: row wrap;
justify-content: space-between;
margin: 16px;
/* min-height: 100vh; */
max-width: 1120px;
margin: auto;
}
.grid-item {
display: flex;
box-sizing: border-box;
width: 160px;
height: 160px;
flex-direction: column;
@@ -25,20 +32,82 @@
border-radius: 16px;
user-select: none;
cursor: pointer;
/* background-color: rgba(255, 255, 255, 0); */
}
.grid-item:focus {
outline: none;
box-shadow: 0 0 0 2px rgb(246, 242, 243);
}
.grid-item p {
font-size: 12px;
line-height: 16px;
color: #7F7F7F;
margin-top: 12px;
}
.info-box {
display: flex;
margin: 4px;
padding: 16px;
width: 100%;
height: 0px;
margin: 0px;
padding-right: 10%;
border-radius: 16px;
box-shadow: 0 0 0 2px rgb(0, 0, 0);
overflow: hidden;
}
.icon-preview {
height: 396px;
width: 30%;
display: flex;
text-align: center;
flex-direction: column;
align-items: center;
justify-content: center;
}
.icon-preview p {
margin: 12px 0 0;
font-size: 12px;
line-height: 16px;
}
.icon-usage {
flex: 1;
padding: 56px 0px 56px;
/* display: flex; */
/* flex-direction: column; */
/* justify-content: flex-start; */
/* vertical-align: middle; */
}
.snippet {
margin-bottom: 24px;
}
.snippet pre {
text-overflow: ellipsis;
/* overflow-x: auto; */
}
.snippet button {
background-color: transparent;
margin: 0;
padding: 0;
height: 24px;
float: right;
}
.button-row {
display: flex;
}
.button-row button {
background-color: transparent;
font-size: 16px;
line-height: 24px;
margin: 0 48px 0 0;
padding: 0;
height: 48px;
}
.empty-list {