Skip to content

Commit

Permalink
Change arm movement buttons based on figma model
Browse files Browse the repository at this point in the history
  • Loading branch information
prasm313 committed Apr 10, 2024
1 parent abf7bbf commit f194cf6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
4 changes: 3 additions & 1 deletion frontend/src/components/Pages/RobotPage/RobotArmMovement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const LimitWidthStyle = styled.div`

const StyledTextButton = styled(StyledButton)`
text-align: left;
padding: 8px;
width: 8rem;
`

export const MoveRobotArm = ({ robot, armPosition, isRobotAvailable }: RobotProps) => {
Expand Down Expand Up @@ -89,7 +91,7 @@ export const MoveRobotArm = ({ robot, armPosition, isRobotAvailable }: RobotProp
onClick={!usable ? openPopover : onClickMoveArm}
ref={anchorRef}
>
{TranslateText('Set robot arm to ') + '"' + TranslateText(armPosition) + '"'}
{TranslateText(armPosition)}
</StyledTextButton>
<StyledDialog open={feedback !== ''}>
{feedback}
Expand Down
11 changes: 7 additions & 4 deletions frontend/src/components/Pages/RobotPage/RobotPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const StyledRobotPage = styled.div`
gap: 1rem;
margin: 2rem;
`
const StyledButtons = styled.div`
const RobotArmMovementSection = styled.div`
display: flex;
flex-direction: row;
gap: 1rem;
Expand All @@ -32,6 +32,9 @@ const RobotInfo = styled.div`
align-items: start;
gap: 1rem;
width: calc(80vw);
@media (max-width: 800px) {
flex-direction: column;
}
`
const VerticalContent = styled.div<{ $alignItems?: string }>`
display: flex;
Expand Down Expand Up @@ -100,8 +103,8 @@ export const RobotPage = () => {

{selectedRobot.model.type === RobotType.TaurobInspector && (
<>
<Typography variant="h2">{TranslateText('Move robot arm')}</Typography>
<StyledButtons>
<Typography variant="h4">{TranslateText('Set robot arm to ')}</Typography>
<RobotArmMovementSection>
<MoveRobotArm
robot={selectedRobot}
armPosition="battery_change"
Expand All @@ -117,7 +120,7 @@ export const RobotPage = () => {
armPosition="lookout"
isRobotAvailable={selectedRobot.status === RobotStatus.Available}
/>
</StyledButtons>
</RobotArmMovementSection>
</>
)}
</>
Expand Down
7 changes: 3 additions & 4 deletions frontend/src/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
"Moving arm to ": "Moving arm to ",
" Error message: ": " Error message: ",
"Error moving robot arm to ": "Error moving robot arm to ",
"Move robot arm": "Move robot arm",
"Click on the map to move the localization position": "Click on the map to move the localization position",
"Select direction": "Select direction",
"North": "North",
Expand Down Expand Up @@ -156,9 +155,9 @@
"Days between inspections": "Days between inspections",
"Confirm installation": "Confirm installation",
"N": "N",
"battery_change": "battery change",
"lookout": "lookout",
"transport": "transport",
"battery_change": "Battery change",
"lookout": "Lookout",
"transport": "Transport",
"Queue the missions": "Queue the missions",
"Deck Overview": "Deck Overview",
"Predefined Missions": "Predefined Missions",
Expand Down
7 changes: 3 additions & 4 deletions frontend/src/language/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
"Moving arm to ": "Flytter armen til ",
" Error message: ": " Feilmelding: ",
"Error moving robot arm to ": "Feil med å flytte robotarm til ",
"Move robot arm": "Flytt robotarm",
"Click on the map to move the localization position": "Klikk på kartet for å flytte lokaliseringspunktet",
"Select direction": "Velg retning",
"North": "Nord",
Expand Down Expand Up @@ -156,9 +155,9 @@
"Days between inspections": "Dager mellom inspeksjoner",
"Confirm installation": "Bekreft anlegg",
"N": "N",
"battery_change": "batteribytte",
"lookout": "utkikk",
"transport": "transport",
"battery_change": "Batteribytte",
"lookout": "Hevet posisjon",
"transport": "Transport",
"Queue the missions": "Legg oppdragene i kø",
"Deck Overview": "Dekkoversikt",
"Predefined Missions": "Forhåndsdefinerte oppdrag",
Expand Down

0 comments on commit f194cf6

Please sign in to comment.