-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test PR * move the Reset Code Button logic into IDEEditor * fix: updated ui * removing unused components * removed resetCode that is unused * remove editorActions * fix IDEConsole snapshot * fixing snapshots * fixing snapshots IDEEditor * fixing IDEEditor snapshot * isCodeOnServerDifferent is false * fix: all snapshots are updated * updated text to not have titled cases * lower case * move clear console button to its own toolbar * add props validation for ClearConsoleBar * update prop name * adjust editor height to fix zoom in/out problem * update snapshots * remove the alert as it will be replaced with a real function * another snapshow update with removing pause onClick * update background color for ClearConsoleBar * fix comments for review * update snapshot * add test & update snapshots * align closing tag --------- Co-authored-by: Chi-En Wei <chi-en.wei@ocado.com>
- Loading branch information
1 parent
0179ad7
commit 536e78e
Showing
22 changed files
with
227 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
game_frontend/src/components/ClearConsoleBar/__snapshots__/index.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<ClearConsoleBar /> renders correctly 1`] = ` | ||
<Styled(WithStyles(ForwardRef(Toolbar))) | ||
variant="dense" | ||
> | ||
<styled.div> | ||
<Styled(WithStyles(ForwardRef(Button))) | ||
startIcon={<ClearIcon />} | ||
> | ||
Clear console | ||
</Styled(WithStyles(ForwardRef(Button)))> | ||
</styled.div> | ||
</Styled(WithStyles(ForwardRef(Toolbar)))> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Button, Toolbar } from '@material-ui/core'; | ||
import ClearIcon from 'components/icons/Clear'; | ||
import React from 'react'; | ||
import styled from 'styled-components' | ||
import PropTypes from 'prop-types' | ||
|
||
export const StyledClearConsoleBar = styled(Toolbar)` | ||
background: #2f3129; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-end; | ||
` | ||
|
||
export const StyledConsoleTitle = styled.div` | ||
display: inline-flex; | ||
` | ||
|
||
export const ClearButton = styled(Button)` | ||
right: 0vw; | ||
` | ||
|
||
const ClearConsoleBar = (props) => { | ||
return ( | ||
<StyledClearConsoleBar variant="dense"> | ||
<StyledConsoleTitle> | ||
<ClearButton | ||
onClick={props.clearConsoleClicked} | ||
startIcon={<ClearIcon />} | ||
> | ||
Clear console | ||
</ClearButton> | ||
</StyledConsoleTitle> | ||
</StyledClearConsoleBar> | ||
) | ||
} | ||
|
||
ClearConsoleBar.propTypes = { | ||
clearConsoleClicked: PropTypes.func, | ||
} | ||
|
||
export default ClearConsoleBar; |
12 changes: 12 additions & 0 deletions
12
game_frontend/src/components/ClearConsoleBar/index.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* eslint-env jest */ | ||
import React from 'react' | ||
import ClearConsoleBar from 'components/ClearConsoleBar' | ||
import createShallowWithTheme from 'testHelpers/createShallow' | ||
|
||
describe('<ClearConsoleBar />', () => { | ||
it('renders correctly', () => { | ||
const tree = createShallowWithTheme(<ClearConsoleBar />) | ||
|
||
expect(tree).toMatchSnapshot() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import React, { Component } from 'react' | ||
import React from 'react' | ||
import IDEEditor from 'containers/IDEEditor' | ||
import IDEConsole from 'containers/IDEConsole' | ||
import { darkTheme } from 'theme' | ||
import { MuiThemeProvider } from '@material-ui/core/styles' | ||
import { ThemeProvider as StyledComponentsThemeProvider } from 'styled-components' | ||
|
||
export default class IDE extends Component { | ||
render() { | ||
return ( | ||
<StyledComponentsThemeProvider theme={darkTheme}> | ||
<MuiThemeProvider theme={darkTheme}> | ||
<IDEEditor /> | ||
<IDEConsole /> | ||
</MuiThemeProvider> | ||
</StyledComponentsThemeProvider> | ||
) | ||
} | ||
const IDE = () => { | ||
return ( | ||
<StyledComponentsThemeProvider theme={darkTheme}> | ||
<MuiThemeProvider theme={darkTheme}> | ||
<IDEEditor /> | ||
<IDEConsole /> | ||
</MuiThemeProvider> | ||
</StyledComponentsThemeProvider> | ||
) | ||
} | ||
|
||
export default IDE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.