Skip to content

Commit 93065ac

Browse files
authored
Merge pull request #1141 from isaacphysics/improvement/further-bootstrap-fixes
Further Bootstrap / React styling fixes
2 parents c1ff45e + 8b84094 commit 93065ac

12 files changed

+28
-18
lines changed

src/app/components/elements/Gameboards.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const CSTable = (props: GameboardsTableProps) => {
9494
</tr>;
9595

9696
return <div className={siteSpecific("", "mb-5 mb-md-6")}>
97-
<Table className="my-gameboard-table" responsive>
97+
<Table className={classNames("my-gameboard-table", {"mb-0" : isPhy})} responsive>
9898
<thead>
9999
{tableHeader}
100100
</thead>
@@ -157,4 +157,4 @@ const Cards = (props: GameboardsCardsProps) => {
157157
};
158158

159159
export const GameboardsCards = Cards;
160-
export const GameboardsTable = siteSpecific(PhyTable, CSTable);
160+
export const GameboardsTable = siteSpecific(PhyTable, CSTable);

src/app/components/elements/cards/BoardCard.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -292,17 +292,16 @@ export const BoardCard = ({user, board, boardView, assignees, toggleAssignModal,
292292
<Card className="board-card card-neat" data-testid={"gameboard-card"}>
293293
<CardBody className="d-flex flex-column pb-4 pt-4">
294294
<button className="close" onClick={confirmDeleteBoard} aria-label="Delete gameboard">×</button>
295-
<Row className="mt-1 mb-2">
295+
<Row className="mt-1 mb-2 justify-content-between">
296296
<Col lg={8} md={8} sm={10} xs={8}>
297297
<CardTitle><Link to={boardLink}>{board.title}</Link></CardTitle>
298298
<CardSubtitle data-testid={"owner"}>By: <strong>{formatBoardOwner(user, board)}</strong></CardSubtitle>
299299
</Col>
300-
{isSetAssignments ? <Col>
300+
{isSetAssignments ? <Col className="d-flex justify-content-center">
301301
<PhyHexagon {...infoShapeProps} percentageDisplayed={board.percentageAttempted ?? 0} />
302302
</Col>
303303
: <>
304-
<Spacer/>
305-
<Col xs={2} className="card-share-link col-auto">
304+
<Col xs={2} className="card-share-link col-auto px-3">
306305
<ShareLink linkUrl={boardLink} gameboardId={board.id} reducedWidthLink clickAwayClose />
307306
</Col>
308307
</>}
@@ -389,14 +388,18 @@ export const BoardCard = ({user, board, boardView, assignees, toggleAssignModal,
389388
<AdaCircle {...infoShapeProps} percentageDisplayed={board.percentageCorrect ?? 0} />
390389
</Col>
391390
</Col> :
392-
<Col xs={4} className="ps-0 d-flex flex-column">
393-
<Row className="d-flex flex-column p-0 align-items-center">
394-
<span>Attempted</span>
395-
<AdaCircle {...infoShapeProps} percentageDisplayed={board.percentageAttempted ?? 0} />
391+
<Col xs={4} className="ps-0 d-flex flex-column justify-content-start">
392+
<Row className="p-0 align-items-center">
393+
<Col className="d-flex flex-column align-items-center">
394+
<span>Attempted</span>
395+
<AdaCircle {...infoShapeProps} percentageDisplayed={board.percentageAttempted ?? 0} />
396+
</Col>
396397
</Row>
397-
<Row className="d-flex flex-column p-0 align-items-center">
398-
<span className="pt-2">Correct</span>
399-
<AdaCircle {...infoShapeProps} percentageDisplayed={board.percentageCorrect ?? 0} />
398+
<Row className="p-0 align-items-center">
399+
<Col className="d-flex flex-column align-items-center">
400+
<span className="pt-2">Correct</span>
401+
<AdaCircle {...infoShapeProps} percentageDisplayed={board.percentageCorrect ?? 0} />
402+
</Col>
400403
</Row>
401404
</Col>
402405
)}

src/app/components/pages/AssignmentSchedule.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
Row, Table
3232
} from "reactstrap";
3333
import {
34+
above,
3435
BoardLimit, determineGameboardStagesAndDifficulties, determineGameboardSubjects, difficultyShortLabelMap,
3536
formatBoardOwner,
3637
getAssignmentStartDate,
@@ -42,7 +43,8 @@ import {
4243
nthHourOf, PATHS,
4344
selectOnChange,
4445
siteSpecific, stageLabelMap, TAG_ID, TAG_LEVEL, tags,
45-
TODAY
46+
TODAY,
47+
useDeviceSize
4648
} from "../../services";
4749
import {AppGroup, AssignmentScheduleContext, BoardOrder, ValidAssignmentWithListingDate} from "../../../IsaacAppTypes";
4850
import {calculateHexagonProportions, Hexagon} from "../elements/svg/Hexagon";
@@ -72,6 +74,7 @@ const AssignmentScheduleStickyHeader = ({user, groups, assignmentsSetByMe, viewB
7274
const headerScrollerFlag = useRef(false);
7375
const headerScrollerObserver = useRef<IntersectionObserver>();
7476
const stickyHeaderListContainer = useRef<HTMLDivElement>(null);
77+
const deviceSize = useDeviceSize();
7578

7679
const headerScrollerCallback = (entries: IntersectionObserverEntry[], observer: IntersectionObserver) => {
7780
for (const entry of entries) {
@@ -140,13 +143,13 @@ const AssignmentScheduleStickyHeader = ({user, groups, assignmentsSetByMe, viewB
140143
{/*</Button>*/}
141144
{assignmentsSetByMe && assignmentsSetByMe.length > 0 && <>
142145
<ButtonGroup className={"w-100 pt-3"}>
143-
<Button size={"md"} className={"border-end-0"} id={"start-date-button"}
146+
<Button size={above["lg"](deviceSize) ? "md" : "sm"} className={"border-end-0 px-1 px-lg-3"} id={"start-date-button"}
144147
color={viewBy === "startDate" ? "secondary" : "primary"}
145148
outline={viewBy !== "startDate"}
146149
onClick={() => setViewBy("startDate")}>
147150
By start date
148151
</Button>
149-
<Button size={"md"} className={"border-start-0"} id={"due-date-button"}
152+
<Button size={above["lg"](deviceSize) ? "md" : "sm"} className={"border-start-0 px-1 px-lg-3"} id={"due-date-button"}
150153
color={viewBy === "dueDate" ? "secondary" : "primary"}
151154
outline={viewBy !== "dueDate"}
152155
onClick={() => setViewBy("dueDate")}>

src/app/components/pages/Groups.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ const GroupEditor = ({group, allGroups, user, createNewGroup, groupNameInputRef}
361361
id="self-removal"
362362
onChange={toggleSelfRemoval}
363363
checked={!!group.selfRemoval}
364+
label={<span>Allow students to remove themselves from this group</span>}
364365
/>
365-
<Label for="self-removal" className="d-inline-block me-2">Allow students to remove themselves from this group</Label>
366366
</div>
367367
</Col>
368368
</Row>

src/scss/cs/boards.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
}
4444

4545
.question-progress-icon {
46-
min-width: 75px !important;
46+
min-width: 86px !important;
4747
display: block;
4848
padding: 14px 0 !important;
4949
position: relative;

src/scss/phy/table.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@
1111
border-bottom-style: none;
1212
}
1313
}
14+
15+
#boards-table .my-gameboard-table-header > th {
16+
border-top: none;
17+
}
Loading

0 commit comments

Comments
 (0)