diff --git a/src/components/Snippets/abilityText.js b/src/components/Snippets/abilityText.js index 042f204..a329039 100644 --- a/src/components/Snippets/abilityText.js +++ b/src/components/Snippets/abilityText.js @@ -3,6 +3,8 @@ import processString from 'react-process-string'; import { MugicIcon, ElementIcon, DisciplineIcon, TribeIcon } from "./_icons"; export function abilityText(props) { + if (!props.ability || props.ability.length === 0) return ""; + const mugic_counters = { regex: /([0-9x]*){{mc}}/i, fn: (key, result) => { diff --git a/src/components/_mobile/collection/CardBase.tsx b/src/components/_mobile/collection/CardBase.tsx index 6571e13..1840efa 100644 --- a/src/components/_mobile/collection/CardBase.tsx +++ b/src/components/_mobile/collection/CardBase.tsx @@ -1,4 +1,4 @@ -import { Box, Card, CardMedia, CardContent, Typography, styled } from '@mui/material'; +import { Box, Card, CardMedia, CardContent, Typography, styled, useTheme } from '@mui/material'; import React from 'react'; import { Card as ChaoticCard } from "../../common/definitions"; @@ -31,11 +31,15 @@ type componentProps = chaoticCardProps & { export const CardComponent = ( { card, ext, extend, imageCover, left, right, content, right2 }: componentProps ) => { + const theme = useTheme(); + const loc = card.gsx$type === "Locations"; return (ext === false) ? ( - + {left} - - {right} + + + {right} + + {right2 && + {right2} + } - {right2 && - {right2} - } ) : ( diff --git a/src/components/_mobile/collection/Search.tsx b/src/components/_mobile/collection/Search.tsx index eade847..a9d2838 100644 --- a/src/components/_mobile/collection/Search.tsx +++ b/src/components/_mobile/collection/Search.tsx @@ -1,9 +1,8 @@ -import React, { FormEvent, useEffect, useMemo, useReducer, useRef, useState } from 'react'; +import React, { FormEvent, useEffect, useReducer, useRef, useState } from 'react'; import { useHistory, useLocation } from 'react-router-dom'; import API, { sets } from '../../SpreadsheetData/API'; import search_api from '../../collection/search/search'; -import { Loading } from '../../Snippets'; -import { Modal, Fab, Zoom, useTheme } from '@mui/material'; +import { Modal, Fab, Zoom, useTheme, Box, TextField } from '@mui/material'; import SearchIcon from '@mui/icons-material/Search'; const initInput = (() => { @@ -169,9 +168,9 @@ export default function Search ({ setContent, setInfo }) { } }; - const handleChange = (event: {target: HTMLInputElement}, obj?: string) => { + const handleChange = (event: {target: HTMLInputElement | HTMLTextAreaElement}, obj?: string) => { const { target } = event; - const value = target.type === 'checkbox' ? target.checked : target.value; + const value = target.type === 'checkbox' ? (target as HTMLInputElement).checked : target.value; const { name } = target; dispatchInput({ @@ -179,10 +178,6 @@ export default function Search ({ setContent, setInfo }) { }); }; - const form = ((loaded == false) ? <> : <> - - ); - const handleOpen = () => { setOpen(true); }; @@ -196,6 +191,25 @@ export default function Search ({ setContent, setInfo }) { exit: theme.transitions.duration.leavingScreen, }; + const form = ((loaded == false) ? <> : + handleChange(e)} + /> + ); + return (<>