Skip to content

Commit

Permalink
Feat/onboarding (#20)
Browse files Browse the repository at this point in the history
* Default colors, translations, onboarding

* Paths

* Test Release with changes

* Purchase view
  • Loading branch information
plahteenlahti authored Nov 19, 2020
1 parent 9d9e60b commit f2f1b2a
Show file tree
Hide file tree
Showing 133 changed files with 907 additions and 519 deletions.
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = {
'@helpers': './src/helpers/',
'@graphql': './src/graphql/',
'@screens': './src/screens/',
'@views': './src/views/',
'@data-fetching': './src/data-fetching',
'@hooks': './src/hooks',
'@typings': './src/typings',
Expand Down
4 changes: 2 additions & 2 deletions ios/Nyxo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 49;
CURRENT_PROJECT_VERSION = 53;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = RPKZ2YP3VZ;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -1045,7 +1045,7 @@
CODE_SIGN_ENTITLEMENTS = Nyxo/Nyxo.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 49;
CURRENT_PROJECT_VERSION = 53;
DEVELOPMENT_TEAM = RPKZ2YP3VZ;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
2 changes: 1 addition & 1 deletion ios/Nyxo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>49</string>
<string>53</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NyxoTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>49</string>
<string>53</string>
</dict>
</plist>
1 change: 1 addition & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ platform :ios, '10.0'
target 'Nyxo' do

pod 'Intercom'
pod 'Sentry', '6.0.7'
use_unimodules!(exclude: ['expo-face-detector'])
use_native_modules!

Expand Down
11 changes: 6 additions & 5 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,9 @@ PODS:
- SDWebImageWebPCoder (0.6.1):
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.7)
- Sentry (6.0.9):
- Sentry/Core (= 6.0.9)
- Sentry/Core (6.0.9)
- Sentry (6.0.7):
- Sentry/Core (= 6.0.7)
- Sentry/Core (6.0.7)
- UMAppLoader (1.3.0)
- UMBarCodeScannerInterface (5.3.0)
- UMCameraInterface (5.3.0)
Expand Down Expand Up @@ -628,6 +628,7 @@ DEPENDENCIES:
- "RNSentry (from `../node_modules/@sentry/react-native`)"
- RNSha256 (from `../node_modules/react-native-sha256`)
- RNSVG (from `../node_modules/react-native-svg`)
- Sentry (= 6.0.7)
- UMAppLoader (from `../node_modules/unimodules-app-loader/ios`)
- UMBarCodeScannerInterface (from `../node_modules/unimodules-barcode-scanner-interface/ios`)
- UMCameraInterface (from `../node_modules/unimodules-camera-interface/ios`)
Expand Down Expand Up @@ -949,7 +950,7 @@ SPEC CHECKSUMS:
RNSVG: ce9d996113475209013317e48b05c21ee988d42e
SDWebImage: 0b2ba0d56479bf6a45ecddbfd5558bea93150d25
SDWebImageWebPCoder: d0dac55073088d24b2ac1b191a71a8f8d0adac21
Sentry: 388c9dc093b2fd3a264466a5c5b21e25959610a9
Sentry: e2c691627ae1dc0029acebbd1b0b4af4df12af73
UMAppLoader: 5db5dc03176c6238da9c8b3657a370137882a4ad
UMBarCodeScannerInterface: 017672479f93de88d94c3a50dfb66b5348b65989
UMCameraInterface: 22bd2c4bf15dcf68530368fa5704af7490818457
Expand All @@ -966,6 +967,6 @@ SPEC CHECKSUMS:
Yoga: 7d13633d129fd179e01b8953d38d47be90db185a
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 874f4d1b7782724dd4b1dd853cd1317fb7593132
PODFILE CHECKSUM: f1e22d51f0693abc94cb32d4b63c00be9def942b

COCOAPODS: 1.9.3
133 changes: 133 additions & 0 deletions patches/react-native+0.63.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
diff --git a/node_modules/react-native/React/Views/RCTModalHostView.h b/node_modules/react-native/React/Views/RCTModalHostView.h
index 4e61886..2b8b6c0 100644
--- a/node_modules/react-native/React/Views/RCTModalHostView.h
+++ b/node_modules/react-native/React/Views/RCTModalHostView.h
@@ -17,7 +17,7 @@

@protocol RCTModalHostViewInteractor;

-@interface RCTModalHostView : UIView <RCTInvalidating>
+@interface RCTModalHostView : UIView <RCTInvalidating, UIAdaptivePresentationControllerDelegate>

@property (nonatomic, copy) NSString *animationType;
@property (nonatomic, assign) UIModalPresentationStyle presentationStyle;
@@ -31,9 +31,9 @@

@property (nonatomic, copy) NSArray<NSString *> *supportedOrientations;
@property (nonatomic, copy) RCTDirectEventBlock onOrientationChange;
+@property (nonatomic, copy) RCTDirectEventBlock onRequestClose;

#if TARGET_OS_TV
-@property (nonatomic, copy) RCTDirectEventBlock onRequestClose;
@property (nonatomic, strong) RCTTVRemoteHandler *tvRemoteHandler;
#endif

diff --git a/node_modules/react-native/React/Views/RCTModalHostView.m b/node_modules/react-native/React/Views/RCTModalHostView.m
index 6a15330..9ed68db 100644
--- a/node_modules/react-native/React/Views/RCTModalHostView.m
+++ b/node_modules/react-native/React/Views/RCTModalHostView.m
@@ -41,6 +41,9 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge
if ((self = [super initWithFrame:CGRectZero])) {
_bridge = bridge;
_modalViewController = [RCTModalHostViewController new];
+ if (@available(iOS 13.0, *)) {
+ _modalViewController.presentationController.delegate = self;
+ }
UIView *containerView = [UIView new];
containerView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
_modalViewController.view = containerView;
@@ -62,6 +65,22 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge
return self;
}

+- (UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller traitCollection:(UITraitCollection *)traitCollection
+{
+ if (self.presentationStyle == UIModalPresentationFullScreen && self.isTransparent) {
+ return UIModalPresentationOverFullScreen;
+ }
+ return self.presentationStyle;
+}
+
+- (UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller
+{
+ if (self.presentationStyle == UIModalPresentationFullScreen && self.isTransparent) {
+ return UIModalPresentationOverFullScreen;
+ }
+ return self.presentationStyle;
+}
+
#if TARGET_OS_TV
- (void)menuButtonPressed:(__unused UIGestureRecognizer *)gestureRecognizer
{
@@ -69,10 +88,12 @@ - (void)menuButtonPressed:(__unused UIGestureRecognizer *)gestureRecognizer
_onRequestClose(nil);
}
}
+#endif

- (void)setOnRequestClose:(RCTDirectEventBlock)onRequestClose
{
_onRequestClose = onRequestClose;
+ #if TARGET_OS_TV
if (_reactSubview) {
if (_onRequestClose && _menuButtonGestureRecognizer) {
[_reactSubview addGestureRecognizer:_menuButtonGestureRecognizer];
@@ -80,8 +101,8 @@ - (void)setOnRequestClose:(RCTDirectEventBlock)onRequestClose
[_reactSubview removeGestureRecognizer:_menuButtonGestureRecognizer];
}
}
+ #endif
}
-#endif

- (void)notifyForBoundsChange:(CGRect)newBounds
{
@@ -155,6 +176,14 @@ - (void)didUpdateReactSubviews
// Do nothing, as subview (singular) is managed by `insertReactSubview:atIndex:`
}

+- (void)presentationControllerDidDismiss:(UIPresentationController *)presentationController
+{
+ if (_onRequestClose) {
+ _onRequestClose(nil);
+ }
+}
+
+
- (void)dismissModalViewController
{
if (_isPresented) {
@@ -187,6 +216,12 @@ - (void)didMoveToWindow
if (self.presentationStyle != UIModalPresentationNone) {
_modalViewController.modalPresentationStyle = self.presentationStyle;
}
+ // only handle swipe close when onRequest method is provided
+ if (@available(iOS 13.0, *)) {
+ if (_onRequestClose) {
+ _modalViewController.modalInPresentation = self.presentationStyle != UIModalPresentationFormSheet && self.presentationStyle != UIModalPresentationPageSheet;
+ }
+ }
[_delegate presentModalHostView:self withViewController:_modalViewController animated:[self hasAnimationType]];
_isPresented = YES;
}
diff --git a/node_modules/react-native/React/Views/RCTModalHostViewManager.m b/node_modules/react-native/React/Views/RCTModalHostViewManager.m
index bafab9d..d56bb52 100644
--- a/node_modules/react-native/React/Views/RCTModalHostViewManager.m
+++ b/node_modules/react-native/React/Views/RCTModalHostViewManager.m
@@ -116,9 +116,6 @@ - (void)invalidate
RCT_EXPORT_VIEW_PROPERTY(identifier, NSNumber)
RCT_EXPORT_VIEW_PROPERTY(supportedOrientations, NSArray)
RCT_EXPORT_VIEW_PROPERTY(onOrientationChange, RCTDirectEventBlock)
-
-#if TARGET_OS_TV
RCT_EXPORT_VIEW_PROPERTY(onRequestClose, RCTDirectEventBlock)
-#endif

@end
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081
13 changes: 6 additions & 7 deletions src/components/AuthSpecific/Disclaimer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ const Disclaimer = () => {
return (
<DisclaimerContainer>
<DisclaimerText>
By creating a Nyxo Cloud Account, I agree to Nyxo's{' '}
<UnderLine onPress={openTerms}> Terms of Service </UnderLine>
and
<UnderLine onPress={openPrivacyPolicy}> Privacy Policy</UnderLine>
By creating a Nyxo Cloud Account, I agree to Nyxo&apos;s
<UnderLine onPress={openTerms}> Terms of Service</UnderLine> and{' '}
<UnderLine onPress={openPrivacyPolicy}>Privacy Policy</UnderLine>
</DisclaimerText>
</DisclaimerContainer>
)
Expand All @@ -32,13 +31,13 @@ const DisclaimerContainer = styled.View`
`

const UnderLine = styled.Text`
color: ${(props: StyleProps) => props.theme.SECONDARY_TEXT_COLOR};
text-decoration: underline;
color: ${({ theme }) => theme.accent};
margin: 0px 5px;
text-decoration: underline;
`

const DisclaimerText = styled.Text`
color: ${(props: StyleProps) => props.theme.SECONDARY_TEXT_COLOR};
color: ${({ theme }) => theme.SECONDARY_TEXT_COLOR};
font-family: ${fonts.medium};
line-height: 25px;
`
2 changes: 1 addition & 1 deletion src/components/Buttons/BackToAppButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ const ButtonText = styled(TranslatedText)`
font-family: ${fonts.bold};
font-size: 15px;
padding: 5px;
color: ${colors.radiantBlue};
color: ${colors.darkBlue};
`
2 changes: 1 addition & 1 deletion src/components/Buttons/BottomButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Container = styled.View`

const ButtonContainer = styled.View<ButtonProps>`
opacity: ${({ disabled }) => (disabled ? 0.5 : 1)};
background-color: ${colors.radiantBlue};
background-color: ${colors.darkBlue};
border-radius: 5px;
padding: 15px;
box-shadow: 1px 1px 5px rgba(74, 90, 239, 0.4);
Expand Down
7 changes: 3 additions & 4 deletions src/components/Buttons/LinkingButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,21 @@ interface ButtonProps {

const Button = styled.View<ButtonProps>`
border-radius: 5px;
border-color: ${(props) =>
props.white ? colors.radiantBlue : 'transparent'};
border-color: ${(props) => (props.white ? colors.darkBlue : 'transparent')};
border-width: 1px;
padding: 15px;
min-width: 150px;
margin-bottom: 10px;
width: auto;
align-items: center;
background-color: ${(props) =>
props.white ? colors.white : colors.radiantBlue};
props.white ? colors.white : colors.darkBlue};
opacity: ${(props: ButtonProps) => (props.disabled ? 0.2 : 1)};
`

const ButtonText = styled(TranslatedText)<ButtonProps>`
font-family: ${fonts.medium};
color: ${(props) => (props.white ? colors.radiantBlue : colors.white)};
color: ${(props) => (props.white ? colors.darkBlue : colors.white)};
font-size: 15px;
text-transform: uppercase;
text-align: center;
Expand Down
7 changes: 3 additions & 4 deletions src/components/Buttons/PrimaryButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,15 @@ interface ButtonProps {

const Button = styled.View<ButtonProps>`
border-radius: 8px;
border-color: ${({ white }) => (white ? colors.radiantBlue : 'transparent')};
border-color: ${({ white }) => (white ? colors.darkBlue : 'transparent')};
border-width: 1px;
padding: 16px;
min-width: 200px;
margin-bottom: 10px;
align-items: center;
flex-direction: row;
justify-content: center;
background-color: ${({ white }) =>
white ? colors.white : colors.radiantBlue};
background-color: ${({ white }) => (white ? colors.white : colors.darkBlue)};
opacity: ${({ disabled }) => (disabled ? 0.75 : 1)};
box-shadow: 1px 1px 5px rgba(74, 90, 239, 0.4);
align-self: center;
Expand All @@ -57,7 +56,7 @@ const ButtonText = styled(TranslatedText)<ButtonProps>`
font-family: ${({ theme }) => theme.FONT_BOLD};
text-transform: uppercase;
letter-spacing: 1px;
color: ${({ white }) => (white ? colors.radiantBlue : colors.white)};
color: ${({ white }) => (white ? colors.darkBlue : colors.white)};
font-size: 15px;
text-align: center;
`
Expand Down
4 changes: 2 additions & 2 deletions src/components/Buttons/SecondaryButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ const Button = styled.View<ButtonProps>`
width: auto;
align-items: center;
background-color: ${(props) =>
props.white ? colors.white : colors.radiantBlue};
props.white ? colors.white : colors.darkBlue};
opacity: ${(props: ButtonProps) => (props.disabled ? 0.2 : 1)};
`

const ButtonText = styled(TranslatedText)<ButtonProps>`
font-family: ${fonts.medium};
color: ${(props) => (props.white ? colors.radiantBlue : colors.white)};
color: ${(props) => (props.white ? colors.darkBlue : colors.white)};
font-size: 15px;
text-align: center;
opacity: ${(props: ButtonProps) => (props.disabled ? 0.5 : 1)};
Expand Down
2 changes: 1 addition & 1 deletion src/components/Buttons/TextButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface TextProps {

const Text = styled(TranslatedText)<TextProps>`
font-size: 15px;
color: ${colors.radiantBlue};
color: ${colors.darkBlue};
font-family: ${({ theme }) => theme.FONT_MEDIUM};
text-align: ${({ center }) => (center ? 'center' : 'left')};
`
Expand Down
6 changes: 3 additions & 3 deletions src/components/Buttons/backButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const Button = styled.View`
flex-direction: row;
`

const Icon = styled(IconBold).attrs((props: StyleProps) => ({
fill: props.theme.PRIMARY_TEXT_COLOR
const Icon = styled(IconBold).attrs(({ theme }) => ({
fill: theme.PRIMARY_TEXT_COLOR
}))``

interface TextProps extends StyleProps {
Expand All @@ -51,5 +51,5 @@ const Text = styled(TranslatedText)<TextProps>`
margin-left: 5px;
font-size: 15px;
font-family: ${fonts.medium};
color: ${(props: TextProps) => props.theme.PRIMARY_TEXT_COLOR};
color: ${({ theme }) => theme.PRIMARY_TEXT_COLOR};
`
4 changes: 2 additions & 2 deletions src/components/Challenge/ChallengeItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ const ChallengeItem = ({ challenge }: { challenge: Challenge }) => {
borderRadius: 15,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: colors.radiantBlueTransparent,
backgroundColor: colors.darkBlueTransparent,
marginRight: 10
}}>
<IconBold
name="trophyStar"
height={20}
width={20}
fill={colors.radiantBlue}
fill={colors.darkBlue}
/>
</View>
<View style={{ width: 200 }}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Charts/HeartRateChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const HeartRateChart = (props: HeartRateChartProps) => {
<G x={0} y={0}>
<Path
d={lineShape(data)}
stroke={colors.radiantBlue}
stroke={colors.darkBlue}
strokeWidth={3}
fill="none"
/>
Expand Down
Loading

0 comments on commit f2f1b2a

Please sign in to comment.