Skip to content

Commit

Permalink
Remove previous frontpage and clean up dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
MortFred committed Jun 22, 2022
1 parent fda467c commit 1262ea2
Show file tree
Hide file tree
Showing 18 changed files with 31 additions and 432 deletions.
1 change: 0 additions & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import './app.css'
import { AuthenticatedTemplate, UnauthenticatedTemplate } from '@azure/msal-react'
import { SignInPage } from './components/SignInPage/SignInPage'
import { FlotillaSite } from 'components/FrontPage/FlotillaSite'
Expand Down
25 changes: 0 additions & 25 deletions frontend/src/app.css

This file was deleted.

2 changes: 0 additions & 2 deletions frontend/src/components/FrontPage/FlotillaSite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { fetchAccessToken } from 'authConfig'
import { createContext, useEffect, useState } from 'react'
import { BrowserRouter, Route, Routes } from 'react-router-dom'
import { FrontPage } from './FrontPage'
import { TestPage } from './TestPage'

export const AccessTokenContext = createContext('')

Expand All @@ -24,7 +23,6 @@ export function FlotillaSite() {
<BrowserRouter>
<Routes>
<Route path="/" element={<FrontPage />} />
<Route path="test" element={<TestPage />} />
</Routes>
</BrowserRouter>
</AccessTokenContext.Provider>
Expand Down
49 changes: 26 additions & 23 deletions frontend/src/components/FrontPage/FrontPage.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
import { Typography, Button } from '@equinor/eds-core-react'
import { RobotOverview } from 'components/RobotOverview'
import { ProfileContent } from 'components/SignInPage/ProfileContent'
import { defaultRobots } from 'models/robot'
import { Button } from '@equinor/eds-core-react'
import { MissionView } from 'components/MissionOverview/MissionView'
import { RobotStatusSection } from 'components/RobotCards/RobotStatusSection'
import { useApi } from 'components/SignInPage/ApiCaller'
import styled from 'styled-components'

const robots = [defaultRobots['taurob'], defaultRobots['exRobotics'], defaultRobots['turtle']]
const StyledFrontPage = styled.div`
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 1rem;
`

export function FrontPage() {
const apiCaller = useApi()
var backendRobots
return (
<>
<ProfileContent />
<div className="test-button">
<Button href="test">To Test Page</Button>
<StyledFrontPage>
<MissionView />
<RobotStatusSection />
<div>
<Button
variant="contained"
onClick={() => {
backendRobots = apiCaller.getRobots()
console.log(backendRobots)
}}
>
Test Backend
</Button>
</div>
<div className="header">
<Typography color="primary" variant="h1" bold>
Flotilla
</Typography>
</div>
<div className="robot-overview">
<RobotOverview robots={robots}></RobotOverview>
</div>
<div className="mission-overview">
<Typography variant="h2" style={{ marginTop: '20px' }}>
Mission Overview
</Typography>
</div>
</>
</StyledFrontPage>
)
}
37 changes: 0 additions & 37 deletions frontend/src/components/FrontPage/TestPage.tsx

This file was deleted.

40 changes: 0 additions & 40 deletions frontend/src/components/InfoButton/InfoButton.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/src/components/MissionOverview/MissionCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Card, Typography } from '@equinor/eds-core-react'
import { Card } from '@equinor/eds-core-react'
import { tokens } from '@equinor/eds-tokens'
import { ScheduledMission } from 'models/scheduledMission'
interface ScheduledMissionProps {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/MissionOverview/MissionView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Card, Typography } from '@equinor/eds-core-react'
import { Button, Typography } from '@equinor/eds-core-react'
import styled from 'styled-components'
import { MissionCard } from './MissionCard'
import { useApi } from 'components/SignInPage/ApiCaller'
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/components/RobotCards/RobotStatusSection.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Typography } from '@equinor/eds-core-react'
import { useApi } from 'components/SignInPage/ApiCaller'
import { defaultRobots, Robot } from 'models/robot'
import { defaultRobots } from 'models/robot'
import styled from 'styled-components'
import { RobotStatusCard } from './RobotStatusCard'
const robots = [defaultRobots['taurob'], defaultRobots['exRobotics'], defaultRobots['turtle']]
Expand All @@ -17,8 +16,6 @@ const RobotView = styled.div`
`

export function RobotStatusSection() {
const apiCaller = useApi()
// var backendRobots = apiCaller.getRobots()
var defaultRobots = robots.map(function (robot, index) {
return <RobotStatusCard key={index} robot={robot} />
})
Expand Down
42 changes: 0 additions & 42 deletions frontend/src/components/RobotOverview/RobotInfoButton.tsx

This file was deleted.

61 changes: 0 additions & 61 deletions frontend/src/components/RobotOverview/RobotOverview.tsx

This file was deleted.

32 changes: 0 additions & 32 deletions frontend/src/components/RobotOverview/RobotOverviewHeader.tsx

This file was deleted.

25 changes: 0 additions & 25 deletions frontend/src/components/RobotOverview/RobotStatusView.tsx

This file was deleted.

1 change: 0 additions & 1 deletion frontend/src/components/RobotOverview/index.ts

This file was deleted.

Loading

0 comments on commit 1262ea2

Please sign in to comment.