Skip to content

Latest commit

 

History

History
182 lines (113 loc) · 6.74 KB

README.md

File metadata and controls

182 lines (113 loc) · 6.74 KB

license mit typescript

A versatile and customizable React UI library designed to streamline the development of beautiful and responsive user interfaces. Packed with a rich set of components and themes, it empowers developers to create stunning web applications with ease.

Install

  • as local project package
yarn add @delab-team/de-ui

It is necessary to wrap your entire application within the AppInner component. Failure to do so may result in the application not working as expected. You also have the option to manually set the value to true in order to witness the application's outcome adorned with Telegram styles.

index.html

<script src="https://telegram.org/js/telegram-web-app.js"></script>

App.tsx

import { AppInner } from '@delab-team/de-ui' 
import { useEffect, useState } from 'react'

declare global {
    interface Window {
        Telegram?: any
    }
}

export const App: React.FC = () => {
    const [ firstRender, setFirstRender ] = useState<boolean>(false)
    const [ isTg, setIsTg ] = useState<boolean>(false)

    useEffect(() => {
      if (!firstRender) {
        setFirstRender(true)

        const isTgCheck = window.Telegram.WebApp.initData !== ''
        const TgObj = window.Telegram.WebApp

        setIsTg(isTgCheck)
        if (isTgCheck) {
            TgObj.ready()
            TgObj.enableClosingConfirmation()
            TgObj.expand()
        }
      }

    }, [ firstRender ])

    return (
      <AppInner isTg={isTg}>
            {/* Your application's goes here */}
      </AppInner>,
    )

}

Here's a list of components included in our library:

Modals:

Common:

Forms:

Headers

Icons:

Menu:

Wrappers:

Tables:

Typography:

License

MIT License Copyright (c) 2023 DeLab Team