Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
.env.local

**gz

react/node_modules/*
8 changes: 3 additions & 5 deletions application/modules/front/views/layouts/searchbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
else $stextval = "";
}
?>

<script src="../../../../../public/reactbuild/bundle.js">
</script>
<div id=search>
<a class="searchtipslink">Search Tips</a>
<div id="searchbar">
<form name="searchform" action="/search/" method=get id="searchform">
<input type="text" class="searchquery" name=q placeholder= "Search …" value="<?php echo htmlspecialchars(strip_tags($stextval)); ?>" />
<input type="submit" class="searchsubmit" value="l" />
</form>
<div id="react-root-searchbar"></div>
</div>

<div id="searchtips">
Expand Down
2 changes: 2 additions & 0 deletions public/reactbuild/bundle.js

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions public/reactbuild/bundle.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
3 changes: 3 additions & 0 deletions react/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-react"]
}
25 changes: 25 additions & 0 deletions react/components/SearchComponent.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import ReactDOM from 'react-dom/client';

const SearchComponent = () => {
console.log("SearchComponent");

return (
<div id="searchbar">
test
</div>
);
};

export default SearchComponent;

// Wait for the DOM to load before rendering
document.addEventListener('DOMContentLoaded', () => {
const rootElement = document.getElementById('react-root-searchbar');
if (rootElement) {
const root = ReactDOM.createRoot(rootElement);
root.render(<SearchComponent />);
} else {
console.error('Target container #react-root-searchbar not found');
}
});
Loading