Skip to content

Commit

Permalink
Merge pull request #159 from YGO-SKC/v1.2.8
Browse files Browse the repository at this point in the history
V1.2.8: Various QOL Updates
  • Loading branch information
rtomyj authored Dec 18, 2021
2 parents 081103e + e0b407a commit ae36c04
Show file tree
Hide file tree
Showing 43 changed files with 858 additions and 585 deletions.
4 changes: 2 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
REACT_APP_API_HOST=http://localhost:9999
# REACT_APP_HEART_API_HOST=http://localhost:80
REACT_APP_HEART_API_HOST=https://heart-api.com
REACT_APP_HEART_API_HOST=http://localhost:80
# REACT_APP_HEART_API_HOST=https://heart-api.com
REACT_APP_CLIENT_ID='React App - localhost'
REACT_APP_VERSION=$npm_package_version
2 changes: 1 addition & 1 deletion .env.development_remote
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
REACT_APP_API_HOST=https://dev.skc-ygo-api.com
REACT_APP_API_HOST=https://skc-ygo-api.com
REACT_APP_HEART_API_HOST=https://heart-api.com
REACT_APP_CLIENT_ID='React App - Dev'
REACT_APP_VERSION=$npm_package_version
2 changes: 1 addition & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repository:
has_downloads: false

# Updates the default branch for this repository.
default_branch: v1.2.6
default_branch: v1.2.8

# Either `true` to allow squash-merging pull requests, or `false` to prevent
# squash-merging.
Expand Down
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"useTabs": true,
"jsxSingleQuote": true,
"printWidth": 180,
"semi": false
}
17 changes: 15 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "website",
"version": "1.2.7",
"version": "1.2.8",
"description": "Website to help duelists. ",
"main": "index.js",
"author": "",
Expand Down Expand Up @@ -33,6 +33,7 @@
"build:production": "env-cmd -f ./.env.production react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"checkAWS:cloudfrontSKC": "aws cloudfront list-distributions | jq '.DistributionList.Items[] | select(.Aliases.Items | contains([\"thesupremekingscastle.com\"])) | {id: .Id, aliases: .Aliases}'",
"uploadAWS:production": "npm run build:production; aws s3 rm s3://yugiohsite/ --recursive; aws s3 sync build s3://yugiohsite/ --cache-control max-age=3600; aws cloudfront create-invalidation --distribution-id ${YGO_CLOUDFRONT_PROD} --paths '/*'",
"uploadAWS:development": "npm run build:development_remote; aws s3 rm s3://yugiohsitedev/ --recursive; aws s3 sync build s3://yugiohsitedev/ --cache-control max-age=3600; aws cloudfront create-invalidation --distribution-id ${YGO_CLOUDFRONT_DEV} --paths '/*'"
},
Expand All @@ -53,6 +54,7 @@
"@types/react-helmet": "6.1.4",
"@types/react-router-dom": "5.3.2",
"@types/styled-components": "5.1.15",
"@types/underscore": "^1.11.3",
"env-cmd": "10.1.0",
"immer": "9.0.6",
"react-scripts": "4.0.3",
Expand Down
1 change: 0 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<link rel="dns-prefetch" href="https://images.thesupremekingscastle.com">
<link rel="dns-prefetch" href="%REACT_APP_API_HOST%">

