mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-18 09:48:44 +00:00
fix recents
This commit is contained in:
@@ -90,5 +90,4 @@ const Nav = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export default Nav;
|
export default Nav;
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ const Navbar = ({ account, brew, title, props }) => {
|
|||||||
</Dropdown>
|
</Dropdown>
|
||||||
<Dropdown groupName={'Edit'} customTrigger={<>Edit</>} icon={null} key={'edit'}>
|
<Dropdown groupName={'Edit'} customTrigger={<>Edit</>} icon={null} key={'edit'}>
|
||||||
<div className='nav-section'>
|
<div className='nav-section'>
|
||||||
<Nav.item kbd={mod + ' + z'}>Undo</Nav.item>
|
<Nav.item kbd={mod + ' + z'} disabled>Undo</Nav.item>
|
||||||
<Nav.item kbd={mod + ' + Shift + z'}>Redo</Nav.item>
|
<Nav.item kbd={mod + ' + Shift + z'}>Redo</Nav.item>
|
||||||
<Nav.item kbd={mod + ' + x'}>cut</Nav.item>
|
<Nav.item kbd={mod + ' + x'}>cut</Nav.item>
|
||||||
<Nav.item kbd={mod + ' + c'}>copy</Nav.item>
|
<Nav.item kbd={mod + ' + c'}>copy</Nav.item>
|
||||||
@@ -90,7 +90,7 @@ const Navbar = ({ account, brew, title, props }) => {
|
|||||||
account
|
account
|
||||||
</Nav.item>
|
</Nav.item>
|
||||||
</div>
|
</div>
|
||||||
<Dropdown className='navItem' groupName={'Recent Brews'} customTrigger={<>Recent Brews</>} icon={null} key={'recent'}>
|
<Dropdown className='navItem recent' groupName={'Recent Brews'} customTrigger={<>Recent Brews</>} icon={null} key={'recent'}>
|
||||||
<RecentNavItem />
|
<RecentNavItem />
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|||||||
@@ -47,8 +47,8 @@
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
&:has(button, a) {
|
&:has(> button, > a) {
|
||||||
padding:0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.brewTitle {
|
&.brewTitle {
|
||||||
@@ -189,85 +189,6 @@
|
|||||||
text-transform: none;
|
text-transform: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.recent {
|
|
||||||
position: relative;
|
|
||||||
.navDropdown .navItem {
|
|
||||||
#backgroundColorsHover;
|
|
||||||
.animate(background-color);
|
|
||||||
position: relative;
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: block;
|
|
||||||
max-width: 15em;
|
|
||||||
max-height: ~'calc(100vh - 28px)';
|
|
||||||
padding: 8px 5px 13px;
|
|
||||||
overflow: hidden auto;
|
|
||||||
color: white;
|
|
||||||
text-decoration: none;
|
|
||||||
scrollbar-color: #666666 #333333;
|
|
||||||
scrollbar-width: thin;
|
|
||||||
background-color: #333333;
|
|
||||||
border-top: 1px solid #888888;
|
|
||||||
.clear {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
right: 0;
|
|
||||||
display: none;
|
|
||||||
width: 20px;
|
|
||||||
height: 100%;
|
|
||||||
background-color: #333333;
|
|
||||||
border-radius: 3px;
|
|
||||||
opacity: 70%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
&:hover {
|
|
||||||
opacity: 100%;
|
|
||||||
}
|
|
||||||
i {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
margin: 0;
|
|
||||||
font-size: 10px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:hover {
|
|
||||||
background-color: @blue;
|
|
||||||
.clear {
|
|
||||||
display: grid;
|
|
||||||
place-content: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.title {
|
|
||||||
display: inline-block;
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden auto;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.time {
|
|
||||||
position: absolute;
|
|
||||||
right: 2px;
|
|
||||||
bottom: 2px;
|
|
||||||
font-size: 0.7em;
|
|
||||||
color: #888888;
|
|
||||||
}
|
|
||||||
&.header {
|
|
||||||
box-sizing: border-box;
|
|
||||||
display: block;
|
|
||||||
padding: 5px 0;
|
|
||||||
color: #bbbbbb;
|
|
||||||
text-align: center;
|
|
||||||
background-color: #333333;
|
|
||||||
border-top: 1px solid #888888;
|
|
||||||
&:nth-of-type(1) {
|
|
||||||
background-color: darken(@teal, 20%);
|
|
||||||
}
|
|
||||||
&:nth-of-type(2) {
|
|
||||||
background-color: darken(@purple, 30%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,10 +209,11 @@
|
|||||||
.homebrew nav {
|
.homebrew nav {
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
background: #333;
|
background: #333;
|
||||||
height: 30px;
|
min-height: 29px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family:Alata;
|
font-family: Alata, open sans;
|
||||||
button, a {
|
button,
|
||||||
|
a {
|
||||||
&:disabled {
|
&:disabled {
|
||||||
color: #777;
|
color: #777;
|
||||||
}
|
}
|
||||||
@@ -305,28 +227,78 @@
|
|||||||
color: inherit;
|
color: inherit;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
.navItem, .menu-wrapper {
|
.navItem,
|
||||||
|
.menu-wrapper {
|
||||||
&:hover {
|
&:hover {
|
||||||
background:#555;
|
background: #555;
|
||||||
}
|
}
|
||||||
&:has(> i, > kbd) {
|
&:has(> i, > kbd) {
|
||||||
display:flex;
|
display: flex;
|
||||||
gap:5px;
|
gap: 5px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
kbd {
|
kbd {
|
||||||
font-size:.8em;
|
font-size: 0.8em;
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
color:#aaa;
|
color: #aaa;
|
||||||
background:#222;
|
background: #222;
|
||||||
padding:2px 5px;
|
padding: 2px 5px;
|
||||||
border-radius:5px;
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.recent ul {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.navItem {
|
||||||
|
position: relative;
|
||||||
|
gap: 5px;
|
||||||
|
height: 2.7em;
|
||||||
|
isolation: isolate;
|
||||||
|
.clear {
|
||||||
|
width: 55px;
|
||||||
|
padding: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color @defaultDuration;
|
||||||
|
&:hover {
|
||||||
|
background: @red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
width: 200px;
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
.ellipsis();
|
||||||
|
}
|
||||||
|
.time {
|
||||||
|
position: absolute;
|
||||||
|
left: 5px;
|
||||||
|
bottom: 2px;
|
||||||
|
font-size: 0.8em;
|
||||||
|
color: #888888;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
&.header {
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: block;
|
||||||
|
padding: 5px 0;
|
||||||
|
color: #bbbbbb;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #333333;
|
||||||
|
border-top: 1px solid #888888;
|
||||||
|
&:nth-of-type(1) {
|
||||||
|
background-color: darken(@teal, 20%);
|
||||||
|
}
|
||||||
|
&:nth-of-type(2) {
|
||||||
|
background-color: darken(@purple, 30%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.navItem {
|
.navItem {
|
||||||
height:2em;
|
height: 2em;
|
||||||
|
|
||||||
&.header {
|
&.header {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -340,7 +312,7 @@
|
|||||||
|
|
||||||
> .menu-wrapper {
|
> .menu-wrapper {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
text-wrap:nowrap;
|
text-wrap: nowrap;
|
||||||
|
|
||||||
&:first-child :is(button, a) {
|
&:first-child :is(button, a) {
|
||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
@@ -349,20 +321,21 @@
|
|||||||
padding-right: 15px;
|
padding-right: 15px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
> ul ul {
|
ul {
|
||||||
background: #333;
|
background: #333;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
|
||||||
.nav-section:not(:last-child) {
|
.nav-section:not(:last-child, + .header) {
|
||||||
border-bottom: 1px solid;
|
border-bottom: 1px solid;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
margin-block: 2px;
|
margin-block: 2px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,9 +148,9 @@ const RecentItems = createReactClass({
|
|||||||
return <a className='navItem' href={brew.url} key={`${brew.id}-${i}`} target='_blank' rel='noopener noreferrer' title={brew.title || '[ no title ]'}>
|
return <a className='navItem' href={brew.url} key={`${brew.id}-${i}`} target='_blank' rel='noopener noreferrer' title={brew.title || '[ no title ]'}>
|
||||||
<span className='title'>{brew.title || '[ no title ]'}</span>
|
<span className='title'>{brew.title || '[ no title ]'}</span>
|
||||||
<span className='time'>{Moment(brew.ts).fromNow()}</span>
|
<span className='time'>{Moment(brew.ts).fromNow()}</span>
|
||||||
<div className='clear' title='Remove from Recents' onClick={(e)=>{this.removeItem(`${brew.url}`, e);}}><i className='fas fa-times'></i></div>
|
<button className='clear' title='Remove from Recents' onClick={(e)=>{this.removeItem(`${brew.url}`, e);}}><i className='fas fa-times'></i></button>
|
||||||
</a>
|
</a>
|
||||||
})};
|
})}
|
||||||
</div>
|
</div>
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -167,9 +167,7 @@ const RecentItems = createReactClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render : function(){
|
render : function(){
|
||||||
return <div className='recent'>
|
return this.renderDropdown()
|
||||||
{this.renderDropdown()}
|
|
||||||
</div>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user