Skip to content

Commit

Permalink
Clean up Sidebar vars and headings
Browse files Browse the repository at this point in the history
  • Loading branch information
Fosten committed Jun 27, 2024
1 parent c911a1d commit 0511a96
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions src/components/Blocks/PlantLogs/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ const Sidebar = (props) => {
['log--transplanting', 'log--transplanting'],
];

const value = WholePlantTypeResponse(props);
var newarray = value[0];
var isAxiosBusy = value[1];
const valueP = WholePlantTypeResponse(props);
var plantTypearray = valueP[0];
var isPlantTypeBusy = valueP[1];
const valueL = WholeLandTypeResponse(props);
var landTypearray = valueL[0];
var isLandTypeBusy = valueL[1];

return isAxiosBusy || isLandTypeBusy ? (
return isPlantTypeBusy || isLandTypeBusy ? (
<div className="App">Loading...</div>
) : (
<Segment.Group raised>
Expand All @@ -52,7 +52,7 @@ const Sidebar = (props) => {
title="Plant Types"
required={false}
value={data.plant_type_selector ?? ''}
choices={newarray}
choices={plantTypearray}
onChange={(name, value) => {
onChangeBlock(block, {
...data,
Expand All @@ -74,7 +74,7 @@ const Sidebar = (props) => {
}}
/>
<header className="header pulled">
<h2>Select Status/Date filter</h2>
<h2>Select Status/Date Filters</h2>
</header>
<SelectWidget
id="status_selector"
Expand Down Expand Up @@ -117,7 +117,7 @@ const Sidebar = (props) => {
}}
/>
<header className="header pulled">
<h2>Select sort</h2>
<h2>Select Sort</h2>
</header>
<SelectWidget
id="sort_selector"
Expand Down
10 changes: 5 additions & 5 deletions src/components/Blocks/PlantLogs/plant_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { customizer } from '@Fosten/volto-farmOS/components/Blocks/PlantLogs/cus
import schema from '@Fosten/volto-farmOS/components/Blocks/PlantLogs/schema';

const WholePlantTypeResponse = (props) => {
const [newarray, setState2] = useState({});
const [isAxiosBusy, setAxiosBusy] = useState(true);
const [plantTypearray, setState2] = useState({});
const [isPlantTypeBusy, setAxiosBusy] = useState(true);

useEffect(() => {
async function myResponse2(url, combodata) {
Expand All @@ -26,8 +26,8 @@ const WholePlantTypeResponse = (props) => {
arr.push(ok2);
arr.push(ok);
}
const newarray = combineTwo(arr);
setState2(newarray);
const plantTypearray = combineTwo(arr);
setState2(plantTypearray);
} catch (err) {
// eslint-disable-next-line no-console
console.log(err);
Expand All @@ -37,7 +37,7 @@ const WholePlantTypeResponse = (props) => {
}
myResponse2(`${window.env.RAZZLE_FARMOS_API_HOST}/api/taxonomy_term/plant_type?sort=name`);
}, []);
return [newarray, isAxiosBusy];
return [plantTypearray, isPlantTypeBusy];
};

export default WholePlantTypeResponse;
2 changes: 1 addition & 1 deletion src/components/Blocks/PlantType/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const Sidebar = (props) => {
</header>
<SelectWidget
id="plant_type_selector"
title="Plant Typer"
title="Plant Type"
required={true}
value={data.plant_type_selector ?? false}
choices={newarray}
Expand Down

0 comments on commit 0511a96

Please sign in to comment.