-
Notifications
You must be signed in to change notification settings - Fork 49
Conversation
2300433
to
2313aff
Compare
…derer Add basic test for device.tsx
… devices component Linting Remove unused ressource from device.tsx Update snapshot for device
2313aff
to
3037355
Compare
d97adc7
to
36ac97e
Compare
Abstract tab in another component Abstract tab in another component Abstract tab in another component Load devices dynamically Abstract cpx Update snapshot
36ac97e
to
c1b5bee
Compare
Add text in constants
6d689b9
to
c41db5a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing job 🥇 with the initial PR for microbit. Please make the suggested changes before checking it in.
src/view/App.spec.tsx
Outdated
import App from "./App"; | ||
|
||
describe("App component should", () => { | ||
it("render correctly", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "should render ...."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noted!
</main> | ||
</div> | ||
); | ||
} | ||
|
||
handleDeviceChange = (item?: PivotItem) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: private
+1 for using arrow functions :D
src/view/App.tsx
Outdated
} | ||
|
||
class App extends React.Component<{}, IState> { | ||
state = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd put this inside the constructor
this.state = initialState
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, declaring initial state makes it more readable
@@ -3,6 +3,8 @@ | |||
|
|||
// Adapted from : https://github.com/microsoft/pxt/blob/master/pxtsim/svg.ts | |||
|
|||
/* tslint:disable */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the reason to add this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That file is currently failing the tslint, but I will fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(unrelated to this pr)
src/view/components/tab/Tab.tsx
Outdated
interface IProps { | ||
handleTabClick: (item?: PivotItem) => void; | ||
} | ||
export class Tab extends React.Component<IProps, any> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it doesn't have a state, consider using React.FC
Also, instead of any, I'd use {} empty state to pass to React.Component
src/view/components/cpx/CpxImage.tsx
Outdated
setupSwitch(this.props); | ||
this.updateImage(); | ||
} else { | ||
console.log("Cannot find svg"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do more than just console.log()? Should we even include console.log(). Not very familiar with this situation to be honest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the console log for now
Description:
Switch between microbit and cpx device
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Type of change
Limitations:
Please describe limitations of this PR
Testing:
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist:
npm run format
and passes the checks innpm run check