mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-03-22 08:58:11 +00:00
join vitreum files
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
import React, { useEffect } from "react";
|
||||
import injectTag from "./injectTag.js";
|
||||
|
||||
//old vitreum file, still imported in some pages
|
||||
|
||||
const injectTag = (tag, props, children) => {
|
||||
const injectNode = document.createElement(tag);
|
||||
Object.entries(props).forEach(([key, val]) => injectNode[key] = val);
|
||||
if (children) injectNode.appendChild(document.createTextNode(children));
|
||||
document.getElementsByTagName('head')[0].appendChild(injectNode);
|
||||
};
|
||||
|
||||
const obj2props = (obj) =>
|
||||
Object.entries(obj)
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
const injectTag = (tag, props, children) => {
|
||||
const injectNode = document.createElement(tag);
|
||||
Object.entries(props).forEach(([key, val]) => injectNode[key] = val);
|
||||
if (children) injectNode.appendChild(document.createTextNode(children));
|
||||
document.getElementsByTagName('head')[0].appendChild(injectNode);
|
||||
};
|
||||
|
||||
export default injectTag;
|
||||
Reference in New Issue
Block a user