Skip to content

Commit

Permalink
Merge pull request #55 from misieur/main
Browse files Browse the repository at this point in the history
feat(Account): add 'incidents' in behavior types
  • Loading branch information
Truiteseche authored Nov 16, 2024
2 parents 460db38 + ce076eb commit 5fda841
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,8 @@ export default function App({ edpFetch }) {
const sortedSchoolLife = {
delays: [],
absences: [],
sanctions: []
sanctions: [],
incidents: []
};
schoolLife[activeAccount]?.absencesRetards.concat(schoolLife[activeAccount].sanctionsEncouragements ?? []).forEach((item) => {
const newItem = {};
Expand All @@ -1347,6 +1348,9 @@ export default function App({ edpFetch }) {
case "Punition":
sortedSchoolLife.sanctions.push(newItem);
break;
case "Incident":
sortedSchoolLife.incidents.push(newItem);
break;

default:
break;
Expand Down
14 changes: 12 additions & 2 deletions src/components/app/Account/Account.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ body:has(#account) {
animation: loading-point 6s ease-in-out calc(0.4s * var(--index)) infinite;
}

@media only screen and (max-width: 450px) {
#account .behavior-types {
display: grid;
grid-template-columns: 1fr 1fr;
row-gap: 20px;
}
#account .behavior-type {
border: none !important;
}
}
@media only screen and (max-width: 869px) {
#account {
height: auto;
Expand All @@ -170,11 +180,11 @@ body:has(#account) {
transform: translateY(0);
}

5.5% {
4.16% {
transform: translateY(-5px);
}

11% {
8.33% {
transform: translateY(0);
}
}
Expand Down
12 changes: 8 additions & 4 deletions src/components/app/Account/Account.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,18 +303,22 @@ export default function Account({ schoolLife, fetchSchoolLife, fetchAdministrati
<div className="behavior-types">
<div className="behavior-type">
<span>Retards</span>
<span className={"count" + (!userData.get("sortedSchoolLife")?.delays.length ? " loading" : " loading")}>{userData.get("sortedSchoolLife")?.delays.length ?? <><span style={{ "--index": 0 }}>.</span><span style={{ "--index": 1 }}>.</span><span style={{ "--index": 2 }}>.</span></>}</span>
<span className={"count" + (!userData.get("sortedSchoolLife")?.delays.length ? " loading" : "")}>{userData.get("sortedSchoolLife")?.delays.length ?? <><span style={{ "--index": 0 }}>.</span><span style={{ "--index": 1 }}>.</span><span style={{ "--index": 2 }}>.</span></>}</span>
</div>
<div className="behavior-type">
<span>Absences</span>
<span className={"count" + (!userData.get("sortedSchoolLife")?.absences.length ? " loading" : " loading")}>{userData.get("sortedSchoolLife")?.absences.length ?? <><span style={{ "--index": 3 }}>.</span><span style={{ "--index": 4 }}>.</span><span style={{ "--index": 5 }}>.</span></>}</span>
<span className={"count" + (!userData.get("sortedSchoolLife")?.absences.length ? " loading" : "")}>{userData.get("sortedSchoolLife")?.absences.length ?? <><span style={{ "--index": 3 }}>.</span><span style={{ "--index": 4 }}>.</span><span style={{ "--index": 5 }}>.</span></>}</span>
</div>
<div className="behavior-type">
<span>Sanctions</span>
<span className={"count" + (!userData.get("sortedSchoolLife")?.sanctions.length ? " loading" : " loading")}>{userData.get("sortedSchoolLife")?.sanctions.length ?? <><span style={{ "--index": 6 }}>.</span><span style={{ "--index": 7 }}>.</span><span style={{ "--index": 8 }}>.</span></>}</span>
<span className={"count" + (!userData.get("sortedSchoolLife")?.sanctions.length ? " loading" : "")}>{userData.get("sortedSchoolLife")?.sanctions.length ?? <><span style={{ "--index": 6 }}>.</span><span style={{ "--index": 7 }}>.</span><span style={{ "--index": 8 }}>.</span></>}</span>
</div>
<div className="behavior-type">
<span>Incidents</span>
<span className={"count" + (!userData.get("sortedSchoolLife")?.incidents.length ? " loading" : "")}>{userData.get("sortedSchoolLife")?.incidents.length ?? <><span style={{ "--index": 9 }}>.</span><span style={{ "--index": 10 }}>.</span><span style={{ "--index": 11 }}>.</span></>}</span>
</div>
</div>
</section>
</div>
)
}
}

0 comments on commit 5fda841

Please sign in to comment.