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 3b67f36 commit 956fa14
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 27 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: 0 additions & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ WebApp.ready();
// Enable the closing confirmation
WebApp.enableClosingConfirmation();

WebApp.MainButton.disable();
WebApp.MainButton.hide();

// Initialize the React Query client
const queryClient = new QueryClient();

Expand Down

0 comments on commit 956fa14

Please sign in to comment.