-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert to TypeScript and use seatsio-types (#135)
* Add TypeScript * Converted to TypeScript * Move to typescript * Fix tests after switching to TypeScript * Simplify jest config * Fix Embeddable typings * Remove test file * Remove global directive * Update types package name * Use @seatsio/seatsio-types * Add local dependency on @seatsio/seatsio-types (to be replaced) * Use published version of @seatsio/seatsio-types * Make region a required prop, make chartJsUrl a module const * Delete chart manager * Remove deleted export * Replace multiple uses of any * Remove tests for deleted implementation * Fix tests due to defaultProps not being correct * Use published version of @seatsio/seatsio-types * Add type predicates * Use @seatsio/seatsio-types 0.3.0 * Add type predicates * Update seatsio-types to 3.0.1 * seatsio-types upgraded to 0.3.2 * Convert playground app to TypeScript * Add dark mode * Use specific package versions * Fix type issue * Updated yarn lock * Add types for react * Build with TSC * Convert tests to TypeScript and use TS-Jest * Updated license copyright * Use single bundle file output from TSC * Use webpack to create commonjs bundle * TSC build with ES6 modules * Add return type on render * Remove webpack remnants
- Loading branch information
1 parent
ff48849
commit 69d0b66
Showing
40 changed files
with
3,494 additions
and
4,483 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
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,5 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'jsdom', | ||
}; |
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 was deleted.
Oops, something went wrong.
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
Binary file not shown.
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 was deleted.
Oops, something went wrong.
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,37 @@ | ||
import { SeatsioSeatingChart } from '@seatsio/seatsio-react'; | ||
import React, { useState } from 'react'; | ||
import './App.css'; | ||
|
||
type ColorScheme = 'light' | 'dark' | ||
|
||
export const App = () => { | ||
const [unusedState, setUnusedState] = useState(0) | ||
const [colorScheme, setColorScheme] = useState<ColorScheme>('light') | ||
|
||
return ( | ||
<div className={['container', colorScheme].join(' ')}> | ||
<div className="App"> | ||
<select onChange={e => setColorScheme(e.target.value as ColorScheme)} value={colorScheme}> | ||
<option value="light">Light</option> | ||
<option value="dark">Dark</option> | ||
</select> | ||
<select onChange={e => setUnusedState(parseInt(e.target.value))} value={unusedState}> | ||
<option>0</option> | ||
<option>1</option> | ||
</select> | ||
<h1>Seats.io React playground</h1> | ||
<div id="chart"> | ||
<SeatsioSeatingChart | ||
workspaceKey="publicDemoKey" | ||
event="smallTheatreEvent1" | ||
colorScheme={colorScheme} | ||
region="eu" | ||
chartJsUrl="https://cdn-staging-{region}.seatsio.net/chart.js" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default App |
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,13 +1,13 @@ | ||
body { | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", | ||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', | ||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', | ||
monospace; | ||
} |
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import './index.css'; | ||
import App from './App'; | ||
|
||
const root = ReactDOM.createRoot( | ||
document.getElementById('root') as HTMLElement | ||
); | ||
root.render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode> | ||
); |
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 @@ | ||
/// <reference types="react-scripts" /> |
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,26 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": [ | ||
"dom", | ||
"dom.iterable", | ||
"esnext" | ||
], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"esModuleInterop": true, | ||
"allowSyntheticDefaultImports": true, | ||
"strict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"jsx": "react-jsx" | ||
}, | ||
"include": [ | ||
"src" | ||
] | ||
} |
Oops, something went wrong.