-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/fix-menu-mobile' into fix-menu-m…
…obile
- Loading branch information
Showing
12 changed files
with
126 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
**/generated/* | ||
**/generated/* | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@import '../../resources/variables'; | ||
|
||
.gaps-percentage-displayed { | ||
font-weight: bold; | ||
width: 200px; | ||
&-great-result { | ||
color: $great-result; | ||
} | ||
&-decent-result { | ||
color: $decent-result; | ||
} | ||
&-terrible-result { | ||
color: $terrible-result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React from 'react' | ||
|
||
import { TEXTS } from '../../resources/texts' | ||
import './DisplayGapsPercentage.scss' | ||
import { Row } from './Row' | ||
|
||
function getStatus(percentage: number, decentPercentage: number, terriblePercentage: number) { | ||
const moreThanOneHundredPercent = 101 | ||
const statuses = [ | ||
{ | ||
min: -Infinity, | ||
status: 'invalid', | ||
}, | ||
{ | ||
min: 0, | ||
status: 'great', | ||
}, | ||
{ | ||
min: decentPercentage, | ||
status: 'decent', | ||
}, | ||
{ | ||
min: terriblePercentage, | ||
status: 'terrible', | ||
}, | ||
{ | ||
min: moreThanOneHundredPercent, | ||
status: 'invalid', | ||
}, | ||
] | ||
return statuses.findLast((status: { min: number; status: string }) => status.min <= percentage) | ||
?.status | ||
} | ||
|
||
function DisplayGapsPercentage({ | ||
gapsPercentage, | ||
decentPercentage, | ||
terriblePercentage, | ||
}: { | ||
gapsPercentage: number | undefined | ||
decentPercentage: number | ||
terriblePercentage: number | ||
}) { | ||
if (!gapsPercentage && gapsPercentage != 0) return <></> | ||
const status = getStatus(gapsPercentage, decentPercentage, terriblePercentage) | ||
const stylesClass = `gaps-percentage-displayed-${status}-result` | ||
const text = | ||
status === 'great' | ||
? TEXTS.all_rides_completed | ||
: `${Math.floor(gapsPercentage)}% ${TEXTS.missing_rides}` | ||
|
||
return ( | ||
<Row> | ||
<div className={stylesClass}>{text}</div> | ||
</Row> | ||
) | ||
} | ||
export default DisplayGapsPercentage |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters