Skip to content

Commit

Permalink
Start of header home page
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincharles committed Feb 28, 2023
1 parent 26afeba commit 0d5cfe9
Show file tree
Hide file tree
Showing 9 changed files with 583 additions and 76 deletions.
43 changes: 26 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
"react-is": "^17.0.1",
"react-mathquill": "^1.0.1",
"react-measure": "^2.5.2",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0",
"react-router": "^6.8.1",
"react-router-dom": "^6.8.1",
"react-select": "^4.3.1",
"react-table": "^7.7.0",
"react-use-measure": "^2.1.1",
Expand Down
61 changes: 29 additions & 32 deletions src/Api/getHPCarouselData.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
<?php
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: access");
header("Access-Control-Allow-Methods: GET");
header("Access-Control-Allow-Credentials: true");
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: access');
header('Access-Control-Allow-Methods: GET');
header('Access-Control-Allow-Credentials: true');
header('Content-Type: application/json');

include "db_connection.php";
include 'db_connection.php';
// $jwtArray = include "jwtArray.php";

$success = TRUE;
$message = "";
$carouselData = [[],[],[]];
$success = true;
$message = '';
$carouselData = [[], [], [], []];


$sql = "
$sql = "
SELECT section,
position,
imagePath,
Expand All @@ -23,32 +22,30 @@
ORDER BY section,position
";

$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()){
$section = $row['section'];

array_push($carouselData[$section],array(
"imagePath"=>$row['imagePath'],
"text"=>$row['text'],
"link"=>$row['link'],
));
}
}

$result = $conn->query($sql);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$section = $row['section'];

array_push($carouselData[$section], [
'imagePath' => $row['imagePath'],
'text' => $row['text'],
'link' => $row['link'],
]);
}
}

$response_arr = array(
"success"=>$success,
"message"=>$message,
"carouselData"=>$carouselData,
);
$response_arr = [
'success' => $success,
'message' => $message,
'carouselData' => $carouselData,
];

http_response_code(200);
http_response_code(200);

// make it json format
echo json_encode($response_arr);
// make it json format
echo json_encode($response_arr);

$conn->close();

?>
?>
10 changes: 4 additions & 6 deletions src/Tools/_framework/NewToolRoot.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -933,17 +933,15 @@ function RootController(props) {
nextMenusAndPanels = {
...navigationObj[recoilPageToolView.page][recoilPageToolView.tool],
};
// console.log("navigationObj[recoilPageToolView.page][recoilPageToolView.tool].currentMenus",navigationObj[recoilPageToolView.page][recoilPageToolView.tool].currentMenus)
nextMenusAndPanels.currentMenus = [
...navigationObj[recoilPageToolView.page][recoilPageToolView.tool]
.currentMenus,
...navigationObj[recoilPageToolView.page][recoilPageToolView.tool].currentMenus,
];
nextMenusAndPanels.menusTitles = [
...navigationObj[recoilPageToolView.page][recoilPageToolView.tool]
.menusTitles,
...navigationObj[recoilPageToolView.page][recoilPageToolView.tool].menusTitles,
];
nextMenusAndPanels.menusInitOpen = [
...navigationObj[recoilPageToolView.page][recoilPageToolView.tool]
.menusInitOpen,
...navigationObj[recoilPageToolView.page][recoilPageToolView.tool].menusInitOpen,
];

if (suppressMenus.length > 0) {
Expand Down
Loading

0 comments on commit 0d5cfe9

Please sign in to comment.