refactor(#611): [Vijay] add new input in github action workflow to toggle the themes

This commit is contained in:
vijay
2023-03-07 19:19:45 +05:30
parent fa9f06694b
commit 6a35e48349
4 changed files with 18 additions and 4 deletions

2
.env
View File

@@ -4,5 +4,7 @@
MIMOTO_HOST=https://api.qa-1201-b2.mosip.net
#MIMOTO_HOST=http://mock.mimoto.newlogic.dev
GOOGLE_NEARBY_MESSAGES_API_KEY=
#Application Theme can be ( Default | Purple )
APPLICATION_THEME=Purple
USE_BLE_SHARE=true

View File

@@ -11,6 +11,11 @@ on:
required: true
default: 'https://api.qa-121.mosip.net/residentmobileapp'
type: string
theme:
description: 'Application Theme'
required: true
default: 'Default'
type: string
jobs:
build-android:
@@ -44,13 +49,13 @@ jobs:
run: |
echo "${{ secrets.ENV_FILE }}" > .env.local > android/local.properties
- name: Setup branch and env
- name: Setup branch and env
run: |
# Strip git ref prefix from version
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
- name: Setup branch and GPG public key
- name: Setup branch and GPG public key
run: |
# Strip git ref prefix from version
@@ -69,6 +74,7 @@ jobs:
env:
MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }}
FIREBASE_SECRET: ${{ secrets.GPG_SECRET }}
APPLICAITON_THEME: ${{ github.event.inputs.theme }}
- name: Upload Artifact
uses: actions/upload-artifact@v3.1.1
with:

View File

@@ -1,9 +1,10 @@
import { DefaultTheme } from './themes/DefaultTheme';
import { PurpleTheme } from './themes/PurpleTheme';
import { APPLICATION_THEME } from 'react-native-dotenv';
// To change the theme, CSS theme file has to import and assign it to Theme in line no 6
export const Theme = PurpleTheme;
export const Theme =
APPLICATION_THEME == 'Default' ? DefaultTheme : PurpleTheme;
type SpacingXY = [number, number];
type SpacingFull = [number, number, number, number];

View File

@@ -13,4 +13,9 @@ declare module 'react-native-dotenv' {
* Flag for using BLE share library
*/
export const USE_BLE_SHARE: string;
/**
* Flag for Toggling Purple Theme and Default Theme
*/
export const APPLICATION_THEME: string;
}