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 3 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
32 changes: 14 additions & 18 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 Down Expand Up @@ -70,23 +70,19 @@ const App = () => {

return (
<>
<AppHeader navCallback={setCurrentView} currentView={currentView} />
<Container fluid>
<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
14 changes: 7 additions & 7 deletions src/components/ShootResultsDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const ShootResultsDisplay: React.FC<Props> = (props: Props) => {

const killChanceTable =
<>
<Table responsive striped bordered hover size="sm" style={{ fontSize: '11px'}}>
<Table responsive striped bordered hover size="sm" style={{ fontSize: '11px' }}>
<thead>
<tr>
<th>W</th>
Expand Down Expand Up @@ -71,7 +71,7 @@ const ShootResultsDisplay: React.FC<Props> = (props: Props) => {

const saveToAvgDmgTable =
<>
<Table bordered={true} striped={true} style={{ fontSize: '11px' }}>
<Table striped bordered hover size="sm" style={{ fontSize: '11px' }}>
<thead>
<tr>
<th>Sv</th>
Expand Down Expand Up @@ -120,7 +120,7 @@ const ShootResultsDisplay: React.FC<Props> = (props: Props) => {
const dmgProbTable =
<>
<span style={{ fontSize: '13px' }}>Dmg probs for exact scenario...</span>
<Table bordered={true} striped={true} style={{ fontSize: '11px' }}>
<Table responsive striped bordered hover style={{ fontSize: '11px' }}>
<thead>
<tr>
<th>Dmg</th>
Expand All @@ -138,18 +138,18 @@ const ShootResultsDisplay: React.FC<Props> = (props: Props) => {
return (
<Container fluid>
<Row>
<Col lg={6} md={12}>
<Col lg={4} md={12} className='p-0'>
<Accordion flush>
<Accordion.Item eventKey='0'>
<Accordion.Header as="h6">AvgDmg for various Sv...</Accordion.Header>
<Accordion.Header as="h6">Average Damage</Accordion.Header>
<Accordion.Body>{saveToAvgDmgTable}</Accordion.Body>
</Accordion.Item>
</Accordion>
</Col>
<Col lg={6} md={12}>
<Col lg={8} md={12} className='p-0'>
<Accordion flush>
<Accordion.Item eventKey='0'>
<Accordion.Header as="h6">KillChances for various Sv&amp;W...</Accordion.Header>
<Accordion.Header as="h6">Kill Chances</Accordion.Header>
<Accordion.Body>{killChanceTable}</Accordion.Body>
</Accordion.Item>
</Accordion>
Expand Down
13 changes: 7 additions & 6 deletions src/components/ShootSection.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import React, { useState } from 'react';
import {
Col,
Container,
Row,
} from 'react-bootstrap';


import ShootOptions from 'src/ShootOptions';
import AttackerControls from "src/components/AttackerControls";
import DefenderControls from "src/components/DefenderControls";
Expand Down Expand Up @@ -50,17 +51,17 @@ const ShootSection: React.FC = () => {
].map(note => <li key={note.name}><b>{note.name}</b>: {note.description}</li>);

return (
<Container fluid>
<Container fluid = "sm">
<h4 style={{textAlign:'center'}}>
Kill Team 2021 Edition, Shooting
<a href='https://www.warhammer-community.com/wp-content/uploads/2022/08/ekD0GG2pTHlYba0G.pdf'>[Lite Rules]</a>
</h4>
<Row>
<Col>
<Row className='justify-content-md-center'>
<Col lg={4} md="auto" className='p-0'>
<h2 style={{textAlign:'center'}}>Situation 1</h2>
<ShootSituation/>
</Col>
<Col>
<Col lg={4} md="auto" className="p-0">
<h2 style={{textAlign:'center'}}>Situation 2</h2>
<ShootSituation/>
</Col>
Expand All @@ -76,7 +77,7 @@ const ShootSection: React.FC = () => {
</ul>
</Col>
</Row>
</Container>
</Container>
);
};

Expand Down