diff --git a/src/components/_mobile/collection/Attack.tsx b/src/components/_mobile/collection/Attack.tsx index 5f1b83f..3768c21 100644 --- a/src/components/_mobile/collection/Attack.tsx +++ b/src/components/_mobile/collection/Attack.tsx @@ -4,7 +4,7 @@ import { Attack } from "../../common/definitions"; import { AttackIcon, ElementIcon, Name, RarityIcon } from '../../Snippets'; import { abilityText } from '../../Snippets/abilityText'; import { uniqueText } from '../../Snippets/uniqueText'; -import { CardBase, CardComponent } from './CardBase'; +import { CardBase, CardComponent, Flavor, Unique } from './CardBase'; const AttackCard: CardBase = (props) => { const { card } = props; @@ -17,8 +17,8 @@ const AttackCard: CardBase = (props) => { {ability} - {unique && {unique}} - {flavor && {flavor}} + {unique && {unique}} + {flavor && {flavor}} } left={<> @@ -35,8 +35,8 @@ const AttackCard: CardBase = (props) => { content={<> {ability} - {unique && {unique}} - {flavor && {flavor}} + {unique && {unique}} + {flavor && {flavor}} Art By: {card.gsx$artist} } /> diff --git a/src/components/_mobile/collection/Battlegear.tsx b/src/components/_mobile/collection/Battlegear.tsx index acfb8b7..a0314ed 100644 --- a/src/components/_mobile/collection/Battlegear.tsx +++ b/src/components/_mobile/collection/Battlegear.tsx @@ -4,7 +4,7 @@ import { BattlegearIcon, Name, RarityIcon } from '../../Snippets'; import { Battlegear } from '../../common/definitions'; import { abilityText } from '../../Snippets/abilityText'; import { uniqueText } from '../../Snippets/uniqueText'; -import { CardBase, CardComponent } from './CardBase'; +import { CardBase, CardComponent, Unique, Flavor } from './CardBase'; const BattlegearCard: CardBase = (props) => { const { card } = props; @@ -21,19 +21,18 @@ const BattlegearCard: CardBase = (props) => { } right={<> {ability} - {unique && {unique}} - {flavor && {flavor}} + {unique && {unique}} + {flavor && {flavor}} } content={<> {ability} - {unique && {unique}} - {flavor && {flavor}} + {unique && {unique}} + {flavor && {flavor}} Art By: {card.gsx$artist} } /> ); - }; export default BattlegearCard; diff --git a/src/components/_mobile/collection/CardBase.tsx b/src/components/_mobile/collection/CardBase.tsx index 5e5e4b4..f7568f4 100644 --- a/src/components/_mobile/collection/CardBase.tsx +++ b/src/components/_mobile/collection/CardBase.tsx @@ -1,4 +1,4 @@ -import { Box, Card, CardMedia, CardContent } from '@mui/material'; +import { Box, Card, CardMedia, CardContent, Typography, styled } from '@mui/material'; import React from 'react'; import { Card as ChaoticCard } from "../../common/definitions"; @@ -28,6 +28,8 @@ type componentProps = chaoticCardProps & { export const CardComponent = ( { card, ext, extend, left, right, content }: componentProps ) => { + const loc = card.gsx$type === "Locations"; + return (ext === false) ? ( @@ -41,7 +43,7 @@ export const CardComponent = ( {left} - + {right} @@ -50,16 +52,27 @@ export const CardComponent = ( extend("")} /> - + {content} ); }; + +export const Unique = styled(Typography)(() => ({ + fontWeight: "bold" +})); + +export const Flavor = styled(Typography)(() => ({ + fontStyle: "italic" +})); diff --git a/src/components/_mobile/collection/Location.tsx b/src/components/_mobile/collection/Location.tsx new file mode 100644 index 0000000..c6874ce --- /dev/null +++ b/src/components/_mobile/collection/Location.tsx @@ -0,0 +1,40 @@ +import { Typography } from '@mui/material'; +import React from 'react'; +import { Location } from '../../common/definitions'; +import { InitiativeIcon, LocationIcon, Name, RarityIcon } from '../../Snippets'; +import { abilityText } from '../../Snippets/abilityText'; +import { uniqueText } from '../../Snippets/uniqueText'; +import { CardBase, CardComponent, Unique, Flavor } from './CardBase'; + +const LocationCard: CardBase = (props) => { + const { card } = props; + const ability = abilityText({ ability: card.gsx$ability }); + const unique = uniqueText({ data: { unique: card.gsx$unique, loyal: card.gsx$loyal, legendary: card.gsx$legendary }}); + const flavor = card.gsx$flavortext; + + return ( + + + + Location{card.gsx$types.length > 0 ? ` - ${card.gsx$types}` : null} + {`Initiative: `}{` ${card.gsx$initiative}`} + } + right={<> + {ability} + {unique && {unique}} + {flavor && {flavor}} + } + content={<> + + {`Initiative: `}{` ${card.gsx$initiative}`} + {ability} + {unique && {unique}} + {flavor && {flavor}} + Art By: {card.gsx$artist} + } + /> + ); +}; + +export default LocationCard; diff --git a/src/components/_mobile/collection/collection.scss b/src/components/_mobile/collection/collection.scss index 728f3b3..8e77f8f 100644 --- a/src/components/_mobile/collection/collection.scss +++ b/src/components/_mobile/collection/collection.scss @@ -1,24 +1,24 @@ .icon14 { + width: 16px; height: 16px; vertical-align: middle; } .icon16 { + width: 16px; height: 16px; } .icon20 { + width: 20px; height: 20px; } .icon24 { + width: 24px; height: 24px; } -.bigger { - font-size: 1.15rem; -} - .name { -webkit-user-select: all; -moz-user-select: all; diff --git a/src/components/_mobile/collection/index.tsx b/src/components/_mobile/collection/index.tsx index e4a99fe..9e5e281 100644 --- a/src/components/_mobile/collection/index.tsx +++ b/src/components/_mobile/collection/index.tsx @@ -2,9 +2,10 @@ import { Box, Card, Checkbox, createTheme, FormControl, FormControlLabel, InputLabel, MenuItem, Pagination, Paper, Select, SelectChangeEvent, styled, ThemeProvider, Typography } from '@mui/material'; import React, { useEffect, useState } from 'react'; -import { Attack, Battlegear, Card as ChaoticCard } from '../../common/definitions'; +import { Attack, Battlegear, Location, Card as ChaoticCard } from '../../common/definitions'; import AttackCard from './Attack'; import BattlegearCard from './Battlegear'; +import LocationCard from './Location'; import { chaoticCardProps, statsType } from './CardBase'; import Search from './Search'; @@ -224,8 +225,12 @@ const CardList = ({ cards, selected, ext, ...props }: listProps) => { />); // case "Creatures": // return (); - // case "Locations": - // return (); + case "Locations": + return (); // case "Mugic": // return (); default: diff --git a/src/components/collection/types/Location.js b/src/components/collection/types/Location.js index 76ccca5..c037a19 100644 --- a/src/components/collection/types/Location.js +++ b/src/components/collection/types/Location.js @@ -1,7 +1,7 @@ import { inject, observer } from 'mobx-react'; import React from 'react'; -import { Ability, FlavorText, InitiativeIcon, LocationIcon, Name, RarityIcon, Unique } from '../../Snippets'; +import { Ability, FlavorText, Initiative, LocationIcon, Name, RarityIcon, Unique } from '../../Snippets'; import API from '../../SpreadsheetData'; @inject((stores, props, context) => props) @observer @@ -17,7 +17,7 @@ export default class Location extends React.Component {
Location{card.gsx$types.length > 0 ? " - " + card.gsx$types : null}
- +
@@ -31,7 +31,7 @@ export default class Location extends React.Component {
- + diff --git a/src/components/portal/Single/Location.js b/src/components/portal/Single/Location.js index ba8133d..9c82e4e 100644 --- a/src/components/portal/Single/Location.js +++ b/src/components/portal/Single/Location.js @@ -2,7 +2,7 @@ import React from 'react'; import API from '../../SpreadsheetData'; import { observer, inject } from 'mobx-react'; import Single from './_base'; -import { PageNotFound, InitiativeIcon } from '../../Snippets'; +import { PageNotFound, Initiative } from '../../Snippets'; @inject((stores, props, context) => props) @observer export default class SingleLocation extends React.Component { @@ -40,7 +40,7 @@ export default class SingleLocation extends React.Component { {card_data.gsx$initiative && (
Initiative: - +
)} } @@ -65,7 +65,7 @@ export default class SingleLocation extends React.Component { {card_data.gsx$initiative && (
Initiative: - +
)} }