1.0.0 • Published 8 months ago

@achyutn/mui-comps v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

MUI Components

Publish to NPMJS

Introduction

Feel free to use it. Introduction section coming soon.

Setup

Run the following command:

cp .env{.example,}

Use following to setup the package:

APP_NAME={APP NAME}
VITE_API_ENDPOINT={API ENDPOINT}
LOGIN_TOKEN = {LOGIN TOKEN NAME}
USER_VALUE={USER DATA VALUE}

You can access these values by importing

import {KEY} from "@an/env";

Example:

import {APP_NAME} from "@an/env";

return (
    <>
        App Name: {APP_NAME}
    </>
)

Default Value

APP_NAME = "Application"
VITE_API_ENDPOINT = "https://localhost:8000"
LOGIN_TOKEN = "_an_token"
USER_VALUE = "_an_user"

Initialization

Copy the following code and replace in main.tsx file:

import ReactDOM from 'react-dom/client'
import store from "@an/env";
import {Provider} from "react-redux";
import {BrowserRouter} from "react-router-dom";
import ANRoutes from "@anWrappers/ANRoutes.tsx";
import ANLayout from "@anWrappers/ANLayout.tsx";
import ThemeWrapper from "@anWrappers/ThemeWrapper.tsx";

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
    <>
        <Provider store={store}>
            <BrowserRouter>
                <ThemeWrapper>
                    <ANLayout>
                        <ANRoutes/>
                    </ANLayout>
                </ThemeWrapper>
            </BrowserRouter>
        </Provider>
    </>
)