Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactive UI changes #9

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4067362
working on accordions and flexing correctly
d-espinozahernandez Feb 17, 2024
ba905c1
reactive changes
d-espinozahernandez Feb 20, 2024
c38a3b0
missed some old formatting
d-espinozahernandez Feb 20, 2024
5d4e614
remove unused import
d-espinozahernandez Feb 20, 2024
e93a1c2
remove unused imports
d-espinozahernandez Feb 20, 2024
69c8c9b
test deploy
daespinozah Feb 20, 2024
c8679a9
rollback
daespinozah Feb 20, 2024
851a3fe
test deploy
daespinozah Feb 20, 2024
36b3ffe
Update package.json
daespinozah Feb 20, 2024
7a30180
name
daespinozah Feb 20, 2024
a4ee30b
Merge branch 'testDeploy' of https://github.com/daespinozah/KT21Calcu…
daespinozah Feb 20, 2024
f14d98d
adjustment to screen sizes
daespinozah Feb 20, 2024
2372403
Merge branch 'DanielEspinoza-testing' of https://github.com/daespinoz…
daespinozah Feb 20, 2024
c618c49
table size
daespinozah Feb 20, 2024
e2216d6
table size
daespinozah Feb 20, 2024
76d3ed5
reduce size, add row highlight to all tables
daespinozah Feb 25, 2024
046d874
Merge branch 'DanielEspinoza-testing' into testDeploy
daespinozah Feb 25, 2024
2c0046a
carousel implemented
daespinozah Feb 25, 2024
806c6cb
Merge branch 'DanielEspinoza-testing' into testDeploy
daespinozah Feb 25, 2024
671a5e1
carousel working for mobile devices
daespinozah Feb 25, 2024
8855e61
fixed inner screen issue
daespinozah Feb 25, 2024
4375be3
Carousel
daespinozah Feb 25, 2024
3fb17e8
screen size
daespinozah Feb 25, 2024
e47403d
still messing with sizes.
daespinozah Feb 25, 2024
b492248
Merge branch 'testDeploy' into DanielEspinoza-testing
daespinozah Feb 25, 2024
3fbbfee
missed a couple
daespinozah Feb 25, 2024
967c84a
fixing package lock
daespinozah Feb 25, 2024
83fdaa8
errant comments
daespinozah Feb 25, 2024
764bc84
changed to ReactSwipeable component
daespinozah Mar 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 150 additions & 1 deletion 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
Expand Up @@ -12,7 +12,8 @@
"react-dom": "^17.0.2",
"react-error-boundary": "^4.0.12",
"react-router-dom": "^6.3.0",
"react-scripts": "^5.0.0"
"react-scripts": "^5.0.0",
"react-swipeable-views": "^0.14.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down Expand Up @@ -61,6 +62,7 @@
"@types/node": "^20.10.5",
"@types/react": "17.0.3",
"@types/react-dom": "17.0.3",
"@types/react-swipeable-views": "^0.13.5",
"eslint-plugin-react-hooks": "^4.3.0",
"typescript": "^4.9.5"
}
Expand Down
35 changes: 16 additions & 19 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react';
import { Col, Container, Row } from 'react-bootstrap';
import { Col, Container, Row, Stack } from 'react-bootstrap';
import { useSearchParams } from 'react-router-dom';
import { ErrorBoundary } from 'react-error-boundary';

Expand All @@ -12,6 +12,7 @@ import ShootMassAnalysisSection from 'src/components/ShootMassAnalysisSection';
import WorldOfTanksSection from 'src/components/WorldOfTanks/WorldOfTanksSection';
import { DeadzoneSection } from 'src/components/Deadzone/DeadzoneSection';


