From 6d0d6f08b538e3cbca2abb1eca98a5b3c7abf530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Wed, 28 May 2025 09:09:14 +0200 Subject: [PATCH 1/2] initial commit --- client/homebrew/homebrew.jsx | 117 ++++++++++++++++------------------- 1 file changed, 53 insertions(+), 64 deletions(-) diff --git a/client/homebrew/homebrew.jsx b/client/homebrew/homebrew.jsx index 415390498..3559c7521 100644 --- a/client/homebrew/homebrew.jsx +++ b/client/homebrew/homebrew.jsx @@ -1,12 +1,8 @@ -//╔===--------------- Polyfills --------------===╗// +/* eslint-disable camelcase */ import 'core-js/es/string/to-well-formed.js'; -//╚===--------------- ---------------===╝// - -require('./homebrew.less'); -const React = require('react'); -const createClass = require('create-react-class'); -const { StaticRouter:Router } = require('react-router'); -const { Route, Routes, useParams, useSearchParams } = require('react-router'); +import './homebrew.less'; +import React from 'react'; +import { StaticRouter as Router, Route, Routes, useParams, useSearchParams } from 'react-router'; const HomePage = require('./pages/homePage/homePage.jsx'); const EditPage = require('./pages/editPage/editPage.jsx'); @@ -34,62 +30,55 @@ const WithRoute = (props)=>{ return ; }; -const Homebrew = createClass({ - displayName : 'Homebrewery', - getDefaultProps : function() { - return { - url : '', - welcomeText : '', - changelog : '', - version : '0.0.0', - account : null, - enable_v3 : false, - brew : { - title : '', - text : '', - shareId : null, - editId : null, - createdAt : null, - updatedAt : null, - lang : '' - } - }; - }, +const Homebrew = (props)=>{ + const { + url = '', + version = '0.0.0', + account = null, + enable_v3 = false, + enable_themes, + config, + brew = { + title : '', + text : '', + shareId : null, + editId : null, + createdAt : null, + updatedAt : null, + lang : '' + }, + userThemes, + brews + } = props; - getInitialState : function() { - global.account = this.props.account; - global.version = this.props.version; - global.enable_v3 = this.props.enable_v3; - global.enable_themes = this.props.enable_themes; - global.config = this.props.config; + global.account = account; + global.version = version; + global.enable_v3 = enable_v3; + global.enable_themes = enable_themes; + global.config = config; - return {}; - }, + return ( + +
+ + } /> + } /> + } /> + } /> + } /> + }/> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + +
+
+ ); +}; - render : function (){ - return ( - -
- - } /> - } /> - } /> - } /> - } /> - }/> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - -
-
- ); - } -}); - -module.exports = Homebrew; \ No newline at end of file +module.exports = Homebrew; From 6de7a64acdabdf150d376501cd78bbc795e793ba Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 15 Jul 2025 12:58:06 -0400 Subject: [PATCH 2/2] Add comment for to-well-formed --- client/homebrew/homebrew.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/homebrew.jsx b/client/homebrew/homebrew.jsx index 3559c7521..1f20b2e93 100644 --- a/client/homebrew/homebrew.jsx +++ b/client/homebrew/homebrew.jsx @@ -1,5 +1,5 @@ /* eslint-disable camelcase */ -import 'core-js/es/string/to-well-formed.js'; +import 'core-js/es/string/to-well-formed.js'; //Polyfill for older browsers import './homebrew.less'; import React from 'react'; import { StaticRouter as Router, Route, Routes, useParams, useSearchParams } from 'react-router';