Skip to content

Commit

Permalink
Merge pull request #1651 from dedis/work-fe1-greub-fix-BuildInfo-over…
Browse files Browse the repository at this point in the history
…-left-menu

Fix build info over left menu
  • Loading branch information
MeKHell authored Jun 7, 2023
2 parents 7fe9af8 + 73ce6b3 commit c2940af
Show file tree
Hide file tree
Showing 11 changed files with 197 additions and 64 deletions.
2 changes: 0 additions & 2 deletions fe1-web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Toast, { ToastProvider } from 'react-native-toast-notifications';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';

import { BuildInfo } from 'core/components';
import FeatureContext from 'core/contexts/FeatureContext';
import { configureKeyPair } from 'core/keypair';
import AppNavigation, { navigationRef } from 'core/navigation/AppNavigation';
Expand Down Expand Up @@ -54,7 +53,6 @@ function App() {
{Platform.OS === 'ios' && (
<StatusBar barStyle="dark-content" backgroundColor="white" />
)}
<BuildInfo />
<ToastProvider
normalColor={Color.primary}
successColor={Color.success}
Expand Down
3 changes: 1 addition & 2 deletions fe1-web/src/core/components/BuildInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import { Spacing, Typography } from 'core/styles';
const styles = StyleSheet.create({
container: {
position: 'absolute',
top: Spacing.x3,
bottom: Spacing.x075,
left: Spacing.x05,
right: Spacing.x05,
zIndex: 100,
display: 'flex',
flexDirection: 'row',
justifyContent: 'center',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ exports[`BuildInfo renders correctly 1`] = `
<View
style={
{
"bottom": 12,
"display": "flex",
"flexDirection": "row",
"justifyContent": "center",
"left": 8,
"position": "absolute",
"right": 8,
"top": 48,
"zIndex": 100,
}
}
>
Expand Down
10 changes: 6 additions & 4 deletions fe1-web/src/core/navigation/ScreenOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { StackNavigationOptions } from '@react-navigation/stack';
import { ViewStyle } from 'react-native';

import BackButton from 'core/components/BackButton';
import buildInfo from 'core/components/BuildInfo';
import ButtonPadding from 'core/components/ButtonPadding';
import DrawerMenuButton from 'core/components/DrawerMenuButton';
import { Color, Spacing, Typography } from 'core/styles';
Expand All @@ -18,6 +19,11 @@ export const stackScreenOptionsWithoutHeader: StackNavigationOptions = {
};

export const stackScreenOptionsWithHeader: StackNavigationOptions = {
headerBackground: buildInfo,
headerBackgroundContainerStyle: {
backgroundColor: Color.contrast,
borderColor: Color.separator,
},
headerLeftContainerStyle: {
flexBasis: 'auto',
paddingLeft: Spacing.contentSpacing,
Expand All @@ -31,10 +37,6 @@ export const stackScreenOptionsWithHeader: StackNavigationOptions = {
},
headerTitleStyle: Typography.topNavigationHeading,
headerTitleAlign: 'center',
headerStyle: {
backgroundColor: Color.contrast,
borderColor: Color.separator,
},
headerLeft: BackButton,
headerRight: ButtonPadding,
// Since we explicitly use scroll views for screens, we should disable scrolling for
Expand Down
1 change: 1 addition & 0 deletions fe1-web/src/core/styles/spacing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const spacingUnit = 16;

export const x025 = 0.25 * spacingUnit;
export const x05 = 0.5 * spacingUnit;
export const x075 = 0.75 * spacingUnit;
export const x1 = spacingUnit;
export const x2 = 2 * spacingUnit;
export const x3 = 3 * spacingUnit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ exports[`ConnectNavigation renders correctly 1`] = `
pointerEvents="box-none"
style={
{
"backgroundColor": "#fff",
"borderColor": "rgb(216, 216, 216)",
"bottom": 0,
"left": 0,
"opacity": 1,
Expand All @@ -387,23 +389,52 @@ exports[`ConnectNavigation renders correctly 1`] = `
}
>
<View
collapsable={false}
style={
{
"backgroundColor": "#fff",
"borderBottomColor": "rgb(216, 216, 216)",
"borderColor": "rgb(216, 216, 216)",
"flex": 1,
"shadowColor": "rgb(216, 216, 216)",
"shadowOffset": {
"height": 0.5,
"width": 0,
},
"shadowOpacity": 0.85,
"shadowRadius": 0,
"bottom": 12,
"display": "flex",
"flexDirection": "row",
"justifyContent": "center",
"left": 8,
"position": "absolute",
"right": 8,
}
}
/>
>
<Text
style={
[
{
"fontSize": 8,
"lineHeight": 1,
},
{
"color": "#8E8E8E",
},
{
"fontFamily": "Courier New",
},
{
"textTransform": "uppercase",
},
]
}
>
<Text
onPress={[Function]}
/>
<Text>
|
</Text>
<Text
onPress={[Function]}
/>
<Text>
|
</Text>
<Text />
</Text>
</View>
</View>
<View
collapsable={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ exports[`HomeNavigation renders correctly 1`] = `
pointerEvents="box-none"
style={
{
"backgroundColor": "#fff",
"borderColor": "rgb(216, 216, 216)",
"bottom": 0,
"left": 0,
"opacity": 1,
Expand All @@ -387,23 +389,52 @@ exports[`HomeNavigation renders correctly 1`] = `
}
>
<View
collapsable={false}
style={
{
"backgroundColor": "#fff",
"borderBottomColor": "rgb(216, 216, 216)",
"borderColor": "rgb(216, 216, 216)",
"flex": 1,
"shadowColor": "rgb(216, 216, 216)",
"shadowOffset": {
"height": 0.5,
"width": 0,
},
"shadowOpacity": 0.85,
"shadowRadius": 0,
"bottom": 12,
"display": "flex",
"flexDirection": "row",
"justifyContent": "center",
"left": 8,
"position": "absolute",
"right": 8,
}
}
/>
>
<Text
style={
[
{
"fontSize": 8,
"lineHeight": 1,
},
{
"color": "#8E8E8E",
},
{
"fontFamily": "Courier New",
},
{
"textTransform": "uppercase",
},
]
}
>
<Text
onPress={[Function]}
/>
<Text>
|
</Text>
<Text
onPress={[Function]}
/>
<Text>
|
</Text>
<Text />
</Text>
</View>
</View>
<View
collapsable={false}
Expand Down
6 changes: 6 additions & 0 deletions fe1-web/src/features/lao/navigation/LaoNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import React, { useMemo } from 'react';
import { StyleSheet, Text, View, ViewStyle } from 'react-native';

import { BuildInfo } from 'core/components';
import ButtonPadding from 'core/components/ButtonPadding';
import { makeIcon } from 'core/components/PoPIcon';
import { AppScreen } from 'core/navigation/AppNavigation';
Expand Down Expand Up @@ -173,6 +174,11 @@ const LaoNavigation: React.FC<unknown> = () => {
headerLeft: headerLeft || drawerNavigationOptions.headerLeft,
headerRight: headerRight || drawerNavigationOptions.headerRight,
drawerIcon: Icon,
headerBackground: BuildInfo,
headerBackgroundContainerStyle: {
backgroundColor: Color.contrast,
borderColor: Color.separator,
},
headerShown,
tabBarTestID: testID,
tabBarStyle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ exports[`OrganizerNavigation renders correctly 1`] = `
pointerEvents="box-none"
style={
{
"backgroundColor": "#fff",
"borderColor": "rgb(216, 216, 216)",
"bottom": 0,
"left": 0,
"opacity": 1,
Expand All @@ -387,23 +389,52 @@ exports[`OrganizerNavigation renders correctly 1`] = `
}
>
<View
collapsable={false}
style={
{
"backgroundColor": "#fff",
"borderBottomColor": "rgb(216, 216, 216)",
"borderColor": "rgb(216, 216, 216)",
"flex": 1,
"shadowColor": "rgb(216, 216, 216)",
"shadowOffset": {
"height": 0.5,
"width": 0,
},
"shadowOpacity": 0.85,
"shadowRadius": 0,
"bottom": 12,
"display": "flex",
"flexDirection": "row",
"justifyContent": "center",
"left": 8,
"position": "absolute",
"right": 8,
}
}
/>
>
<Text
style={
[
{
"fontSize": 8,
"lineHeight": 1,
},
{
"color": "#8E8E8E",
},
{
"fontFamily": "Courier New",
},
{
"textTransform": "uppercase",
},
]
}
>
<Text
onPress={[Function]}
/>
<Text>
|
</Text>
<Text
onPress={[Function]}
/>
<Text>
|
</Text>
<Text />
</Text>
</View>
</View>
<View
collapsable={false}
Expand Down
Loading

0 comments on commit c2940af

Please sign in to comment.