Skip to content

Commit 21a64e8

Browse files
committed
up og version
change package name mv vite config to ts
1 parent de0d464 commit 21a64e8

File tree

6 files changed

+31
-12
lines changed

6 files changed

+31
-12
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ Example of usage:
1111
`App.tsx`
1212
```tsx
1313
import '@openglobus/react/dist/style.css'
14-
import Globus, {GlobeContextProvider} from '@openglobus/react'
14+
import Globus, {GlobusContextProvider} from '@openglobus/react'
1515

1616

1717
function App() {
18-
return <GlobeContextProvider>
18+
return <GlobusContextProvider>
1919
<Globus/>
20-
</GlobeContextProvider>
20+
</GlobusContextProvider>
2121
}
2222

2323
export default App
@@ -26,13 +26,13 @@ export default App
2626
```
2727
`Button.tsx`
2828
```tsx
29-
import {useGlobeContext} from '@openglobus/react'
29+
import {useGlobusContext} from '@openglobus/react'
3030
// import './buttons.css'
3131
import {LonLat} from "@openglobus/og";
3232

3333

3434
export default function ButtonContainer() {
35-
const {globe} = useGlobeContext()
35+
const {globe} = useGlobusContext()
3636
const clickFlyTo = () => {
3737
let ell = globe?.planet.ellipsoid;
3838

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@openglobus/react",
3-
"version": "0.0.2",
2+
"name": "@openglobus/openglobus-react",
3+
"version": "0.0.3",
44
"description": "Openglobus React Components",
55
"main": "dist/index.umd.js",
66
"private": false,
@@ -23,6 +23,7 @@
2323
"license": "MIT",
2424
"devDependencies": {
2525
"@openglobus/og": "^0.18.5",
26+
"@types/node": "^20.10.0",
2627
"@types/react": "^18.2.38",
2728
"react": "^18.2.0",
2829
"typescript": "^5.3.2",

src/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import {Globe, GlobusTerrain, utils, XYZ} from '@openglobus/og';
44

55
let index: Globe;
66

7-
interface GlobeContextProps {
7+
interface GlobusContextProps {
88
globe: Globe | null;
99
setGlobe: React.Dispatch<React.SetStateAction<Globe | null>>;
1010
}
1111

12-
const GlobeContext = createContext<GlobeContextProps>({
12+
const GlobusContext = createContext<GlobusContextProps>({
1313
globe: null,
1414
setGlobe: () => {
1515
},
@@ -18,14 +18,14 @@ const GlobeContext = createContext<GlobeContextProps>({
1818
export const GlobeContextProvider: React.FC<{ children: React.ReactNode }> = ({children}) => {
1919
const [globe, setGlobe] = useState<Globe | null>(index);
2020

21-
return <GlobeContext.Provider value={{globe, setGlobe}}>{children}</GlobeContext.Provider>;
21+
return <GlobusContext.Provider value={{globe, setGlobe}}>{children}</GlobusContext.Provider>;
2222
};
2323

24-
export const useGlobeContext = (): GlobeContextProps => useContext(GlobeContext);
24+
export const useGlobusContext = (): GlobusContextProps => useContext(GlobusContext);
2525

2626
const Globus: React.FC<{ children?: React.ReactNode }> = ({children}) => {
2727
const targetRef = useRef<HTMLDivElement | null>(null);
28-
const {setGlobe} = useGlobeContext();
28+
const {setGlobe} = useGlobusContext();
2929

3030
useEffect(() => {
3131
if (!index) {

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "es2016",
4+
"lib": ["es2016", "dom"],
45
"esModuleInterop": true,
56
"forceConsistentCasingInFileNames": true,
67
"strict": true,
File renamed without changes.

0 commit comments

Comments
 (0)