const _viewToAdditionalTexts: Map<CalculatorViewChoice, string[]> = new Map([
[CalculatorViewChoice.KtShoot, ['shoot']],
[CalculatorViewChoice.KtFight, ['fight']],
Expand Down Expand Up @@ -60,7 +61,7 @@ const App = () => {
) : JSX.Element {
return (
<ErrorBoundary fallbackRender={fallbackRender}>
<div style={{ display: currentView === view ? 'block' : 'none' }}>
<div style={{ display: currentView === view ? 'block' : 'none'}}>
{child}
</div>
</ErrorBoundary>
Expand All @@ -69,23 +70,19 @@ const App = () => {

return (
<>
<AppHeader navCallback={setCurrentView} currentView={currentView} />
<Container>
<Row>
<Col className={Util.centerHoriz + ' p-0'} style={{fontSize: '11px'}}>
Starred (*) items have explanations in hovertext and 'Notes' at bottom.
</Col>
</Row>
<Row>
<Col>
{sectionDiv(CalculatorViewChoice.KtShoot, <ShootSection/>)}
{sectionDiv(CalculatorViewChoice.KtFight, <FightSection/>)}
{sectionDiv(CalculatorViewChoice.KtShootMassAnalysis, <ShootMassAnalysisSection/>)}
{sectionDiv(CalculatorViewChoice.WorldOfTanks, <WorldOfTanksSection/>)}
{sectionDiv(CalculatorViewChoice.Deadzone, <DeadzoneSection/>)}
</Col>
</Row>
</Container>
<Stack>
<AppHeader navCallback={setCurrentView} currentView={currentView} />
<div className={Util.centerHoriz + ' p-0'} style={{fontSize: '11px'}}>
Starred (*) items have explanations in hovertext and 'Notes' at bottom.
</div>
<div>
{sectionDiv(CalculatorViewChoice.KtShoot, <ShootSection/>)}
{sectionDiv(CalculatorViewChoice.KtFight, <FightSection/>)}
{sectionDiv(CalculatorViewChoice.KtShootMassAnalysis, <ShootMassAnalysisSection/>)}
{sectionDiv(CalculatorViewChoice.WorldOfTanks, <WorldOfTanksSection/>)}
{sectionDiv(CalculatorViewChoice.Deadzone, <DeadzoneSection/>)}
</div>
</Stack>
</>
);
};
Expand Down
6 changes: 1 addition & 5 deletions src/components/AttackerControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,17 @@ const AttackerControls: React.FC<Props> = (props: Props) => {
const elemsCol1 = propsToRows(paramsCol1);

return (
<Container style={{width: '310px'}}>
<Container>
<Row>
<Col>Attacker</Col>
<Col>{advancedCheckbox}</Col>
</Row>
<Row>
<Col>
<Container className='p-0'>
{elemsCol0}
</Container>
</Col>
<Col>
<Container className='p-0'>
{elemsCol1}
</Container>
</Col>
</Row>
</Container>
Expand Down
6 changes: 2 additions & 4 deletions src/components/DefenderControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,14 @@ const DefenderControls: React.FC<Props> = (props: Props) => {
const elemsCol0 = propsToRows(paramsToShow);
return (
// it would be nice to make this something other than a fixed width
<Container style={{width: '130px'}}>
<Container>
<Row>
<Col>Defender</Col>
<Col>{advancedCheckbox}</Col>
</Row>
<Row>
<Col>
<Container className='p-0' style={{width: 'fit-content'}}>
{elemsCol0}
</Container>
{elemsCol0}
</Col>
</Row>
</Container>
Expand Down
4 changes: 2 additions & 2 deletions src/components/IncDecSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ const IncDecSelect: React.FC<IProps> = (props: IProps) => {
}

export function propsToRow(props: Props): JSX.Element {
return <Row key={props.id}><Col className='pr-0'><IncDecSelect {...props}/></Col></Row>;
return <Row key={props.id}><Col><IncDecSelect {...props}/></Col></Row>;
}

export function propsToRows(props: Props[]): JSX.Element[] {
return props.map(p => <Row key={p.id}><Col className='pr-0'><IncDecSelect {...p}/></Col></Row>);
return props.map(p => <Row key={p.id}><Col><IncDecSelect {...p}/></Col></Row>);
}

export default IncDecSelect;
6 changes: 3 additions & 3 deletions src/components/ShootOptionControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ const ShootOptionControls: React.FC<Props> = (props: Props) => {
<Row key={p.id}><Col className='pr-0'><IncDecSelect {...p}/></Col></Row>);

return (
<Container style={{width: '310px'}}>
<Row>General</Row>
<Container>
<Row className='justify-content-center'>General</Row>
<Row>
<Col>
<Container className='p-0'>
<Container>
{paramElems.slice(0, paramElems.length / 2)}
</Container>
</Col>
Expand Down
Loading