Skip to content

Commit

Permalink
Merge branch 'main' into feature/mark-chit/credits
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-chit committed Oct 23, 2022
2 parents 67b09c2 + eb71e8f commit 23874ee
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 46 deletions.
23 changes: 13 additions & 10 deletions web/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"root": true,
"plugins": ["react"],
"extends": ["portsoc-ts", "plugin:react/recommended"],
"env": {
"browser": true
},
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"react/react-in-jsx-scope": "off"
}
"root": true,
"plugins": ["react"],
"extends": ["portsoc-ts", "plugin:react/recommended"],
"env": {
"browser": true
},
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/indent": "off",
"@typescript-eslint/member-delimiter-style": "off",
"react/react-in-jsx-scope": "off",
"no-tabs": "off"
}
}
14 changes: 14 additions & 0 deletions web/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"trailingComma": "all",
"printWidth": 120,
"tabWidth": 4,
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"singleAttributePerLine": false,
"endOfLine": "lf",
"arrowParens": "always",
"useTabs": true,
"bracketSameLine": true,
"quoteProps": "as-needed"
}
44 changes: 22 additions & 22 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import './App.css';

import reactLogo from './assets/react.svg';
import IncrementButton from './IncrementButton';
import reactLogo from './assets/react.svg';

function App() {
return (
<div className='App'>
<div>
<a href='https://vitejs.dev' target='_blank' rel='noreferrer'>
<img src='/vite.svg' className='logo' alt='Vite logo' />
</a>
<a href='https://reactjs.org' target='_blank' rel='noreferrer'>
<img src={reactLogo} className='logo react' alt='React logo' />
</a>
</div>
<h1>Vite + React</h1>
<div className="card">
<IncrementButton incrementBy={1} />
<IncrementButton incrementBy={2} />
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
</div>
<p className='read-the-docs'>Click on the Vite and React logos to learn more</p>
</div>
);
return (
<div className='App'>
<div>
<a href='https://vitejs.dev' target='_blank' rel='noreferrer'>
<img src='/vite.svg' className='logo' alt='Vite logo' />
</a>
<a href='https://reactjs.org' target='_blank' rel='noreferrer'>
<img src={reactLogo} className='logo react' alt='React logo' />
</a>
</div>
<h1>Vite + React</h1>
<div className='card'>
<IncrementButton incrementBy={1} />
<IncrementButton incrementBy={2} />
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
</div>
<p className='read-the-docs'>Click on the Vite and React logos to learn more</p>
</div>
);
}

export default App;
21 changes: 10 additions & 11 deletions web/src/IncrementButton.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { useState } from 'react';

type ComponentProps = {
incrementBy: number,
}
incrementBy: number;
};

function IncrementButton(props: ComponentProps) {
const [count, setCount] = useState(0);
const [count, setCount] = useState(0);

return (
<div>
<button onClick={() => setCount(() => count + props.incrementBy)}>
This button increments by {props.incrementBy}.
count is {count}
</button>
</div>
);
return (
<div>
<button onClick={() => setCount(() => count + props.incrementBy)}>
This button increments by {props.incrementBy}. count is {count}
</button>
</div>
);
}

export default IncrementButton;
6 changes: 3 additions & 3 deletions web/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React from 'react';
import ReactDOM from 'react-dom/client';

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<App />
</React.StrictMode>,
<React.StrictMode>
<App />
</React.StrictMode>,
);

0 comments on commit 23874ee

Please sign in to comment.