Hide tabs at extension width (#55)
This commit is contained in:
parent
65284636de
commit
15c9845bdc
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@project-serum/swap-ui",
|
||||
"version": "0.1.5",
|
||||
"version": "0.1.6",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"homepage": "https://github.com/project-serum/swap-ui",
|
||||
|
|
|
@ -16,6 +16,7 @@ import {
|
|||
} from "@material-ui/core";
|
||||
import { TokenIcon } from "./Swap";
|
||||
import { useSwappableTokens } from "../context/TokenList";
|
||||
import { useMediaQuery } from "@material-ui/core";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
dialogContent: {
|
||||
|
@ -53,6 +54,7 @@ export default function TokenDialog({
|
|||
const styles = useStyles();
|
||||
const { swappableTokens, swappableTokensSollet, swappableTokensWormhole } =
|
||||
useSwappableTokens();
|
||||
const displayTabs = !useMediaQuery("(max-width:450px)");
|
||||
const selectedTokens =
|
||||
tabSelection === 0
|
||||
? swappableTokens
|
||||
|
@ -107,6 +109,7 @@ export default function TokenDialog({
|
|||
))}
|
||||
</List>
|
||||
</DialogContent>
|
||||
{displayTabs && (
|
||||
<DialogActions>
|
||||
<Tabs
|
||||
value={tabSelection}
|
||||
|
@ -135,6 +138,7 @@ export default function TokenDialog({
|
|||
/>
|
||||
</Tabs>
|
||||
</DialogActions>
|
||||
)}
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue