Skip to content

Commit

Permalink
removed tracing last used button option
Browse files Browse the repository at this point in the history
  • Loading branch information
dnenov committed May 29, 2024
1 parent ac5cb59 commit c922d1d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 21 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dynamods/dynamo-home",
"version": "1.0.13",
"version": "1.0.14",
"description": "Dynamo Home",
"author": "Autodesk Inc.",
"main": "index.js",
Expand Down
8 changes: 4 additions & 4 deletions src/components/Samples/SamplesGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import React from "react";
import { SamplesGridItem } from "./SamplesGridItem";
import styles from './SamplesGrid.module.css';

const renderSample = (sample, key) => {
const renderSample = (sample, keyPrefix) => {
if (sample.Children && sample.Children.length > 0) {
// Separate the children into leaf nodes and nested nodes
const leafNodes = sample.Children.filter(child => !child.Children || child.Children.length === 0);
const nestedNodes = sample.Children.filter(child => child.Children && child.Children.length > 0);

return (
<div key={key} className={styles["sample-container"]}>
<div key={keyPrefix} className={styles["sample-container"]}>
<div className='drop-shadow-2xl'>
<p className='title-paragraph'>{sample.FileName}</p>
</div>
Expand All @@ -24,9 +24,9 @@ const renderSample = (sample, key) => {
} else {
// Render a SamplesGridItem for leaf nodes
return (
<div className={styles["sample-container"]}>
<div key={keyPrefix} className={styles["sample-container"]}>
<div className={styles["graphs-grid"]}>
<SamplesGridItem key={key} FileName={sample.FileName} FilePath={sample.FilePath} />
<SamplesGridItem key={keyPrefix} FileName={sample.FileName} FilePath={sample.FilePath} />
</div>
</div>
);
Expand Down
9 changes: 2 additions & 7 deletions src/components/Sidebar/CustomDropDown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,16 @@ export const CustomDropdown = ({ id, selectedValue, options, onSelect, placehold

/** Peforms the selected action type when used as a Drop-down */
const handleOptionSelect = (option) => {
onSelect(option.label);
setIsOpen(false);
setLastSelected(option);
if (onSelectionChange) {
onSelectionChange(option.value);
}
};

/** Peforms the selected action type when used as a Button */
const handleDefaultAction = () => {
if (lastSelected) {
onSelect(lastSelected.label);
if (onSelectionChange) {
onSelectionChange(lastSelected.value);
}
if (onSelectionChange) {
onSelectionChange(lastSelected.value);
}
};

Expand Down
7 changes: 0 additions & 7 deletions src/components/Sidebar/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import styles from './Sidebar.module.css';

export function Sidebar({ onItemSelect, selectedSidebarItem })
{
const [selectedFile, setSelectedFile] = useState('');
const [selectedNew, setSelectedNew] = useState('');

const isSelected = (item) => selectedSidebarItem === item;

/**Trigger the backend command based on the drop-down value */
Expand All @@ -27,8 +24,6 @@ export function Sidebar({ onItemSelect, selectedSidebarItem })
{/* Files Dropdown */}
<CustomDropdown
id="openDropdown"
selectedValue={selectedFile}
onSelect={setSelectedFile}
placeholder={<FormattedMessage id="button.title.text.open" />}
onSelectionChange={setSelectedValue}
options={[
Expand All @@ -41,8 +36,6 @@ export function Sidebar({ onItemSelect, selectedSidebarItem })
{/* New Dropdown */}
<CustomDropdown
id="newDropdown"
selectedValue={selectedNew}
onSelect={setSelectedNew}
placeholder={<FormattedMessage id="button.title.text.new" />}
onSelectionChange={setSelectedValue}
options={[
Expand Down

0 comments on commit c922d1d

Please sign in to comment.