Skip to content

Commit

Permalink
fix(exams): fix checks on canBeRejected and canBeAccepted loot boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
FabrizioCostaMedich committed Jun 17, 2024
1 parent 53a57d7 commit 4bbaa2c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const ProvisionalGradeListItem = ({ grade }: Props) => {
const subtitle = useMemo(() => {
switch (grade.state) {
case ProvisionalGradeStateEnum.Confirmed:
if (!grade.isFailure && !grade.isWithdrawn) {
if (grade.canBeRejected) {
return (
<TextWithLinks style={styles.rejectableSubtitle}>
{t('transcriptGradesScreen.rejectionCountdown', {
Expand Down
20 changes: 10 additions & 10 deletions src/features/transcript/screens/ProvisionalGradeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ export const ProvisionalGradeScreen = ({ navigation, route }: Props) => {
<Row
pb={
grade.state === ProvisionalGradeStateEnum.Confirmed &&
!grade.isFailure &&
!grade.isWithdrawn &&
(grade.canBeAccepted || grade.canBeRejected) &&
rejectionTime
? 0
: 5
Expand Down Expand Up @@ -141,8 +140,7 @@ export const ProvisionalGradeScreen = ({ navigation, route }: Props) => {
</Col>
</Row>
{grade.state === ProvisionalGradeStateEnum.Confirmed &&
!grade.isFailure &&
!grade.isWithdrawn &&
grade.canBeAccepted &&
rejectionTime && (
<Row pl={5} pb={5}>
<Text style={styles.autoRegistration}>
Expand Down Expand Up @@ -174,10 +172,9 @@ export const ProvisionalGradeScreen = ({ navigation, route }: Props) => {
action={() => navigation.navigate('Person', { id: grade?.teacherId })}
/>
)}
{grade?.state === ProvisionalGradeStateEnum.Confirmed &&
!grade.isFailure &&
!grade.isWithdrawn && (
<CtaButtonContainer absolute={true}>
{grade?.state === ProvisionalGradeStateEnum.Confirmed && (
<CtaButtonContainer absolute={true} modal>
{grade?.canBeAccepted && (
<CtaButton
title={t('provisionalGradeScreen.acceptGradeCta')}
action={() =>
Expand All @@ -198,6 +195,8 @@ export const ProvisionalGradeScreen = ({ navigation, route }: Props) => {
}
containerStyle={{ paddingVertical: 0 }}
/>
)}
{grade?.canBeRejected && (
<CtaButton
title={t('provisionalGradeScreen.rejectGradeCta', {
hours: rejectionTime,
Expand All @@ -222,8 +221,9 @@ export const ProvisionalGradeScreen = ({ navigation, route }: Props) => {
containerStyle={{ paddingVertical: 0 }}
destructive
/>
</CtaButtonContainer>
)}
)}
</CtaButtonContainer>
)}
</>
);
};
Expand Down

0 comments on commit 4bbaa2c

Please sign in to comment.