Skip to content

Commit

Permalink
Merge pull request #24 from markxoe/development
Browse files Browse the repository at this point in the history
Version 0.14.0
  • Loading branch information
markxoe authored Jan 25, 2021
2 parents d19080c + 28e864d commit c745638
Show file tree
Hide file tree
Showing 14 changed files with 106 additions and 18 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "org.toastbrot.ichbineinebienemobile"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 30
versionName "0.13.5"
versionCode 31
versionName "0.14.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
8 changes: 4 additions & 4 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 24;
CURRENT_PROJECT_VERSION = 25;
DEVELOPMENT_TEAM = 7BZBLBDUSX;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.13.5;
MARKETING_VERSION = 0.14.0;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = org.toastbrot.ichbineinebienemobile;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -375,12 +375,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 24;
CURRENT_PROJECT_VERSION = 25;
DEVELOPMENT_TEAM = 7BZBLBDUSX;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.13.5;
MARKETING_VERSION = 0.14.0;
PRODUCT_BUNDLE_IDENTIFIER = org.toastbrot.ichbineinebienemobile;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = USE_PUSH;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ichbineinebiene-mobile",
"version": "0.13.5",
"version": "0.14.0",
"private": true,
"dependencies": {
"@capacitor-community/firebase-analytics": "^0.2.0",
Expand Down
6 changes: 6 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ Mark Oude Elberink

## Changelog

### [0.14.0] Chicken Cats :rooster: :cat:

- Warnung vor Bann
- Freiwillige Preiserhöhung
- Multiplieranzeige ist jetzt im Store genauso wie auf Home

### [0.13.5] More Infinity :recycle:

- Profil Name / Bild Richtlinien
Expand Down
28 changes: 28 additions & 0 deletions src/functions/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* TODO: Adding Functions from ../globals.ts */

import { stateType } from "../store/types";
import axios from "axios";

const getBaseURL = () => {
return (
process.env.react_app_apiurl ?? "https://api.ichbineinebiene.toastbrot.org"
);
};

export const APIgetWarning = async (
state: stateType
): Promise<string | boolean> => {
return (
(await axios
.get(getBaseURL() + "/api/v1/users2/warning/" + state.userUUID)
.then((r) => {
const result: { status: string; result?: string } = r.data;
if (result.status === "ok" && result) {
return result.result;
} else {
return false;
}
})
.catch(() => false)) ?? false
);
};
9 changes: 4 additions & 5 deletions src/globals.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { stateType } from "./store/types";
import Axios from "axios";
import packagejs from "../package.json"
import packagejs from "../package.json";
import calculateHeader from "./functions/calculateauthorization";
import { getPlatforms } from "@ionic/react";



export const rotateSpeedLevel = {
max: 3,
levels: [
Expand All @@ -31,7 +29,8 @@ export const getAdditionalBeePrice = (state: stateType): number => {
state.biene.additionalBienen.length +
state.biene.multiplierLevel +
state.biene.autoRotatingBees.length
)
) *
(state.settings.multiplyPrices ? 10.0 : 1.0)
);
};
export const getMultiplierPrice = (state: stateType): number => {
Expand Down Expand Up @@ -187,7 +186,7 @@ export const uploadData = (state: stateType) => {
data.additionalBeeLength
),
version: packagejs.version,
platforms: getPlatforms().join(" ")
platforms: getPlatforms().join(" "),
},
}
)
Expand Down
4 changes: 2 additions & 2 deletions src/other/release-notes.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"header": "Version 0.13.5",
"message": "0.13.5 Neue Namens & Profil Richtlinien"
"header": "Version 0.14.0",
"message": "0.14.0: Chicken Cats, Neues: Verwarnungen, Freiwillige Preissteigerung"
}
16 changes: 14 additions & 2 deletions src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import { FirebaseAnalyticsPlugin } from "@capacitor-community/firebase-analytics
import { KeepAwakePlugin } from "@capacitor-community/keep-awake";
import { v4, validate } from "uuid";
import axios from "axios";
import { APIgetWarning } from "../functions/api";
const Firebase = Plugins.FirebaseAnalytics as FirebaseAnalyticsPlugin;
const KeepAwake = Plugins.KeepAwake as KeepAwakePlugin;

