move InstructionMenu to components directory
additionally make a map parameter explicitly typed
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { Card, CardContent, styled, Typography } from "@mui/material"
|
import { Card, CardContent, styled, Typography } from "@mui/material"
|
||||||
import React from "react"
|
import React from "react"
|
||||||
import instructions from "./Instructions"
|
import instructions, { Instruction } from "../Instructions"
|
||||||
import Tooltip, { TooltipProps, tooltipClasses } from "@mui/material/Tooltip"
|
import Tooltip, { TooltipProps, tooltipClasses } from "@mui/material/Tooltip"
|
||||||
|
|
||||||
const HtmlTooltip = styled(({ className, ...props }: TooltipProps) => (
|
const HtmlTooltip = styled(({ className, ...props }: TooltipProps) => (
|
||||||
@@ -21,7 +21,7 @@ export default function InstructionMenu() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div style={{ display: "flex" }}>
|
<div style={{ display: "flex" }}>
|
||||||
{instructions.map((instruction) => {
|
{instructions.map((instruction: Instruction) => {
|
||||||
return (
|
return (
|
||||||
<div key={key++}>
|
<div key={key++}>
|
||||||
<HtmlTooltip
|
<HtmlTooltip
|
||||||
@@ -32,11 +32,11 @@ export default function InstructionMenu() {
|
|||||||
<Typography>{instruction.description}</Typography>
|
<Typography>{instruction.description}</Typography>
|
||||||
</>
|
</>
|
||||||
}>
|
}>
|
||||||
<Card key={key++} sx={{ height: "3rem", width: "3rem" }}>
|
<Card key={key++} sx={{ height: "3rem", width: "3rem" }}>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<Typography sx={{ userSelect: "none" }}>{instruction.symbol}</Typography>
|
<Typography sx={{ userSelect: "none" }}>{instruction.symbol}</Typography>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</HtmlTooltip>
|
</HtmlTooltip>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
Reference in New Issue
Block a user