Skip to main content

Development

Configuration

Configuration for setup Legion to your development

banner-Configuration

Multi-Theme

Legion uses multi-theming with the help of ThemeProvider from Theme UI, this means you can switch themes quickly and see what you need with as easy as props parsing to the ThemeProvider. With each theme from each tribe being loaded from a package, you are guaranteed to be updated as long as both designer and developer cooperated with any incoming updates to your application.



ThemeProvider

In this example we are going to use what’s generated from the Create React App command, but the principal stays the same across entire application. You are going to edit your main root file of your React Js whether it’s App.js or Index.js or Main.js, and wrap the entire Main Component / Main App with the ThemeProvider such as follows with the props description:



Props

NameTypeDescription
themeobjectThe generated object from designer’s Figma pushed to the given repository, usually using 3 words of the given squad


Available Themes

Not all squad are also provided like tribe, some are ready for use some aren’t since needs will differ across platforms too. Here are the squads that are ready to use by order:

Theme NameTribe / Squad CodeTribe / Squad Description
Theme Agreeagl, agr, aqfAgree Livestock, Agree Culture, Agree Fisheries
Theme Logeelgd, lgtLogee Distribution, Logee Transporation
Theme EDUpjb, pjmPijar Belajar, Pijar Mahir
Theme ENTptn, ossSquad Pertamina, Squad OSS
Theme EWZmcr, mcn, mtnMyCarrier, mysooltan, MyTEnS
Theme FINqip, lpeSquad QIP, Squad Loyality Point Exchange
Theme SMBpdm, lkpSquad PaDi, Squad LKPP
Theme VPLpliPeduli Lindungi


Installing Fonts Theme

Latest steps you can install the fonts for your selected theme with embeded the font link innside your <head></head> tag

  • Heading : Montserrat, Body : Open Sans


    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat|Open+Sans" />
  • Heading : Ubuntu, Body : Lato


    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu|Lato" />
  • Pijar Belajar | Heading & Body : Nunito


    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito" />

    Pijar Mahir | Heading & Body : Inter


    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter" />
  • Squad : PTN | Heading : Poppins, Body : Roboto


    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins|Roboto" />

    Squad : OSS | Heading : Poppins, Body : Poppins


    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins" />
  • Heading : Plus Jakarta Sans, Body : Inter


    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Plus+Jakarta+Sans|Inter" />
  • Heading : Roboto, Body : Roboto


    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto" />


Usage Themes

Below is the usage using Logee Transportation’s squad theme.

import './index.css';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { lgt } from '@legion-theme/logee';
import { ThemeProvider } from 'legion-ui';

After you wrap the main App component inside the ThemeProvider, you’re all set and ready to go you can use any available components provided.