Skip to content

Commit

Permalink
Actualize the template
Browse files Browse the repository at this point in the history
  • Loading branch information
heyqbnk committed May 18, 2024
1 parent 340ab26 commit ced912a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 32 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"predeploy": "pnpm run build"
},
"dependencies": {
"@tma.js/react-router-integration": "^1.0.0",
"@tma.js/sdk-react": "^2.1.0",
"@tma.js/react-router-integration": "^2.0.0",
"@tma.js/sdk-react": "^2.1.4",
"@tonconnect/ui-react": "^2.0.2",
"eruda": "^3.0.1",
"react": "^18.3.1",
Expand Down
32 changes: 16 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,12 @@ export const App: FC = () => {
}, [themeParams]);

useEffect(() => {
if (viewport) {
return bindViewportCSSVars(viewport);
}
return viewport && bindViewportCSSVars(viewport);
}, [viewport]);

// Create new application navigator and attach it to the browser history, so it could modify
// it and listen to its changes.
const navigator = useMemo(() => initNavigator(
'app-navigation-state',
{ hashMode: 'default' },
), []);
const navigator = useMemo(() => initNavigator('app-navigation-state'), []);
const [location, reactNavigator] = useIntegration(navigator);

// Don't forget to attach the navigator to allow it to control the BackButton state as well
Expand All @@ -56,7 +51,7 @@ export const App: FC = () => {
<Router location={location} navigator={reactNavigator}>
<Routes>
{routes.map((route) => <Route key={route.path} {...route} />)}
<Route path='*' element={<Navigate to='/'/>}/>
<Route path="*" element={<Navigate to="/"/>}/>
</Routes>
</Router>
);
Expand Down
7 changes: 1 addition & 6 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom/client';

import { Root } from '@/components/Root';

import './index.css';

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<Root />
</React.StrictMode>,
);
ReactDOM.createRoot(document.getElementById('root')!).render(<Root />);

0 comments on commit ced912a

Please sign in to comment.