mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-09 07:12:40 +00:00
Merge branch 'master' into new/home/edit/_unsavedChanges_common
This commit is contained in:
@@ -295,12 +295,6 @@ const BrewRenderer = (props)=>{
|
|||||||
rowGap : `${displayOptions.rowGap}px`
|
rowGap : `${displayOptions.rowGap}px`
|
||||||
};
|
};
|
||||||
|
|
||||||
const styleObject = {};
|
|
||||||
|
|
||||||
if(global.config.deployment) {
|
|
||||||
styleObject.backgroundImage = `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='40px' width='200px'><text x='0' y='15' fill='%23fff7' font-size='20'>${global.config.deployment}</text></svg>")`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const renderedStyle = useMemo(()=>renderStyle(), [props.style, props.themeBundle]);
|
const renderedStyle = useMemo(()=>renderStyle(), [props.style, props.themeBundle]);
|
||||||
renderedPages = useMemo(()=>renderPages(), [props.text, displayOptions]);
|
renderedPages = useMemo(()=>renderPages(), [props.text, displayOptions]);
|
||||||
|
|
||||||
@@ -329,10 +323,9 @@ const BrewRenderer = (props)=>{
|
|||||||
contentDidMount={frameDidMount}
|
contentDidMount={frameDidMount}
|
||||||
onClick={()=>{emitClick();}}
|
onClick={()=>{emitClick();}}
|
||||||
>
|
>
|
||||||
<div className={`brewRenderer ${global.config.deployment && 'deployment'}`}
|
<div className='brewRenderer'
|
||||||
onKeyDown={handleControlKeys}
|
onKeyDown={handleControlKeys}
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
style={ styleObject }
|
|
||||||
>
|
>
|
||||||
|
|
||||||
{/* Apply CSS from Style tab and render pages from Markdown tab */}
|
{/* Apply CSS from Style tab and render pages from Markdown tab */}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
overflow-y : scroll;
|
overflow-y : scroll;
|
||||||
will-change : transform;
|
will-change : transform;
|
||||||
&:has(.facing, .flow) { padding : 60px 30px; }
|
&:has(.facing, .flow) { padding : 60px 30px; }
|
||||||
&.deployment { background-color : darkred; }
|
|
||||||
:where(.pages) {
|
:where(.pages) {
|
||||||
&.facing {
|
&.facing {
|
||||||
display : grid;
|
display : grid;
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ const WithRoute = ({ el: Element, ...rest })=>{
|
|||||||
const params = useParams();
|
const params = useParams();
|
||||||
const [searchParams] = useSearchParams();
|
const [searchParams] = useSearchParams();
|
||||||
const queryParams = Object.fromEntries(searchParams?.entries() || []);
|
const queryParams = Object.fromEntries(searchParams?.entries() || []);
|
||||||
|
|
||||||
return <Element {...rest} {...params} query={queryParams} />;
|
return <Element {...rest} {...params} query={queryParams} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -50,11 +49,20 @@ const Homebrew = (props)=>{
|
|||||||
global.enable_themes = enable_themes;
|
global.enable_themes = enable_themes;
|
||||||
global.config = config;
|
global.config = config;
|
||||||
|
|
||||||
|
const backgroundObject = ()=>{
|
||||||
|
if(global.config.deployment || (config.local && config.development)){
|
||||||
|
const bgText = global.config.deployment || 'Local';
|
||||||
|
return {
|
||||||
|
backgroundImage : `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='100px' width='200px'><text x='0' y='15' fill='%23fff7' font-size='20'>${bgText}</text></svg>")`
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
updateLocalStorage();
|
updateLocalStorage();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Router location={url}>
|
<Router location={url}>
|
||||||
<div className='homebrew'>
|
<div className={`homebrew${(config.deployment || config.local) ? ' deployment' : ''}`} style={backgroundObject()}>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path='/edit/:id' element={<WithRoute el={EditPage} brew={brew} userThemes={userThemes}/>} />
|
<Route path='/edit/:id' element={<WithRoute el={EditPage} brew={brew} userThemes={userThemes}/>} />
|
||||||
<Route path='/share/:id' element={<WithRoute el={SharePage} brew={brew} />} />
|
<Route path='/share/:id' element={<WithRoute el={SharePage} brew={brew} />} />
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
@import 'naturalcrit/styles/core.less';
|
@import 'naturalcrit/styles/core.less';
|
||||||
.homebrew {
|
.homebrew {
|
||||||
height : 100%;
|
height : 100%;
|
||||||
|
background-color:@steel;
|
||||||
|
&.deployment { background-color : darkred; }
|
||||||
|
|
||||||
.sitePage {
|
.sitePage {
|
||||||
display : flex;
|
display : flex;
|
||||||
flex-direction : column;
|
flex-direction : column;
|
||||||
height : 100%;
|
height : 100%;
|
||||||
overflow-y : hidden;
|
overflow-y : hidden;
|
||||||
background-color : @steel;
|
|
||||||
.content {
|
.content {
|
||||||
position : relative;
|
position : relative;
|
||||||
flex : auto;
|
flex : auto;
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
.vaultPage {
|
.vaultPage {
|
||||||
height : 100%;
|
height : 100%;
|
||||||
overflow-y : hidden;
|
overflow-y : hidden;
|
||||||
background-color : #2C3E50;
|
|
||||||
|
|
||||||
*:not(input) { user-select : none; }
|
*:not(input) { user-select : none; }
|
||||||
|
|
||||||
|
.form {
|
||||||
|
background:white;
|
||||||
|
}
|
||||||
|
|
||||||
:where(.content .dataGroup) {
|
:where(.content .dataGroup) {
|
||||||
width : 100%;
|
width : 100%;
|
||||||
height : 100%;
|
height : 100%;
|
||||||
background : white;
|
|
||||||
|
|
||||||
&.form .brewLookup {
|
&.form .brewLookup {
|
||||||
position : relative;
|
position : relative;
|
||||||
@@ -171,7 +173,6 @@
|
|||||||
max-height : 100%;
|
max-height : 100%;
|
||||||
padding : 70px 50px;
|
padding : 70px 50px;
|
||||||
overflow-y : scroll;
|
overflow-y : scroll;
|
||||||
background-color : #2C3E50;
|
|
||||||
container-type : inline-size;
|
container-type : inline-size;
|
||||||
|
|
||||||
h3 { font-size : 25px; }
|
h3 { font-size : 25px; }
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"development": true,
|
||||||
"host" : "homebrewery.local.naturalcrit.com:8000",
|
"host" : "homebrewery.local.naturalcrit.com:8000",
|
||||||
"naturalcrit_url" : "local.naturalcrit.com:8010",
|
"naturalcrit_url" : "local.naturalcrit.com:8010",
|
||||||
"secret" : "secret",
|
"secret" : "secret",
|
||||||
|
|||||||
Reference in New Issue
Block a user