Telegram-Mini-Apps / telegram-apps

Made from scratch TypeScript packages, examples and documentation you will surely need to start developing on Telegram Mini Apps.
https://docs.telegram-mini-apps.com/
MIT License
576 stars 143 forks source link

[Feature]: add setHeaderTextColor to `miniApp` #470

Open web3jt opened 1 week ago

web3jt commented 1 week ago

Is your feature request related to a problem? Please describe.

  useEffect(() => {
    if (!miniApp || !theme) return;

    miniApp.setBgColor(theme === 'dark' ? '#18181b' : '#f4f4f5');
    miniApp.setHeaderColor('#18181b');
    /**
     * @TODO set header text color
     */
    // miniApp.setHeaderTextColor('#f4f4f5'); // section_header_text_color
  }, [
    miniApp,
    theme,
  ]);

I couldn't miniApp.setHeaderTextColor( above there.

Plz support section_header_text_color of Bot API 7.0 @December 29, 2023

Describe the solution you'd like

both for @telegram-apps/sdk-react and @telegram-apps/sdk

and I think there are more features about the MiniApp theme are supposed to be supported such as section_header_text_color, section_separator_color, subtitle_text_color and destructive_text_color etc...

Describe alternatives you've considered

N/A

Additional context

super thanks

web3jt commented 1 week ago

I found useThemeParams but could just get sectionHeaderTextColor there

heyqbnk commented 3 days ago

There is no way to implement such a functionality because the platform does not provide a corresponding method