Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-vahn committed May 2, 2024
1 parent 956fa14 commit c6aeaf3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
48 changes: 24 additions & 24 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ enum View {

WebApp.setHeaderColor('#1a1a1a');

WebApp.MainButton.enable();
WebApp.MainButton.color = '#007aff';
WebApp.MainButton.setText('Add to your Home Screen');
WebApp.MainButton.show();
// WebApp.MainButton.enable();
// WebApp.MainButton.color = '#007aff';
// WebApp.MainButton.setText('Add to your Home Screen');
// WebApp.MainButton.show();

const BRIDGE_URL = import.meta.env.VITE_BRIDGE_URL || '';

Expand Down Expand Up @@ -90,37 +90,37 @@ function App() {
// Handle MainButton changes on view change
useEffect(() => {
if (view === View.LANDING) {
WebApp.MainButton.show();
WebApp.MainButton.enable();
WebApp.MainButton.setText('Connect Your Wallet');
WebApp.MainButton.color = '#007aff';
WebApp.MainButton.textColor = '#ffffff';
// WebApp.MainButton.show();
// WebApp.MainButton.enable();
// WebApp.MainButton.setText('Connect Your Wallet');
// WebApp.MainButton.color = '#007aff';
// WebApp.MainButton.textColor = '#ffffff';
WebApp.MainButton.onClick(skip);
}
// Change the Main Buttons color and textColor to match telegrams background color, to "hide" the button
if (view === View.CONNECT) {
WebApp.MainButton.show();
WebApp.MainButton.disable();
WebApp.MainButton.text = '_';
WebApp.MainButton.textColor = '#1a1a1a';
WebApp.MainButton.color = '#1a1a1a';
// WebApp.MainButton.show();
// WebApp.MainButton.disable();
// WebApp.MainButton.text = '_';
// WebApp.MainButton.textColor = '#1a1a1a';
// WebApp.MainButton.color = '#1a1a1a';
}
if (view === View.CONNECTED) {
WebApp.MainButton.show();
WebApp.MainButton.enable();
WebApp.MainButton.setText('Open my Wallet');
WebApp.MainButton.color = '#007aff';
WebApp.MainButton.textColor = '#ffffff';
// WebApp.MainButton.show();
// WebApp.MainButton.enable();
// WebApp.MainButton.setText('Open my Wallet');
// WebApp.MainButton.color = '#007aff';
// WebApp.MainButton.textColor = '#ffffff';
WebApp.MainButton.onClick(openWallet);

getAccountData();
}
if (view === View.WALLET) {
WebApp.MainButton.show();
WebApp.MainButton.enable();
WebApp.MainButton.color = '#007aff';
WebApp.MainButton.textColor = '#ffffff';
WebApp.MainButton.setText('Contact Sales');
// WebApp.MainButton.show();
// WebApp.MainButton.enable();
// WebApp.MainButton.color = '#007aff';
// WebApp.MainButton.textColor = '#ffffff';
// WebApp.MainButton.setText('Contact Sales');
}
}, [view]);

Expand Down
3 changes: 2 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import WebApp from '@twa-dev/sdk';
import App from './App.tsx';
import './index.css';

// Hide the main button
WebApp.MainButton.hide();
// Expand the Telegram Mini App to full screen
WebApp.expand();

// Initialize the Telegram Mini App SDK
WebApp.ready();
// Enable the closing confirmation
Expand Down

0 comments on commit c6aeaf3

Please sign in to comment.