@mui/icons-material#SwapHoriz TypeScript Examples

The following examples show how to use @mui/icons-material#SwapHoriz. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.tsx    From genshin-optimizer with MIT License 6 votes vote down vote up
function ArtSwapCard({ slotKey }: { slotKey: SlotKey }) {
  const { character: { key: characterKey } } = useContext(DataContext)
  const { database } = useContext(DatabaseContext)
  const [show, onOpen, onClose] = useBoolState()
  return <CardLight sx={{ height: "100%", width: "100%", minHeight: 300, display: "flex", flexDirection: "column" }}>
    <CardContent>
      <Typography><SlotNameWithIcon slotKey={slotKey} /></Typography>
    </CardContent>
    <Divider />
    <Box sx={{
      flexGrow: 1,
      display: "flex",
      justifyContent: "center",
      alignItems: "center"
    }}
    >
      <ArtifactSwapModal slotKey={slotKey} show={show} onClose={onClose} onChangeId={id => database.setArtLocation(id, characterKey)} />
      <Button onClick={onOpen} color="info" sx={{ borderRadius: "1em", }}>
        <SwapHoriz sx={{ height: 100, width: 100 }} />
      </Button>
    </Box>
  </CardLight>
}
Example #2
Source File: index.tsx    From genshin-optimizer with MIT License 6 votes vote down vote up
function WeaponSwapButton({ weaponTypeKey }: { weaponTypeKey: WeaponTypeKey }) {
  const { t } = useTranslation("page_character")
  const { character: { key: characterKey } } = useContext(DataContext)
  const { database } = useContext(DatabaseContext)
  const [show, onOpen, onClose] = useBoolState()
  return <>
    <Tooltip title={<Typography>{t`tabEquip.swapWeapon`}</Typography>} placement="top" arrow>
      <Button color="info" size="small" onClick={onOpen} ><SwapHoriz /></Button>
    </Tooltip>
    <WeaponSwapModal weaponTypeKey={weaponTypeKey} onChangeId={id => database.setWeaponLocation(id, characterKey)} show={show} onClose={onClose} />
  </>
}
Example #3
Source File: index.tsx    From genshin-optimizer with MIT License 6 votes vote down vote up
function LargeWeaponSwapButton({ weaponTypeKey }: { weaponTypeKey: WeaponTypeKey }) {
  const { t } = useTranslation("page_character")
  const { character: { key: characterKey } } = useContext(DataContext)
  const { database } = useContext(DatabaseContext)
  const [show, onOpen, onClose] = useBoolState()
  return <>
    <Button color="info" onClick={onOpen} startIcon={<SwapHoriz />} >{t`tabEquip.swapWeapon`}</Button>
    <WeaponSwapModal weaponTypeKey={weaponTypeKey} onChangeId={id => database.setWeaponLocation(id, characterKey)} show={show} onClose={onClose} />
  </>
}
Example #4
Source File: index.tsx    From genshin-optimizer with MIT License 6 votes vote down vote up
function ArtifactSwapButton({ slotKey }: { slotKey: SlotKey }) {
  const { t } = useTranslation("page_character")
  const { character: { key: characterKey } } = useContext(DataContext)
  const { database } = useContext(DatabaseContext)
  const [show, onOpen, onClose] = useBoolState()
  return <>
    <Tooltip title={<Typography>{t`tabEquip.swapArt`}</Typography>} placement="top" arrow>
      <Button color="info" size="small" onClick={onOpen} ><SwapHoriz /></Button>
    </Tooltip>
    <ArtifactSwapModal slotKey={slotKey} show={show} onClose={onClose} onChangeId={id => database.setArtLocation(id, characterKey)} />
  </>
}