Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add menu button and pages #1722

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Create general style for all pages
betaniat committed Aug 16, 2024
commit 4e4addfae61ace3d5b68d40e2bae69f93cf74c47
2 changes: 1 addition & 1 deletion frontend/src/components/Header/NavigationMenu.tsx
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ export const NavigationMenu = () => {
aria-controls="menu"
onClick={() => (isOpen ? closeMenu() : openMenu())}
>
<Icon name={Icons.Menu}></Icon>
<Icon name={Icons.Menu} />
{TranslateText('Menu')}
</StyledButton>
<Menu open={isOpen} id="menu" aria-labelledby="menu" onClose={closeMenu} anchorEl={anchorEl}>
7 changes: 2 additions & 5 deletions frontend/src/components/Pages/FrontPage/FrontPage.tsx
Original file line number Diff line number Diff line change
@@ -5,15 +5,12 @@ import { Header } from 'components/Header/Header'
import styled from 'styled-components'
import { InspectionOverviewSection } from 'components/Pages/InspectionPage/InspectionOverview'
import { StopRobotDialog } from './MissionOverview/StopDialogs'
import { tokens } from '@equinor/eds-tokens'
import { StyledPage } from 'components/Styles/StyledComponents'

const StyledFrontPage = styled.div`
const StyledFrontPage = styled(StyledPage)`
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
gap: 3rem;
padding: 15px 15px;
background-color: ${tokens.colors.ui.background__light.hex};
min-height: calc(100vh - 65px);
`

const HorizontalContent = styled.div`
15 changes: 3 additions & 12 deletions frontend/src/components/Pages/FrontPage/MissionControlPage.tsx
Original file line number Diff line number Diff line change
@@ -3,16 +3,7 @@ import { OngoingMissionView } from 'components/Pages/FrontPage/MissionOverview/O
import { Header } from 'components/Header/Header'
import styled from 'styled-components'
import { StopRobotDialog } from './MissionOverview/StopDialogs'
import { tokens } from '@equinor/eds-tokens'

const StyledFrontPage = styled.div`
display: flex;
flex-direction: column;
gap: 1rem;
padding: 15px 15px;
background-color: ${tokens.colors.ui.background__light.hex};
min-height: calc(100vh - 65px);
`
import { StyledPage } from 'components/Styles/StyledComponents'

const HorizontalContent = styled.div`
display: flex;
@@ -32,15 +23,15 @@ export const MissionControlPage = () => {
return (
<>
<Header page={'missionControlPage'} />
<StyledFrontPage>
<StyledPage>
<StopRobotDialog />
<HorizontalContent>
<MissionsContent>
<OngoingMissionView />
<MissionQueueView />
</MissionsContent>
</HorizontalContent>
</StyledFrontPage>
</StyledPage>
</>
)
}
16 changes: 3 additions & 13 deletions frontend/src/components/Pages/InspectionPage/InspectionPage.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
import { Header } from 'components/Header/Header'
import styled from 'styled-components'
import { InspectionOverviewSection } from 'components/Pages/InspectionPage/InspectionOverview'
import { tokens } from '@equinor/eds-tokens'

const StyledFrontPage = styled.div`
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
gap: 3rem;
padding: 15px 15px;
background-color: ${tokens.colors.ui.background__light.hex};
min-height: calc(100vh - 65px);
`
import { StyledPage } from 'components/Styles/StyledComponents'

export const InspectionPage = () => {
return (
<>
<Header page={'inspectionPage'} />
<StyledFrontPage>
<StyledPage>
<InspectionOverviewSection />
</StyledFrontPage>
</StyledPage>
</>
)
}
Original file line number Diff line number Diff line change
@@ -2,26 +2,20 @@ import { MissionHistoryView } from './MissionHistoryView'
import { BackButton } from 'utils/BackButton'
import { Header } from 'components/Header/Header'
import { StyledPage } from 'components/Styles/StyledComponents'
import { styled } from 'styled-components'
import { tokens } from '@equinor/eds-tokens'

export type RefreshProps = {
refreshInterval: number
}

const StyledMissionHistoryPage = styled(StyledPage)`
background-color: ${tokens.colors.ui.background__light.hex};
`
export const MissionHistoryPage = () => {
const refreshInterval = 1000

return (
<>
<Header page={'history'} />
<StyledMissionHistoryPage>
<StyledPage>
<BackButton />
<MissionHistoryView refreshInterval={refreshInterval} />
</StyledMissionHistoryPage>
</StyledPage>
</>
)
}
11 changes: 4 additions & 7 deletions frontend/src/components/Pages/RobotPage/RobotsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
import { RobotStatusSection } from 'components/Pages/FrontPage/RobotCards/RobotStatusSection'
import { Header } from 'components/Header/Header'
import styled from 'styled-components'
import { tokens } from '@equinor/eds-tokens'
import { StyledPage } from 'components/Styles/StyledComponents'

const StyledFrontPage = styled.div`
const StyledRobotsPage = styled(StyledPage)`
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
gap: 3rem;
padding: 15px 15px;
background-color: ${tokens.colors.ui.background__light.hex};
min-height: calc(100vh - 65px);
`

export const RobotsPage = () => {
return (
<>
<Header page={'robotsPage'} />
<StyledFrontPage>
<StyledRobotsPage>
<RobotStatusSection />
</StyledFrontPage>
</StyledRobotsPage>
</>
)
}
4 changes: 2 additions & 2 deletions frontend/src/components/Styles/StyledComponents.tsx
Original file line number Diff line number Diff line change
@@ -28,13 +28,13 @@ export const TextAlignedButton = styled(Button)`
`
export const StyledPage = styled.div`
display: flex;
flex-wrap: wrap;
justify-content: start;
flex-direction: column;
gap: 1rem;
padding: 2rem;
padding: 15px 15px;
@media (max-width: 600px) {
padding: 0.7rem;
}
min-height: calc(100vh - 65px);
background-color: ${tokens.colors.ui.background__light.hex};
`