mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-16 14:28:43 +00:00
pass in page title, fit in mobile
This commit is contained in:
@@ -81,8 +81,8 @@ const Homebrew = (props)=>{
|
|||||||
<Route path='/user/:username' element={<WithRoute el={UserPage} brews={brews} />} />
|
<Route path='/user/:username' element={<WithRoute el={UserPage} brews={brews} />} />
|
||||||
<Route path='/vault' element={<WithRoute el={VaultPage}/>}/>
|
<Route path='/vault' element={<WithRoute el={VaultPage}/>}/>
|
||||||
<Route path='/changelog' element={<WithRoute el={SharePage} brew={brew} pageName={'changelog'} title={'Changelog: version ' + version} disableMeta={true} />} />
|
<Route path='/changelog' element={<WithRoute el={SharePage} brew={brew} pageName={'changelog'} title={'Changelog: version ' + version} disableMeta={true} />} />
|
||||||
<Route path='/faq' element={<WithRoute el={SharePage} brew={brew} disableMeta={true} />} />
|
<Route path='/faq' element={<WithRoute el={SharePage} brew={brew} pageName={'faq'} title={'Frequent Asked Questions'} disableMeta={true} />} />
|
||||||
<Route path='/migrate' element={<WithRoute el={SharePage} brew={brew} disableMeta={true} />} />
|
<Route path='/migrate' element={<WithRoute el={SharePage} brew={brew} pageName={'migrate'} title={'Converting Documents'} disableMeta={true} />} />
|
||||||
<Route path='/account' element={<WithRoute el={AccountPage} brew={brew} accountDetails={brew.accountDetails} />} />
|
<Route path='/account' element={<WithRoute el={AccountPage} brew={brew} accountDetails={brew.accountDetails} />} />
|
||||||
<Route path='/legacy' element={<WithRoute el={HomePage} brew={brew} />} />
|
<Route path='/legacy' element={<WithRoute el={HomePage} brew={brew} />} />
|
||||||
<Route path='/error' element={<WithRoute el={ErrorPage} brew={brew} />} />
|
<Route path='/error' element={<WithRoute el={ErrorPage} brew={brew} />} />
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ const Nav = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
header: ({span, className, children, ...props})=>{
|
header: ({span, className, children, ...props})=>{
|
||||||
return <li className={cx([`navItem header`, className])} no-dismiss='true'>
|
return <span className={cx([`navItem header`, className])} no-dismiss='true'>
|
||||||
{children}
|
{children}
|
||||||
</li>;
|
</span>;
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ const Navbar = ({ children, brew, pageName, editor, title, currentPage, props })
|
|||||||
const mod = isMac ? '⌘' : 'Ctrl';
|
const mod = isMac ? '⌘' : 'Ctrl';
|
||||||
const isBrew = !!brew && (brew.shareId || pageName === 'homePage' || pageName === 'newPage');
|
const isBrew = !!brew && (brew.shareId || pageName === 'homePage' || pageName === 'newPage');
|
||||||
const account = global.account;
|
const account = global.account;
|
||||||
const generalPage = pageName === 'vaultPage' || pageName === 'changelog' || pageName === 'faq' || pageName === 'migrate';
|
|
||||||
|
|
||||||
const navSlots = React.Children.toArray(children).reduce((slots, child) => {
|
const navSlots = React.Children.toArray(children).reduce((slots, child) => {
|
||||||
if (!React.isValidElement(child)) return slots;
|
if (!React.isValidElement(child)) return slots;
|
||||||
@@ -162,7 +161,7 @@ const Navbar = ({ children, brew, pageName, editor, title, currentPage, props })
|
|||||||
</Dropdown>
|
</Dropdown>
|
||||||
{navSlots.menu}
|
{navSlots.menu}
|
||||||
</ul>
|
</ul>
|
||||||
{generalPage && <Nav.item className='brewTitle'>{title}</Nav.item>}
|
{pageName !== 'sharePage' && <Nav.header className='brewTitle'>{title}</Nav.header>}
|
||||||
<MetadataNavItem brew={brew} pageName={pageName}></MetadataNavItem>
|
<MetadataNavItem brew={brew} pageName={pageName}></MetadataNavItem>
|
||||||
<ul>
|
<ul>
|
||||||
<Dropdown groupName={account.username} customTrigger={<>{account.username}</>} icon={null} key={account.username}>
|
<Dropdown groupName={account.username} customTrigger={<>{account.username}</>} icon={null} key={account.username}>
|
||||||
|
|||||||
@@ -31,17 +31,19 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
&.brewTitle {
|
&.brewTitle {
|
||||||
display: block;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
max-width: none;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 800;
|
|
||||||
color: white;
|
color: white;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-transform: initial;
|
text-transform: initial;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
background-color: transparent;
|
letter-spacing: 1px;
|
||||||
|
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&.metadata {
|
&.metadata {
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -184,6 +186,10 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
|
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
@@ -204,7 +210,7 @@
|
|||||||
&:has(ul):not(:has(ul :is(button, a):not(:disabled))) {
|
&:has(ul):not(:has(ul :is(button, a):not(:disabled))) {
|
||||||
color: grey; //faux disabled if all buttons are disabled
|
color: grey; //faux disabled if all buttons are disabled
|
||||||
}
|
}
|
||||||
&:hover {
|
&:not(.header):hover {
|
||||||
background: #484848;
|
background: #484848;
|
||||||
}
|
}
|
||||||
&:has(> i, > kbd, > img) {
|
&:has(> i, > kbd, > img) {
|
||||||
@@ -221,6 +227,9 @@
|
|||||||
padding: 2px 5px;
|
padding: 2px 5px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
&.header {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
&.recent ul {
|
&.recent ul {
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -230,6 +239,19 @@
|
|||||||
gap: 5px;
|
gap: 5px;
|
||||||
height: 2.7em;
|
height: 2.7em;
|
||||||
isolation: isolate;
|
isolation: isolate;
|
||||||
|
|
||||||
|
&.header {
|
||||||
|
display: block;
|
||||||
|
padding: 5px 0;
|
||||||
|
color: #bbbbbb;
|
||||||
|
border-top: 1px solid #888888;
|
||||||
|
&:nth-of-type(1) {
|
||||||
|
background-color: darken(@teal, 20%);
|
||||||
|
}
|
||||||
|
&:nth-of-type(2) {
|
||||||
|
background-color: darken(@purple, 30%);
|
||||||
|
}
|
||||||
|
}
|
||||||
.clear {
|
.clear {
|
||||||
width: 55px;
|
width: 55px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -253,21 +275,6 @@
|
|||||||
color: #888888;
|
color: #888888;
|
||||||
z-index: -1;
|
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%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -39,6 +39,7 @@ const EditorPage = (props)=>{
|
|||||||
save,
|
save,
|
||||||
onSaveSuccess,
|
onSaveSuccess,
|
||||||
pageName,
|
pageName,
|
||||||
|
pageTitle,
|
||||||
showEditorButtons,
|
showEditorButtons,
|
||||||
userThemes = {}
|
userThemes = {}
|
||||||
} = props;
|
} = props;
|
||||||
@@ -375,7 +376,7 @@ const EditorPage = (props)=>{
|
|||||||
<div className= {`${pageName} sitePage`}>
|
<div className= {`${pageName} sitePage`}>
|
||||||
<Meta name='google-site-verification' content='NwnAQSSJZzAT7N-p5MY6ydQ7Njm67dtbu73ZSyE5Fy4' />
|
<Meta name='google-site-verification' content='NwnAQSSJZzAT7N-p5MY6ydQ7Njm67dtbu73ZSyE5Fy4' />
|
||||||
{(pageName == 'editPage') && <Meta name='robots' content='noindex, nofollow' />}
|
{(pageName == 'editPage') && <Meta name='robots' content='noindex, nofollow' />}
|
||||||
<Navbar brew={currentBrew} editor={editorRef.current} pageName={pageName} account={global.account} currentPage={currentBrewRendererPageNum}>
|
<Navbar brew={currentBrew} editor={editorRef.current} pageName={pageName} title={pageTitle} account={global.account} currentPage={currentBrewRendererPageNum}>
|
||||||
<Navbar.File>
|
<Navbar.File>
|
||||||
<Nav.item
|
<Nav.item
|
||||||
className='save'
|
className='save'
|
||||||
@@ -8,7 +8,7 @@ const UIPage = createReactClass({
|
|||||||
|
|
||||||
render : function(){
|
render : function(){
|
||||||
return <div className='uiPage sitePage'>
|
return <div className='uiPage sitePage'>
|
||||||
<Navbar pageName={this.props.pageName} />
|
<Navbar pageName={this.props.pageName} title={this.props.title} />
|
||||||
<div className='content'>
|
<div className='content'>
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import request from '../../utils/request-middleware.js';
|
import request from '../../utils/request-middleware.js';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import EditorPage from '../basePages/editPage/editorPage.jsx';
|
import EditorPage from '../basePages/editorPage/editorPage.jsx';
|
||||||
import { DEFAULT_BREW_LOAD } from '../../../../server/brewDefaults.js';
|
import { DEFAULT_BREW_LOAD } from '../../../../server/brewDefaults.js';
|
||||||
|
|
||||||
// Page specific imports
|
// Page specific imports
|
||||||
@@ -49,6 +49,7 @@ const EditPage = (props)=>{
|
|||||||
showFloatingButtons = {false}
|
showFloatingButtons = {false}
|
||||||
showEditorButtons = {true}
|
showEditorButtons = {true}
|
||||||
pageName = {'editPage'}
|
pageName = {'editPage'}
|
||||||
|
pageTitle = {props.brew.title}
|
||||||
brew = {props.brew}
|
brew = {props.brew}
|
||||||
userThemes = {props.userThemes}
|
userThemes = {props.userThemes}
|
||||||
save = {save}
|
save = {save}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const ErrorPage = ({ brew })=>{
|
|||||||
const errorText = ErrorIndex({ brew })[brew.HBErrorCode.toString()] || '';
|
const errorText = ErrorIndex({ brew })[brew.HBErrorCode.toString()] || '';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<UIPage brew={{ title: 'Crit Fail!' }} pageName='errorPage'>
|
<UIPage brew={{ title: 'Crit Fail!' }} pageName='errorPage' title={`Error ${brew?.status || '000'}`}>
|
||||||
<div className='dataGroup'>
|
<div className='dataGroup'>
|
||||||
<div className='errorTitle'>
|
<div className='errorTitle'>
|
||||||
<h1>{`Error ${brew?.status || '000'}`}</h1>
|
<h1>{`Error ${brew?.status || '000'}`}</h1>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import './homePage.less';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import request from '../../utils/request-middleware.js';
|
import request from '../../utils/request-middleware.js';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import EditorPage from '../basePages/editPage/editorPage.jsx';
|
import EditorPage from '../basePages/editorPage/editorPage.jsx';
|
||||||
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
|
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
|
||||||
|
|
||||||
const HomePage =(props)=>{
|
const HomePage =(props)=>{
|
||||||
@@ -32,6 +32,7 @@ const HomePage =(props)=>{
|
|||||||
showFloatingButtons = {true}
|
showFloatingButtons = {true}
|
||||||
showEditorButtons = {false}
|
showEditorButtons = {false}
|
||||||
pageName = {'homePage'}
|
pageName = {'homePage'}
|
||||||
|
pageTitle = {'The Homebrewery'}
|
||||||
brew = {props.brew}
|
brew = {props.brew}
|
||||||
userThemes = {{}}
|
userThemes = {{}}
|
||||||
save = {save}
|
save = {save}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import request from '../../utils/request-middleware.js';
|
import request from '../../utils/request-middleware.js';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import EditorPage from '../basePages/editPage/editorPage.jsx';
|
import EditorPage from '../basePages/editorPage/editorPage.jsx';
|
||||||
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
|
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
|
||||||
|
|
||||||
const NewPage = (props)=>{
|
const NewPage = (props)=>{
|
||||||
@@ -30,6 +30,7 @@ const NewPage = (props)=>{
|
|||||||
showFloatingButtons = {false}
|
showFloatingButtons = {false}
|
||||||
showEditorButtons = {true}
|
showEditorButtons = {true}
|
||||||
pageName = {'newPage'}
|
pageName = {'newPage'}
|
||||||
|
pageTitle = {'Sandbox'}
|
||||||
brew = {props.brew}
|
brew = {props.brew}
|
||||||
userThemes = {props.userThemes}
|
userThemes = {props.userThemes}
|
||||||
save = {save}
|
save = {save}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const UserPage = (props)=>{
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ListPage pageName={pageName} brewCollection={brewCollection} query={props.query} reportError={(err)=>setError(err)} />
|
<ListPage pageName={'userPage'} brewCollection={brewCollection} query={props.query} reportError={(err)=>setError(err)} />
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user