Expand All @@ -76,6 +77,8 @@ const Home: React.FC = () => {

const [disabled, setDisabled] = useState<boolean>(false);

const [warning, setWarning] = useState<boolean | string>(false);

useIonViewWillEnter(async () => {
PushNotifications.requestPermission()
.then((result) => {
Expand Down Expand Up @@ -132,7 +135,6 @@ const Home: React.FC = () => {
Firebase.setUserId({ userId: _uuid }).catch(() => {});
dispatch({ type: "setUserUUID", payload: _uuid });


axios
.get(
(process.env.react_app_apiurl ??
Expand All @@ -159,7 +161,11 @@ const Home: React.FC = () => {
document.body.appendChild(el);
el.present();
}
});
})
.catch(() => {});
APIgetWarning(state).then((r) => {
setWarning(r);
});
});

await Storage.get({ key: StoreKeyPrefix + "lastKnownVersion" }).then(
Expand Down Expand Up @@ -464,6 +470,12 @@ const Home: React.FC = () => {
</IonCol>
</IonRow>
</IonGrid>
<IonItem color="warning" hidden={warning === false}>
<p>
{warning}. Schreibe ggf. eine E-Mail an{" "}
<a href="mailto:ban@ichbineinebiene.org">ban@ichbineinebiene.org</a>
</p>
</IonItem>

<IonFab
hidden={!state.settings.clickButtonForBee}
Expand Down
10 changes: 10 additions & 0 deletions src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import {
ActionSettingsSetClickButtonForBee,
ActionSettingsSetNewUI,
ActionSettingSetNameAtHomePosition,
ActionSetMultiplyPrices,
} from "../store/Actions";

import { Plugins, Storage } from "@capacitor/core";
Expand Down Expand Up @@ -187,6 +188,15 @@ const PageSettings: React.FC = () => {
</IonItem>
<IonItemDivider>Allgemein</IonItemDivider>

<IonItem>
<IonLabel>Höhere Preise</IonLabel>
<IonToggle
checked={state.settings.multiplyPrices}
onIonChange={(e) => {
dispatch(ActionSetMultiplyPrices(e.detail.checked));
}}
/>
</IonItem>
<IonItem>
<IonLabel>Neues User Interface</IonLabel>
<IonToggle
Expand Down
18 changes: 17 additions & 1 deletion src/pages/Store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import {
IonToast,
IonToolbar,
useIonViewDidEnter,
IonItem,
IonToggle,
IonLabel,
} from "@ionic/react";
import { AppContext } from "../store/State";
import {
Expand All @@ -43,6 +46,7 @@ import {
ActionMultiplierIncrease,
ActionRotateSpeedLevelIncrease,
ActionSetState,
ActionSetMultiplyPrices,
} from "../store/Actions";
import { RefresherEventDetail } from "@ionic/core";
import { flashOutline } from "ionicons/icons";
Expand Down Expand Up @@ -358,7 +362,9 @@ const StorePage: React.FC = () => {
</IonRow>
<IonRow>
<IonCol>
<h2>Deine Multiplier: {state.biene.multiplierLevel}/∞</h2>
<h2>
Dein Multiplier: x {state.biene.multiplierLevel + 1}/∞
</h2>
</IonCol>
</IonRow>
</IonGrid>
Expand Down Expand Up @@ -442,6 +448,16 @@ const StorePage: React.FC = () => {
</IonCardContent>
</IonCard>

<IonItem>
<IonLabel>Höhere Preise</IonLabel>
<IonToggle
checked={state.settings.multiplyPrices}
onIonChange={(e) => {
dispatch(ActionSetMultiplyPrices(e.detail.checked));
}}
/>
</IonItem>

<IonToast
isOpen={showThx}
translucent
Expand Down
5 changes: 5 additions & 0 deletions src/store/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,8 @@ export const ActionAddGoldenBiene = (): actionType => ({
export const ActionResetManyThings = (): actionType => ({
type: "resetManyThings",
});

export const ActionSetMultiplyPrices = (activated: boolean): actionType => ({
type: "setMultiplyPrices",
payload: activated,
});
11 changes: 11 additions & 0 deletions src/store/State.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const initialState: stateType = {
newUI: true,
deactivateStoreConfetti: false,
nameathomeposition: nameAtHomePositions.top,
multiplyPrices: false,
},
statisticsRotations: 0,
settingMaxNumberDisplayedBees: 20,
Expand Down Expand Up @@ -205,6 +206,16 @@ let reducer = (state: stateType, action: actionType): stateType => {
},
};
}

case "setMultiplyPrices": {
return {
...state,
settings: {
...state.settings,
multiplyPrices: action.payload,
},
};
}
}

return state;
Expand Down
1 change: 1 addition & 0 deletions src/store/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface stateType {
newUI: boolean;
deactivateStoreConfetti: boolean;
nameathomeposition: nameAtHomePositions;
multiplyPrices: boolean;
};
statisticsRotations: number;
settingMaxNumberDisplayedBees: number;
Expand Down

0 comments on commit c745638

Please sign in to comment.