-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
141 additions
and
48 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
11 changes: 11 additions & 0 deletions
11
packages/mui/src/components/FindTokenComponent/FindTokenComponent.lazy.tsx
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,11 @@ | ||
import React, { lazy, Suspense } from 'react'; | ||
|
||
const LazyFindTokenComponent = lazy(() => import('./FindTokenComponent')); | ||
|
||
const FindTokenComponent = (props: JSX.IntrinsicAttributes & { children?: React.ReactNode; }) => ( | ||
Check failure on line 5 in packages/mui/src/components/FindTokenComponent/FindTokenComponent.lazy.tsx
|
||
<Suspense fallback={null}> | ||
<LazyFindTokenComponent {...props} /> | ||
</Suspense> | ||
); | ||
|
||
export default FindTokenComponent; |
1 change: 1 addition & 0 deletions
1
packages/mui/src/components/FindTokenComponent/FindTokenComponent.module.css
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 @@ | ||
.FindTokenComponent {} |
14 changes: 14 additions & 0 deletions
14
packages/mui/src/components/FindTokenComponent/FindTokenComponent.test.tsx
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,14 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import '@testing-library/jest-dom'; | ||
import FindTokenComponent from './FindTokenComponent'; | ||
|
||
describe('<FindTokenComponent />', () => { | ||
test('it should mount', () => { | ||
render(<FindTokenComponent />); | ||
|
||
const findTokenComponent = screen.getByTestId('FindTokenComponent'); | ||
|
||
expect(findTokenComponent).toBeInTheDocument(); | ||
}); | ||
}); |
91 changes: 91 additions & 0 deletions
91
packages/mui/src/components/FindTokenComponent/FindTokenComponent.tsx
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,91 @@ | ||
import { Box, ListItem, ListSubheader, Paper, TextField } from "@mui/material"; | ||
import { AppReducerState } from "../../reducers/AppReducer"; | ||
import { useSelector } from "react-redux"; | ||
import { useEffect } from "react"; | ||
// import styles from "./FindTokenComponent.module.css"; | ||
|
||
// interface FindTokenComponentProps {} | ||
|
||
const FindTokenComponent = () => { | ||
const tokens = useSelector((state: AppReducerState) => state.content.tokens); | ||
|
||
useEffect(() => {}, []); | ||
|
||
/** {scenes.map((scene) => ( | ||
<ListItem | ||
key={scene._id} | ||
secondaryAction={ | ||
<IconButton | ||
edge="end" | ||
aria-label="delete" | ||
onClick={() => handleDeleteScene(scene)} | ||
> | ||
<DeleteIcon /> | ||
</IconButton> | ||
} */ | ||
return ( | ||
// , height: `calc(100vh - 72px)` | ||
<Box sx={{ overflow: "auto" }}> | ||
<ListSubheader> | ||
<TextField | ||
autoFocus | ||
label="Name" | ||
variant="standard" | ||
// onChange={search} | ||
sx={{ m: 1, margin: "1em" }} | ||
></TextField> | ||
</ListSubheader> | ||
{/* <ListItem | ||
key={scene._id} | ||
secondaryAction={ | ||
<IconButton | ||
edge="end" | ||
aria-label="delete" | ||
onClick={() => handleDeleteScene(scene)} | ||
> | ||
<DeleteIcon /> | ||
</IconButton> | ||
} | ||
> */} | ||
{tokens.map((token) => ( | ||
<ListItem key={token._id}>{token.name}</ListItem> | ||
))} | ||
{/* <TextField | ||
variant="standard" | ||
label="Class" | ||
defaultValue="" | ||
disabled={classes.length === 0} | ||
select | ||
onChange={(event) => setClassSelected(event.target.value)} | ||
sx={{ m: 1, margin: "1em" }} | ||
> | ||
{classes.map((classroom: ClassRoom) => ( | ||
<MenuItem key={classroom._id} value={classroom._id}> | ||
{classroomText(classroom)} | ||
</MenuItem> | ||
))} | ||
</TextField> */} | ||
{/* <SearchResultsList | ||
value={searchValue} | ||
onSelected={(student: Student) => selected(student)} | ||
/> */} | ||
{/* The text field above is 3.5em, so we shrink the paper by 3.5em and let it handle overflow | ||
to keep the scrolling to within the list it contains. */} | ||
<Paper | ||
sx={{ | ||
display: "flex", | ||
justifyContent: "left", | ||
flexWrap: "wrap", | ||
listStyle: "none", | ||
padding: 0, | ||
margin: "0 0 3.5em 0", | ||
overflow: "auto", | ||
}} | ||
component="ul" | ||
elevation={0} | ||
></Paper> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default FindTokenComponent; |
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