Skip to content
Snippets Groups Projects
Verified Commit f5b44587 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: selectors disabled

parent 95ea6b86
No related branches found
No related tags found
No related merge requests found
Pipeline #1709 passed
......@@ -597,6 +597,7 @@ export const EmulatorApp: FC<EmulatorAppProps> = ({
</Info>
]}
tabNames={["General", "Detailed"]}
selectors={false}
/>
</Section>
)}
......
......@@ -6,6 +6,7 @@ type PanelTabProps = {
tabs: ReactNode[];
tabNames: string[];
tabIndex?: number;
selectors?: boolean;
style?: string[];
};
......@@ -13,28 +14,31 @@ export const PanelTab: FC<PanelTabProps> = ({
tabs,
tabNames,
tabIndex = 0,
selectors = true,
style = []
}) => {
const classes = () => ["panel-tab", ...style].join(" ");
const [tabIndexState, setTabIndexState] = useState(tabIndex);
return (
<div className={classes()}>
<div className="tab-selectors">
{tabNames.map((tabName, tabIndex) => {
const classes = [
"tab-selector",
tabIndex === tabIndexState ? "selected" : ""
].join(" ");
return (
<span
className={classes}
onClick={() => setTabIndexState(tabIndex)}
>
{tabName}
</span>
);
})}
</div>
{selectors && (
<div className="tab-selectors">
{tabNames.map((tabName, tabIndex) => {
const classes = [
"tab-selector",
tabIndex === tabIndexState ? "selected" : ""
].join(" ");
return (
<span
className={classes}
onClick={() => setTabIndexState(tabIndex)}
>
{tabName}
</span>
);
})}
</div>
)}
<div className="tab-container">{tabs[tabIndexState]}</div>
</div>
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment