mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-16 17:49:09 +00:00
experiment: trying other web ui kits
This commit is contained in:
parent
dac2af43a2
commit
105292c342
20 changed files with 11902 additions and 8 deletions
24
packages/spectrum/src/App.tsx
Normal file
24
packages/spectrum/src/App.tsx
Normal file
|
@ -0,0 +1,24 @@
|
|||
import { Router } from '@reach/router';
|
||||
import { BaseProvider, createDarkTheme } from 'baseui';
|
||||
import { Client as Styletron } from 'styletron-engine-atomic';
|
||||
import { Provider as StyletronProvider } from 'styletron-react';
|
||||
import { Picker } from './pages/Picker';
|
||||
|
||||
const engine = new Styletron();
|
||||
const theme = createDarkTheme({ primaryFontFamily: 'source-han-sans-japanese' });
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<>
|
||||
<StyletronProvider value={engine}>
|
||||
<BaseProvider theme={theme}>
|
||||
<Router>
|
||||
<Picker path="/s/:serverID" />
|
||||
</Router>
|
||||
</BaseProvider>
|
||||
</StyletronProvider>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
4
packages/spectrum/src/index.css
Normal file
4
packages/spectrum/src/index.css
Normal file
|
@ -0,0 +1,4 @@
|
|||
body {
|
||||
background-color: #141414;
|
||||
font-family: source-han-sans-japanese, sans-serif;
|
||||
}
|
17
packages/spectrum/src/index.tsx
Normal file
17
packages/spectrum/src/index.tsx
Normal file
|
@ -0,0 +1,17 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import App from './App';
|
||||
import './index.css';
|
||||
import reportWebVitals from './reportWebVitals';
|
||||
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>,
|
||||
document.getElementById('root')
|
||||
);
|
||||
|
||||
// If you want to start measuring performance in your app, pass a function
|
||||
// to log results (for example: reportWebVitals(console.log))
|
||||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
||||
reportWebVitals();
|
10
packages/spectrum/src/pages/Picker.tsx
Normal file
10
packages/spectrum/src/pages/Picker.tsx
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { RouteComponentProps, useParams } from '@reach/router';
|
||||
import { Display1 } from 'baseui/typography';
|
||||
|
||||
type PickerProps = RouteComponentProps;
|
||||
|
||||
export const Picker = (props: PickerProps) => {
|
||||
const { serverID } = useParams();
|
||||
|
||||
return <Display1>hello {serverID}</Display1>;
|
||||
};
|
1
packages/spectrum/src/react-app-env.d.ts
vendored
Normal file
1
packages/spectrum/src/react-app-env.d.ts
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/// <reference types="react-scripts" />
|
15
packages/spectrum/src/reportWebVitals.ts
Normal file
15
packages/spectrum/src/reportWebVitals.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { ReportHandler } from 'web-vitals';
|
||||
|
||||
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
|
||||
if (onPerfEntry && onPerfEntry instanceof Function) {
|
||||
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
||||
getCLS(onPerfEntry);
|
||||
getFID(onPerfEntry);
|
||||
getFCP(onPerfEntry);
|
||||
getLCP(onPerfEntry);
|
||||
getTTFB(onPerfEntry);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default reportWebVitals;
|
5
packages/spectrum/src/setupTests.ts
Normal file
5
packages/spectrum/src/setupTests.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
||||
// allows you to do things like:
|
||||
// expect(element).toHaveTextContent(/react/i)
|
||||
// learn more: https://github.com/testing-library/jest-dom
|
||||
import '@testing-library/jest-dom';
|
Loading…
Add table
Add a link
Reference in a new issue