-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from jacobfilik/rawview
add raw viewer, refactor, lint
- Loading branch information
Showing
18 changed files
with
582 additions
and
479 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
{ | ||
"image": "node:18-bullseye-slim", | ||
"postCreateCommand": "yes | npm install -g pnpm", | ||
"forwardPorts": [ | ||
5173 | ||
], | ||
"forwardPorts": [5173], | ||
"runArgs": [ | ||
"--network=host", | ||
"--security-opt=label=type:container_runtime_t" | ||
], | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode" | ||
] | ||
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { Tab, Tabs, Box } from "@mui/material"; | ||
|
||
import StandardMetadataCard from "./StandardMetadataCard"; | ||
import ReviewTextView from "./XDITextView"; | ||
|
||
import { useState } from "react"; | ||
import { XASStandard } from "../models"; | ||
|
||
interface TabPanelProps { | ||
children?: React.ReactNode; | ||
index: number; | ||
value: number; | ||
} | ||
|
||
function CustomTabPanel(props: TabPanelProps) { | ||
const { children, value, index, ...other } = props; | ||
|
||
return ( | ||
<div | ||
role="tabpanel" | ||
hidden={value !== index} | ||
id={`simple-tabpanel-${index}`} | ||
aria-labelledby={`simple-tab-${index}`} | ||
{...other} | ||
> | ||
{value === index && <Box sx={{ p: 3 }}>{children}</Box>} | ||
</div> | ||
); | ||
} | ||
|
||
function a11yProps(index: number) { | ||
return { | ||
id: `simple-tab-${index}`, | ||
"aria-controls": `simple-tabpanel-${index}`, | ||
}; | ||
} | ||
|
||
export default function MetadataTab(props: { standard: XASStandard }) { | ||
const [value, setValue] = useState(0); | ||
|
||
const handleChange = (event: React.SyntheticEvent, newValue: number) => { | ||
setValue(newValue); | ||
}; | ||
|
||
return ( | ||
<Box sx={{ width: "100%" }}> | ||
<Box sx={{ borderBottom: 1, borderColor: "divider" }}> | ||
<Tabs | ||
value={value} | ||
onChange={handleChange} | ||
aria-label="basic tabs example" | ||
> | ||
<Tab label="Standard" {...a11yProps(0)} /> | ||
<Tab label="Raw File" {...a11yProps(1)} /> | ||
</Tabs> | ||
</Box> | ||
<CustomTabPanel value={value} index={0}> | ||
<StandardMetadataCard standard={props.standard} /> | ||
</CustomTabPanel> | ||
<CustomTabPanel value={value} index={1}> | ||
<ReviewTextView /> | ||
</CustomTabPanel> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.