<script async src="https://platform.twitter.com/widgets.js"></script>
<style>
html
{
Expand Down
29 changes: 20 additions & 9 deletions src/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const About = lazy( () => import( './components/about/About') )
const HttpErr = lazy( () => import('./components/util/exception/HttpErr') )


const NAME_maps_ROUTE : { [key: string]: string } =
{
const NAME_maps_ROUTE : { [key: string]: string } = {
'Home': '/',
'BanList': '/ban_list',
'About': '/about',
Expand All @@ -27,9 +26,12 @@ const NAME_maps_ROUTE : { [key: string]: string } =
'ProductBrowse': '/browse/product',
'ProductInformation': '/product/:productId',

'400': '/bad_request',
'500': '/server_err',
'503': '/service_unavailable'
'400': '/bad-request',
'408': '/request-timeout',
'422': '/unprocessable-entity',
'404-Server': '/not-found',
'500': '/server-err',
'503': '/service-unavailable'
}


Expand Down Expand Up @@ -67,16 +69,25 @@ export default function SKCSiteRoutes()
{ /* Routes specifically for errs */ }
<Route
path={NAME_maps_ROUTE[400]}
element={ <HttpErr httpErr={400}/> } />
element={ <HttpErr httpErr={'400'}/> } />
<Route
path={NAME_maps_ROUTE[408]}
element={ <HttpErr httpErr={'408'}/> } />
<Route
path={NAME_maps_ROUTE[422]}
element={ <HttpErr httpErr={'422'}/> } />
<Route
path={NAME_maps_ROUTE[500]}
element={ <HttpErr httpErr={500}/> } />
element={ <HttpErr httpErr={'500'}/> } />
<Route
path={NAME_maps_ROUTE[503]}
element={ <HttpErr httpErr={503}/> } />
element={ <HttpErr httpErr={'503'}/> } />
<Route
path={NAME_maps_ROUTE['404-Server']}
element={ <HttpErr httpErr={'404-Server'}/> } />
<Route
path={'/*'}
element={ <HttpErr httpErr={404}/> } />
element={ <HttpErr httpErr={'404-Client'}/> } />
</Routes>
</Suspense>
</Router>
Expand Down
73 changes: 41 additions & 32 deletions src/components/Browse.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React, { useState, useEffect, lazy } from 'react'
import startCase from 'lodash.startcase'
import Autocomplete from '@material-ui/lab/Autocomplete'
import { Chip, InputBase, IconButton } from '@material-ui/core'
import { Chip, InputBase, IconButton, Typography } from '@material-ui/core'
import { Helmet } from 'react-helmet'

import SearchIcon from '@material-ui/icons/Search'
import Section from './util/Section'

import Breadcrumb from './util/Breadcrumb'
import { MainContentContainer } from './MainContent'
Expand All @@ -18,9 +19,9 @@ import NAME_maps_ENDPOINT from '../helper/DownstreamServices'
import {LightTranslucentDivider, DarkTranslucentDivider} from './util/Divider'
import {StickyBox} from './util/StyledContainers'

import {RenderGroup, SearchSuggestionTypography} from './util/Search'
import RenderGroup, {SearchSuggestionTypography} from './util/search/Search'

import {LeftBoxSectionTypography, LeftBoxSectionHeaderTypography, RightBoxPaper, LeftBoxPaper, RightBoxHeaderTypography, RightBoxSubHeaderTypography, RightBoxHeaderContainer} from './util/grid/OneThirdTwoThirdsGrid'
import {RightBoxPaper, LeftBoxPaper, RightBoxHeaderTypography, RightBoxSubHeaderTypography, RightBoxHeaderContainer} from './util/grid/OneThirdTwoThirdsGrid'

const CardDisplayGrid = lazy( () => import('./util/grid/CardDisplayGrid'))

Expand Down Expand Up @@ -177,9 +178,11 @@ export default function Browse()
<StickyBox>
<LeftBoxPaper style={{ backgroundImage: 'linear-gradient(315deg, #7f5a83 0%, #0d324d 74%)' }} >

<LeftBoxSectionHeaderTypography variant='h6' >
<Typography
style={{color: 'white'}}
variant='h4' >
Current Criteria
</LeftBoxSectionHeaderTypography>
</Typography>

<div style={{minHeight: '1.5rem', marginBottom: '1rem'}} >
{selectedCriteriaChips}
Expand Down Expand Up @@ -233,41 +236,47 @@ export default function Browse()

<LightTranslucentDivider />

<LeftBoxSectionHeaderTypography variant='h6' >
<Typography
style={{color: 'white'}}
variant='h5' >
Results
</LeftBoxSectionHeaderTypography>
<LeftBoxSectionTypography variant='body1' >
</Typography>
<Typography
style={{color: 'white'}}
variant='body1' >
Total: {numResults}
</LeftBoxSectionTypography>
<LeftBoxSectionTypography variant='body1' >
</Typography>
<Typography
style={{color: 'white'}}
variant='body1' >
Displaying: {numResultsDisplayed}
</LeftBoxSectionTypography>
</Typography>

</LeftBoxPaper>
</StickyBox>
}
twoThirdComponent={
<RightBoxPaper>
<RightBoxHeaderContainer >
<RightBoxHeaderTypography variant='h4' >
Browse Results
</RightBoxHeaderTypography>
<RightBoxSubHeaderTypography variant='h5' >
Sorted Alphabetically
</RightBoxSubHeaderTypography>
<DarkTranslucentDivider />
</RightBoxHeaderContainer>

<CardDisplayGrid
cardJsonResults={jsonResults}
numResultsDisplayed={numResultsDisplayed}
numItemsToLoadWhenNeeded={numItemsToLoadWhenNeeded}
loadMoreCallback={loadMore}
isLoadMoreOptionVisible={isLoadMoreVisible}
numResults={numResults}
isDataLoaded={isCardBrowseDataLoaded}
/>
</RightBoxPaper>
<Section
sectionName='Browse Results'
sectionContent={
<div
className='section-content' >
<RightBoxSubHeaderTypography variant='h5' >
Results Are Sorted Alphabetically
</RightBoxSubHeaderTypography>

<CardDisplayGrid
cardJsonResults={jsonResults}
numResultsDisplayed={numResultsDisplayed}
numItemsToLoadWhenNeeded={numItemsToLoadWhenNeeded}
loadMoreCallback={loadMore}
isLoadMoreOptionVisible={isLoadMoreVisible}
numResults={numResults}
isDataLoaded={isCardBrowseDataLoaded}
/>
</div>
}>
</Section>
}
/>
</MainContentContainer>
Expand Down
8 changes: 4 additions & 4 deletions src/components/banlist/BanListDates.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Button, Grid, Accordion, AccordionSummary, AccordionDetails, Typography

import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
import DateRangeRoundedIcon from '@material-ui/icons/DateRangeRounded'
import {LeftBoxSectionHeaderTypography} from '../util/grid/OneThirdTwoThirdsGrid'

import { getDateString } from '../../helper/Dates'

Expand Down Expand Up @@ -71,10 +70,11 @@ export const BanListDates = memo( ( { banListStartDates, setSelectedBanList } )

return(
<div >
<LeftBoxSectionHeaderTypography
variant='h6' >
<Typography
style={{color: 'white'}}
variant='h4' >
Date Range
</LeftBoxSectionHeaderTypography>
</Typography>
<DatesAccordion elevation={0} >
<BanDatesExpansionSummary
expandIcon={<ExpandMoreIcon />} >
Expand Down
10 changes: 5 additions & 5 deletions src/components/banlist/BanListStats.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React, { memo, useState, useEffect, useCallback } from 'react'
import Styled from 'styled-components'

import { List, ListItemText, Collapse, ListItem } from '@material-ui/core'
import { List, ListItemText, Collapse, ListItem, Typography } from '@material-ui/core'

import ExpandLess from '@material-ui/icons/ExpandLess';
import ExpandMore from '@material-ui/icons/ExpandMore';
import {LeftBoxSectionHeaderTypography} from '../util/grid/OneThirdTwoThirdsGrid'


const ListStatItem = Styled(ListItem)`
Expand Down Expand Up @@ -167,10 +166,11 @@ const BanListStats = memo( ( { totalCardsInSelectedList, selectedBanList

return(
<div >
<LeftBoxSectionHeaderTypography
variant='h6' >
<Typography
style={{color: 'white'}}
variant='h4' >
Summary
</LeftBoxSectionHeaderTypography>
</Typography>

<StatList style={{ width: '100%', maxWidth: '400px' }}
component="nav"
Expand Down
20 changes: 18 additions & 2 deletions src/components/card/YGOCard.js → src/components/card/YGOCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {memo} from 'react'
import { FC, memo } from 'react'

import { Typography, Paper } from '@material-ui/core'
import { Skeleton } from '@material-ui/lab'
Expand All @@ -21,8 +21,24 @@ const CardContentComponent = Styled(Paper)`
}
`

type YGOCardType = {
cardName: string,
cardColor: string,
cardEffect: string,
monsterType: string,
cardAttribute?: string,
monsterAtk?: string,
monsterDef?: string,
monsterAssociation?: string,
cardID: string,
fullDetails: boolean,
effectMaxLineHeight?: number,
isLoading?: boolean,
className?: string
}

const YGOCard = memo(( {cardName, cardColor, cardEffect, monsterType, cardAttribute, monsterAtk, monsterDef, monsterAssociation, cardID, fullDetails, effectMaxLineHeight, isLoading, className }) =>

const YGOCard:FC<YGOCardType> = memo(( {cardName, cardColor, cardEffect, monsterType, cardAttribute, monsterAtk, monsterDef, monsterAssociation, cardID, fullDetails, effectMaxLineHeight, isLoading, className }) =>
{
if (isLoading)
{
Expand Down
Loading

0 comments on commit ae36c04

Please sign in to comment.