Skip to content

Commit

Permalink
feat(frontend): feature flag for the Swap feature (#3906)
Browse files Browse the repository at this point in the history
# Motivation

A feature flag for the Swap feature. 

Note: `feat/swap` will be a base branch for this functionality until the
whole feature is ready to go to staging.
  • Loading branch information
DenysKarmazynDFINITY committed Jan 7, 2025
1 parent 3ba36b5 commit 698da79
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ VITE_AUTH_DERIVATION_ORIGIN=
VITE_ONRAMPER_API_KEY_DEV=pk_test_
VITE_ONRAMPER_API_KEY_PROD=pk_prod_
VITE_BTC_TO_CKBTC_EXCHANGE_ENABLED=
VITE_SWAP_ACTION_ENABLED=
2 changes: 2 additions & 0 deletions .github/workflows/deploy-to-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ jobs:
echo "VITE_POUH_ENABLED=${{ secrets.VITE_POUH_ENABLED_STAGING }}" >> $GITHUB_ENV
echo "VITE_AUTH_DERIVATION_ORIGIN=${{ secrets.VITE_AUTH_DERIVATION_ORIGIN_STAGING }}" >> $GITHUB_ENV
echo "VITE_BTC_TO_CKBTC_EXCHANGE_ENABLED=${{ secrets.VITE_BTC_TO_CKBTC_EXCHANGE_ENABLED_STAGING }}" >> $GITHUB_ENV
echo "VITE_SWAP_ACTION_ENABLED=${{ secrets.VITE_SWAP_ACTION_ENABLED_STAGING }}" >> $GITHUB_ENV
echo "VITE_ONRAMPER_API_KEY_DEV=${{ secrets.VITE_ONRAMPER_API_KEY_DEV_STAGING }}" >> $GITHUB_ENV
echo "VITE_ONRAMPER_API_KEY_PROD=${{ secrets.VITE_ONRAMPER_API_KEY_PROD_STAGING }}" >> $GITHUB_ENV
if [[ "$NETWORK" == "staging" ]]; then
Expand Down Expand Up @@ -135,6 +136,7 @@ jobs:
echo "VITE_AUTH_ALTERNATIVE_ORIGINS=${{ secrets.VITE_AUTH_ALTERNATIVE_ORIGINS_BETA }}" >> $GITHUB_ENV
echo "VITE_AUTH_DERIVATION_ORIGIN=${{ secrets.VITE_AUTH_DERIVATION_ORIGIN_BETA }}" >> $GITHUB_ENV
echo "VITE_BTC_TO_CKBTC_EXCHANGE_ENABLED=${{ secrets.VITE_BTC_TO_CKBTC_EXCHANGE_ENABLED_BETA }}" >> $GITHUB_ENV
echo "VITE_SWAP_ACTION_ENABLED=${{ secrets.VITE_SWAP_ACTION_ENABLED_BETA }}" >> $GITHUB_ENV
echo "VITE_ONRAMPER_API_KEY_DEV=${{ secrets.VITE_ONRAMPER_API_KEY_DEV_BETA }}" >> $GITHUB_ENV
echo "VITE_ONRAMPER_API_KEY_PROD=${{ secrets.VITE_ONRAMPER_API_KEY_PROD_BETA }}" >> $GITHUB_ENV
{
Expand Down
3 changes: 3 additions & 0 deletions src/frontend/src/env/actions.env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// TODO: to be removed when the feature is fully implemented
export const SWAP_ACTION_ENABLED =
JSON.parse(import.meta.env.VITE_SWAP_ACTION_ENABLED ?? false) === true;

0 comments on commit 698da79

Please sign in to comment.