mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 10:33:02 -05:00
Merge pull request #413 from MatissJanis/matiss/netlify-demo
feat: allow creating test budget in netlify deployments
This commit is contained in:
@@ -10,6 +10,10 @@ import CloudDownload from '../../svg/v1/CloudDownload';
|
||||
import DotsHorizontalTriple from '../../svg/v1/DotsHorizontalTriple';
|
||||
import FileDouble from '../../svg/v1/FileDouble';
|
||||
import CloudUnknown from '../../svg/v2/CloudUnknown';
|
||||
import {
|
||||
isDevelopmentEnvironment,
|
||||
isPreviewEnvironment
|
||||
} from '../../util/environment';
|
||||
import { View, Text, Modal, Button, Tooltip, Menu } from '../common';
|
||||
|
||||
function getFileDescription(file) {
|
||||
@@ -319,7 +323,7 @@ class BudgetList extends React.Component {
|
||||
Create new file
|
||||
</Button>
|
||||
|
||||
{process.env.NODE_ENV === 'development' && (
|
||||
{(isDevelopmentEnvironment() || isPreviewEnvironment()) && (
|
||||
<Button
|
||||
primary
|
||||
onClick={() => this.onCreate({ testMode: true })}
|
||||
|
||||
7
packages/loot-design/src/util/environment.js
Normal file
7
packages/loot-design/src/util/environment.js
Normal file
@@ -0,0 +1,7 @@
|
||||
export function isPreviewEnvironment() {
|
||||
return String(process.env.REACT_APP_NETLIFY) === 'true';
|
||||
}
|
||||
|
||||
export function isDevelopmentEnvironment() {
|
||||
return process.env.NODE_ENV === 'development';
|
||||
}
|
||||
Reference in New Issue
Block a user