Merge branch 'master' of https://github.com/naturalcrit/homebrewery into Accessible-Dropdowns

This commit is contained in:
Víctor Losada Hernández
2026-08-16 10:41:40 +02:00
2 changed files with 41 additions and 114 deletions
+18 -47
View File
@@ -1,21 +1,16 @@
import './navbar.less';
import React, { useState, useRef, useEffect } from 'react';
import createReactClass from 'create-react-class';
import _ from 'lodash';
import cx from 'classnames';
import NaturalCritIcon from '@components/svg/naturalcrit-d20.svg.jsx';
const Nav = {
base : createReactClass({
displayName : 'Nav.base',
render : function(){
return <nav>
{this.props.children}
base : ({ children, className, ...props })=>{
return <nav className={className}>
{children}
</nav>;
}
}),
logo : function(){
},
logo : ()=>{
return <a className='navLogo' href='https://www.naturalcrit.com'>
<NaturalCritIcon />
<span className='name'>
@@ -24,50 +19,26 @@ const Nav = {
</a>;
},
section : createReactClass({
displayName : 'Nav.section',
render : function(){
return <div className={`navSection ${this.props.className ?? ''}`}>
{this.props.children}
section : ({ children, className, ...props })=>{
return <div className={cx([`navSection`, className])}>
{children}
</div>;
}
}),
item : createReactClass({
displayName : 'Nav.item',
getDefaultProps : function() {
return {
icon : null,
href : null,
newTab : false,
onClick : function(){},
color : null
};
},
handleClick : function(e){
this.props.onClick(e);
},
render : function(){
const classes = cx('navItem', this.props.color, this.props.className);
let icon;
if(this.props.icon) icon = <i className={this.props.icon} />;
const props = _.omit(this.props, ['newTab']);
if(this.props.href){
return <a {...props} className={classes} target={this.props.newTab ? '_blank' : '_self'} >
{this.props.children}
{icon}
item : ({ icon, href, newTab, onClick, color, children, className, ...props })=>{
const classes = cx('navItem', color, className);
if(href){
return <a className={classes} href={href} target={newTab ? '_blank' : '_self'} {...props}>
{children}
{icon && <i className={icon}></i>}
</a>;
} else {
return <button {...props} className={classes} onClick={this.handleClick} >
{this.props.children}
{icon}
return <button {...props} className={classes} onClick={onClick} >
{children}
{icon && <i className={icon}></i>}
</button>;
}
}
}),
},
dropdown : function dropdown(props) {
props = Object.assign({}, props, {
+16 -60
View File
@@ -4417,9 +4417,6 @@
"cpu": [
"arm64"
],
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@@ -4436,9 +4433,6 @@
"cpu": [
"arm64"
],
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@@ -4455,9 +4449,6 @@
"cpu": [
"ppc64"
],
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@@ -4474,9 +4465,6 @@
"cpu": [
"s390x"
],
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@@ -4493,9 +4481,6 @@
"cpu": [
"x64"
],
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@@ -4512,9 +4497,6 @@
"cpu": [
"x64"
],
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@@ -5045,9 +5027,6 @@
"arm64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@@ -5062,9 +5041,6 @@
"arm64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@@ -5079,9 +5055,6 @@
"loong64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@@ -5096,9 +5069,6 @@
"loong64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@@ -5113,9 +5083,6 @@
"ppc64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@@ -5130,9 +5097,6 @@
"riscv64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@@ -5147,9 +5111,6 @@
"riscv64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@@ -5164,9 +5125,6 @@
"s390x"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@@ -5181,9 +5139,6 @@
"x64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@@ -5198,9 +5153,6 @@
"x64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@@ -10407,9 +10359,6 @@
"cpu": [
"arm64"
],
"libc": [
"glibc"
],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -10430,9 +10379,6 @@
"cpu": [
"arm64"
],
"libc": [
"musl"
],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -10453,9 +10399,6 @@
"cpu": [
"x64"
],
"libc": [
"glibc"
],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -10476,9 +10419,6 @@
"cpu": [
"x64"
],
"libc": [
"musl"
],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -10922,6 +10862,22 @@
"url": "https://opencollective.com/mongoose"
}
},
"node_modules/mongoose/node_modules/gcp-metadata": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-7.0.1.tgz",
"integrity": "sha512-UcO3kefx6dCcZkgcTGgVOTFb7b1LlQ02hY1omMjjrrBzkajRMCFgYOjs7J71WqnuG1k2b+9ppGL7FsOfhZMQKQ==",
"license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": {
"gaxios": "^7.0.0",
"google-logging-utils": "^1.0.0",
"json-bigint": "^1.0.0"
},
"engines": {
"node": ">=18"
}
},
"node_modules/mongoose/node_modules/mongodb": {
"version": "7.5.0",
"license": "Apache-2.0",