Skip to content

Commit

Permalink
powered by flux
Browse files Browse the repository at this point in the history
modals corrections
open sync if needed
  • Loading branch information
TheTrunk committed Oct 24, 2023
1 parent d57678c commit 4b1b48f
Show file tree
Hide file tree
Showing 17 changed files with 54 additions and 15 deletions.
Binary file added src/assets/powered_by_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/powered_by_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/AddressDetails/AddressDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const AddressDetails = (props: { actionStatus: (status: boolean) => void }) => {
>
<ScrollView
style={[Layout.fill, Common.modalBackdrop]}
contentInset={{ bottom: 80 }}
contentContainerStyle={[
Gutters.smallBPadding,
Layout.scrollSpaceBetween,
Expand Down
1 change: 1 addition & 0 deletions src/components/Authentication/Authentication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ const Authentication = (props: {
enableOnAndroid={true}
extraScrollHeight={20}
style={[Layout.fill, Common.modalBackdrop]}
contentInset={{ bottom: 80 }}
contentContainerStyle={[
Gutters.smallBPadding,
Layout.scrollSpaceBetween,
Expand Down
3 changes: 1 addition & 2 deletions src/components/HelpSection/HelpSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
Linking,
} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import PoweredByFlux from '../PoweredByFlux/PoweredByFlux';
import { useTranslation } from 'react-i18next';
import { useTheme } from '../../hooks';

Expand Down Expand Up @@ -45,6 +44,7 @@ const HelpSection = (props: { actionStatus: (status: boolean) => void }) => {
>
<ScrollView
style={[Layout.fill, Common.modalBackdrop]}
contentInset={{ bottom: 80 }}
contentContainerStyle={[
Gutters.smallBPadding,
Layout.scrollSpaceBetween,
Expand Down Expand Up @@ -102,7 +102,6 @@ const HelpSection = (props: { actionStatus: (status: boolean) => void }) => {
</TouchableOpacity>
</View>
<View style={[Layout.justifyContentEnd]}>
<PoweredByFlux />
<TouchableOpacity
style={[
Common.button.outlineRounded,
Expand Down
1 change: 1 addition & 0 deletions src/components/ManualInput/ManualInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const ManualInput = (props: { actionStatus: (data: string) => void }) => {
<KeyboardAwareScrollView
extraScrollHeight={20}
style={[Layout.fill, Common.modalBackdrop]}
contentInset={{ bottom: 80 }}
contentContainerStyle={[
Gutters.smallBPadding,
Layout.scrollSpaceBetween,
Expand Down
39 changes: 31 additions & 8 deletions src/components/PoweredByFlux/PoweredByFlux.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import React from 'react';
import { View, Text, TouchableOpacity, Linking } from 'react-native';
import { useTranslation } from 'react-i18next';
import { View, TouchableOpacity, Linking, Image } from 'react-native';
// import { useDispatch } from 'react-redux';
// import { changeTheme, ThemeState } from '../../store/theme';
import { useTheme } from '../../hooks';

function PoweredByFlux() {
const { t } = useTranslation(['common']);
const { Fonts, Layout } = useTheme();
const { darkMode: isDark, Images, Layout, NavigationColors } = useTheme();

const openFlux = () => {
Linking.openURL('https://runonflux.io');
};

// const onChangeTheme = ({ theme, darkMode }: Partial<ThemeState>) => {
// dispatch(changeTheme({ theme, darkMode }));
// };
// const dispatch = useDispatch();

return (
<>
<View
Expand All @@ -21,13 +26,31 @@ function PoweredByFlux() {
Layout.justifyContentCenter,
Layout.alignItemsCenter,
Layout.row,
Layout.absolute,
Layout.bottom0,
{
backgroundColor: NavigationColors.background,
padding: 8,
paddingBottom: 12,
shadowColor: isDark ? 'rgba(255, 255, 255, 1)' : 'rgba(0, 0, 0, 1)',
shadowOpacity: 0.5,
shadowRadius: 7,
shadowOffset: {
height: 5,
width: 5,
},
elevation: 5,
},
]}
>
<Text style={[Fonts.textSmall]}>{t('common:powered_by')} </Text>
<TouchableOpacity onPressIn={() => openFlux()}>
<Text style={[Fonts.textSmall, Fonts.textBluePrimary]}>
{t('common:flux')}
</Text>
<Image
testID={'powered-by-flux-img'}
style={{ height: 18, width: 128 }}
source={
isDark ? Images.ssp.poweredByLight : Images.ssp.poweredByDark
}
/>
</TouchableOpacity>
</View>
</>
Expand Down
1 change: 1 addition & 0 deletions src/components/SSPKeyDetails/SSKeyDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const SSPKeyDetails = (props: { actionStatus: (status: boolean) => void }) => {
>
<ScrollView
style={[Layout.fill, Common.modalBackdrop]}
contentInset={{ bottom: 80 }}
contentContainerStyle={[
Gutters.smallBPadding,
Layout.scrollSpaceBetween,
Expand Down
1 change: 1 addition & 0 deletions src/components/SettingsSection/SettingsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ const SettingsSection = (props: {
enableOnAndroid={true}
extraScrollHeight={20}
style={[Layout.fill, Common.modalBackdrop]}
contentInset={{ bottom: 80 }}
contentContainerStyle={[
Gutters.smallBPadding,
Layout.scrollSpaceBetween,
Expand Down
1 change: 1 addition & 0 deletions src/components/SyncNeeded/SyncNeeded.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const SyncNeeded = (props: { actionStatus: (status: string) => void }) => {
>
<ScrollView
style={[Layout.fill, Common.modalBackdrop]}
contentInset={{ bottom: 80 }}
contentContainerStyle={[
Gutters.smallBPadding,
Layout.scrollSpaceBetween,
Expand Down
1 change: 1 addition & 0 deletions src/components/SyncSuccess/SyncSuccess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const SyncSuccess = (props: {
>
<ScrollView
style={[Layout.fill, Common.modalBackdrop]}
contentInset={{ bottom: 80 }}
contentContainerStyle={[
Gutters.smallBPadding,
Layout.scrollSpaceBetween,
Expand Down
1 change: 1 addition & 0 deletions src/components/TxSent/TxSent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const TxSent = (props: {
>
<ScrollView
style={[Layout.fill, Common.modalBackdrop]}
contentInset={{ bottom: 80 }}
contentContainerStyle={[
Gutters.smallBPadding,
Layout.scrollSpaceBetween,
Expand Down
5 changes: 4 additions & 1 deletion src/screens/Create/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { setInitialStateForAllChains } from '../../store';
import { useAppDispatch, useAppSelector } from '../../hooks';

import Divider from '../../components/Divider/Divider';
import PoweredByFlux from '../../components/PoweredByFlux/PoweredByFlux';

type Props = {
navigation: any;
Expand Down Expand Up @@ -242,7 +243,7 @@ function Create({ navigation }: Props) {
Layout.fullWidth,
Layout.justifyContentCenter,
Layout.alignItemsCenter,
Gutters.regularBMargin,
Gutters.largeBMargin,
]}
>
<Image
Expand Down Expand Up @@ -340,6 +341,7 @@ function Create({ navigation }: Props) {
>
<ScrollView
style={[Layout.fill, Common.modalBackdrop]}
contentInset={{ bottom: 80 }}
contentContainerStyle={[
Gutters.smallBPadding,
Layout.scrollSpaceBetween,
Expand Down Expand Up @@ -457,6 +459,7 @@ function Create({ navigation }: Props) {
</ScrollView>
<Toast />
</Modal>
<PoweredByFlux />
</KeyboardAwareScrollView>
);
}
Expand Down
2 changes: 2 additions & 0 deletions src/screens/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,8 @@ function Home({ navigation }: Props) {
);
console.log('result', result.data);
} else {
// here open sync needed modal
setSyncNeededModalOpen(true);
console.log('no wallet synced yet');
}
} catch (error) {
Expand Down
4 changes: 4 additions & 0 deletions src/screens/Restore/Restore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { setInitialStateForAllChains } from '../../store';
import { useAppSelector, useAppDispatch } from '../../hooks';

import Divider from '../../components/Divider/Divider';
import PoweredByFlux from '../../components/PoweredByFlux/PoweredByFlux';

type Props = {
navigation: any;
Expand Down Expand Up @@ -261,6 +262,7 @@ function Restore({ navigation }: Props) {
Layout.fullWidth,
Layout.justifyContentCenter,
Layout.alignItemsCenter,
Gutters.largeBMargin,
]}
>
<Image
Expand Down Expand Up @@ -369,6 +371,7 @@ function Restore({ navigation }: Props) {
>
<ScrollView
style={[Layout.fill, Common.modalBackdrop]}
contentInset={{ bottom: 80 }}
contentContainerStyle={[
Gutters.smallBPadding,
Layout.scrollSpaceBetween,
Expand Down Expand Up @@ -486,6 +489,7 @@ function Restore({ navigation }: Props) {
</ScrollView>
<Toast />
</Modal>
<PoweredByFlux />
</KeyboardAwareScrollView>
);
}
Expand Down
6 changes: 2 additions & 4 deletions src/screens/Welcome/Welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { View, Text, TouchableOpacity, ScrollView, Image } from 'react-native';
import { useTranslation } from 'react-i18next';
import { useTheme } from '../../hooks';
import PoweredByFlux from 'ssp-key/src/components/PoweredByFlux/PoweredByFlux';
import PoweredByFlux from '../../components/PoweredByFlux/PoweredByFlux';

type Props = {
navigation: any;
Expand Down Expand Up @@ -64,9 +64,7 @@ function Welcome({ navigation }: Props) {
</Text>
</TouchableOpacity>
</View>
<View style={[Layout.absolute, Layout.bottom0, Gutters.tinyBMargin]}>
<PoweredByFlux />
</View>
<PoweredByFlux />
</ScrollView>
);
}
Expand Down
2 changes: 2 additions & 0 deletions src/theme/Images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export default function ({}: ThemeVariables) {
logoWhite: require('../assets/ssp-logo-white.png'),
logoTextBlack: require('../assets/ssp-logo-text-black.png'),
logoTextWhite: require('../assets/ssp-logo-text-white.png'),
poweredByDark: require('../assets/powered_by_dark.png'),
poweredByLight: require('../assets/powered_by_light.png'),
},
};
}

0 comments on commit 4b1b48f

Please sign in to comment.