refined rot selector

This commit is contained in:
Kalle (Sendou)
2020-12-17 10:10:42 +02:00
parent f83b3f99c5
commit c3688a22d7
13 changed files with 37 additions and 1 deletions

View File

@@ -88,15 +88,19 @@ const RotationSelector: React.FC<Props> = ({ rotationId, setRotationId }) => {
isSalmonRun
/>
</Box>
{filteredRotations && (
{filteredRotations && filteredRotations.length > 0 && (
<Box mt={4}>
<FormLabel htmlFor="rotation">
<Trans>Rotation</Trans>
</FormLabel>
<Select
name="rotation"
value="NO_VALUE"
onChange={(e) => setRotationId(parseInt(e.target.value))}
>
<option hidden value="NO_VALUE">
{t`Select rotation`}
</option>
{filteredRotations.map((rotation) => (
<option key={rotation.id} value={rotation.id}>
{new Date(rotation.startTime).toLocaleDateString()} -{" "}
@@ -112,6 +116,14 @@ const RotationSelector: React.FC<Props> = ({ rotationId, setRotationId }) => {
</Select>
</Box>
)}
{filteredRotations && filteredRotations.length === 0 && (
<Box mt={2} color="red.500">
<Trans>
No rotations matching with this criteria. Please choose different
weapons.
</Trans>
</Box>
)}
</>
);

View File

@@ -71,6 +71,8 @@
"Stage": "",
"Weapons": "",
"Rotation": "",
"Select rotation": "",
"No rotations matching with this criteria. Please choose different weapons.": "",
"Stick": "Stick",
"Motion": "Bewegungssteuerung",
"View results": "",

View File

@@ -71,6 +71,8 @@
"Stage": "",
"Weapons": "",
"Rotation": "",
"Select rotation": "",
"No rotations matching with this criteria. Please choose different weapons.": "",
"Stick": "Stick",
"Motion": "Motion",
"View results": "",

View File

@@ -71,6 +71,8 @@
"Stage": "Stage",
"Weapons": "Weapons",
"Rotation": "Rotation",
"Select rotation": "Select rotation",
"No rotations matching with this criteria. Please choose different weapons.": "No rotations matching with this criteria. Please choose different weapons.",
"Stick": "Stick",
"Motion": "Motion",
"View results": "View results",

View File

@@ -71,6 +71,8 @@
"Stage": "",
"Weapons": "",
"Rotation": "",
"Select rotation": "",
"No rotations matching with this criteria. Please choose different weapons.": "",
"Stick": "Stick",
"Motion": "Giroscopio",
"View results": "",

View File

@@ -71,6 +71,8 @@
"Stage": "",
"Weapons": "",
"Rotation": "",
"Select rotation": "",
"No rotations matching with this criteria. Please choose different weapons.": "",
"Stick": "Joysticks",
"Motion": "Gyroscope",
"View results": "",

View File

@@ -71,6 +71,8 @@
"Stage": "",
"Weapons": "",
"Rotation": "",
"Select rotation": "",
"No rotations matching with this criteria. Please choose different weapons.": "",
"Stick": "Stick",
"Motion": "Sensori",
"View results": "",

View File

@@ -71,6 +71,8 @@
"Stage": "",
"Weapons": "",
"Rotation": "",
"Select rotation": "",
"No rotations matching with this criteria. Please choose different weapons.": "",
"Stick": "",
"Motion": "",
"View results": "",

View File

@@ -71,6 +71,8 @@
"Stage": "",
"Weapons": "",
"Rotation": "",
"Select rotation": "",
"No rotations matching with this criteria. Please choose different weapons.": "",
"Stick": "스틱",
"Motion": "모션 / 자이로",
"View results": "",

View File

@@ -71,6 +71,8 @@
"Stage": "",
"Weapons": "",
"Rotation": "",
"Select rotation": "",
"No rotations matching with this criteria. Please choose different weapons.": "",
"Stick": "",
"Motion": "",
"View results": "",

View File

@@ -71,6 +71,8 @@
"Stage": "",
"Weapons": "",
"Rotation": "",
"Select rotation": "",
"No rotations matching with this criteria. Please choose different weapons.": "",
"Stick": "Stick",
"Motion": "Motion",
"View results": "",

View File

@@ -71,6 +71,8 @@
"Stage": "",
"Weapons": "",
"Rotation": "",
"Select rotation": "",
"No rotations matching with this criteria. Please choose different weapons.": "",
"Stick": "",
"Motion": "",
"View results": "",

View File

@@ -71,6 +71,8 @@
"Stage": "",
"Weapons": "",
"Rotation": "",
"Select rotation": "",
"No rotations matching with this criteria. Please choose different weapons.": "",
"Stick": "Stick",
"Motion": "Motion",
"View results": "Se resultat",