Skip to content

Commit

Permalink
Improve appearance of mission queue
Browse files Browse the repository at this point in the history
  • Loading branch information
mrica-equinor committed Nov 8, 2023
1 parent cc814b8 commit 4af547d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const HorizontalContent = styled.div`
`
const HorizontalNonButtonContent = styled.div`
display: grid;
grid-template-columns: 20px 380px auto auto 180px;
grid-template-columns: 20px 350px auto 100px 180px;
align-items: center;
padding: 4px 0px 4px 10px;
gap: 10px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ const VerticalContent = styled.div`
justify-content: space-between;
`

const StyledPadding = styled.div`
padding: 10px;
border-radius: 3px;
`

export function OngoingMissionCard({ mission }: MissionProps) {
let navigate = useNavigate()
const routeChange = () => {
Expand All @@ -61,15 +66,13 @@ export function OngoingMissionCard({ mission }: MissionProps) {
<StyledMissionCard variant="default" style={{ boxShadow: tokens.elevation.raised }}>
<TopContent>
<StyledTitle variant="default" onClick={routeChange}>
<div style={{ padding: '10px', borderRadius: '3px' }}>
<StyledPadding>
<Typography variant="h6" color="primary">
{mission.name}
</Typography>
</div>
</StyledPadding>
</StyledTitle>
<div>
<MissionControlButtons mission={mission} />
</div>
<MissionControlButtons mission={mission} />
</TopContent>
<BottomContent>
<VerticalContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ const VerticalContent = styled.div<{ $alignItems?: string }>`
gap: 4px;
`

const StyledPadding = styled.div`
padding: 8px;
`

function cardContent({ robot }: RobotProps) {
return (
<div style={{ padding: '8px' }}>
<StyledPadding>
<RobotImage robotType={robot.model.type} height="200px" />
<HorizontalContent>
<VerticalContent $alignItems="start">
Expand All @@ -68,7 +72,7 @@ function cardContent({ robot }: RobotProps) {
/>
</VerticalContent>
</HorizontalContent>
</div>
</StyledPadding>
)
}

Expand All @@ -89,18 +93,16 @@ export function RobotStatusCardPlaceholder() {
const { TranslateText } = useLanguageContext()
return (
<StyledCard style={{ boxShadow: tokens.elevation.raised }}>
<div>
<RobotImage robotType={RobotType.NoneType} />
<Typography variant="h5" color="disabled">
{TranslateText('No robot connected')}
</Typography>
<Typography variant="body_short" color="disabled">
----
</Typography>
<HorizontalContent>
<RobotStatusChip />
</HorizontalContent>
</div>
<RobotImage robotType={RobotType.NoneType} />
<Typography variant="h5" color="disabled">
{TranslateText('No robot connected')}
</Typography>
<Typography variant="body_short" color="disabled">
----
</Typography>
<HorizontalContent>
<RobotStatusChip />
</HorizontalContent>
</StyledCard>
)
}
11 changes: 9 additions & 2 deletions frontend/src/components/Pages/RobotPage/RobotArmMovement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { BackendAPICaller } from 'api/ApiCaller'
import { Robot } from 'models/Robot'
import { useLanguageContext } from 'components/Contexts/LanguageContext'
import { tokens } from '@equinor/eds-tokens'
import styled from 'styled-components'

interface RobotProps {
robot: Robot
Expand All @@ -12,6 +13,12 @@ interface RobotProps {
}
const feedbackTimer = 10000 // Clear feedback after 10 seconds

const StyledButton = styled.div`
display: flex;
justifycontent: center;
margintop: auto;
`

export function MoveRobotArm({ robot, armPosition, isRobotAvailable }: RobotProps) {
const { TranslateText } = useLanguageContext()
const [feedback, setFeedback] = useState('')
Expand Down Expand Up @@ -71,9 +78,9 @@ export function MoveRobotArm({ robot, armPosition, isRobotAvailable }: RobotProp
'This button is disabled because the robot is not available. Check that the robot is on, and are not doing any other activities.'
)}
</Typography>
<div style={{ display: 'flex', justifyContent: 'center', marginTop: 'auto' }}>
<StyledButton>
<Button onClick={closePopover}>{TranslateText('Close')}</Button>
</div>
</StyledButton>
</Popover.Content>
</Popover>
<Button style={moveArmButtonStyle()} onClick={!usable ? openPopover : onClickMoveArm} ref={anchorRef}>
Expand Down

0 comments on commit 4af547d

Please sign in to comment.