Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3406238
D7950.id26989.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D7950.id26989.diff
View Options
diff --git a/native/community-creation/community-configuration.react.js b/native/community-creation/community-configuration.react.js
new file mode 100644
--- /dev/null
+++ b/native/community-creation/community-configuration.react.js
@@ -0,0 +1,18 @@
+// @flow
+
+import * as React from 'react';
+
+import type { CommunityCreationNavigationProp } from './community-creation-navigator.react.js';
+import { type NavigationRoute } from '../navigation/route-names.js';
+
+type Props = {
+ +navigation: CommunityCreationNavigationProp<'CommunityConfiguration'>,
+ +route: NavigationRoute<'CommunityConfiguration'>,
+};
+
+// eslint-disable-next-line no-unused-vars
+function CommunityConfiguration(props: Props): React.Node {
+ return null;
+}
+
+export default CommunityConfiguration;
diff --git a/native/community-creation/community-creation-navigator.react.js b/native/community-creation/community-creation-navigator.react.js
new file mode 100644
--- /dev/null
+++ b/native/community-creation/community-creation-navigator.react.js
@@ -0,0 +1,64 @@
+// @flow
+
+import {
+ createStackNavigator,
+ type StackNavigationProp,
+ type StackNavigationHelpers,
+} from '@react-navigation/stack';
+import * as React from 'react';
+
+import CommunityConfiguration from './community-configuration.react.js';
+import type { RootNavigationProp } from '../navigation/root-navigator.react.js';
+import {
+ CommunityConfigurationRouteName,
+ type ScreenParamList,
+ type CommunityCreationParamList,
+} from '../navigation/route-names.js';
+import { useColors } from '../themes/colors.js';
+
+export type CommunityCreationNavigationProp<
+ RouteName: $Keys<CommunityCreationParamList>,
+> = StackNavigationProp<ScreenParamList, RouteName>;
+
+const CommunityCreation = createStackNavigator<
+ ScreenParamList,
+ CommunityCreationParamList,
+ StackNavigationHelpers<ScreenParamList>,
+>();
+
+const communityConfigurationOptions = {
+ headerTitle: 'Create a community',
+};
+
+type Props = {
+ +navigation: RootNavigationProp<'CommunityCreation'>,
+ ...
+};
+// eslint-disable-next-line no-unused-vars
+function CommunityCreationNavigator(props: Props): React.Node {
+ const colors = useColors();
+
+ const communityCreationScreenOptions = React.useMemo(
+ () => ({
+ headerTransparent: true,
+ headerBackTitleVisible: false,
+ headerTintColor: colors.panelForegroundLabel,
+ headerLeftContainerStyle: {
+ paddingLeft: 12,
+ },
+ }),
+ [colors.panelForegroundLabel],
+ );
+
+ return (
+ <CommunityCreation.Navigator screenOptions={communityCreationScreenOptions}>
+ <CommunityCreation.Screen
+ name={CommunityConfigurationRouteName}
+ component={CommunityConfiguration}
+ options={communityConfigurationOptions}
+ />
+ </CommunityCreation.Navigator>
+ );
+}
+
+export default CommunityCreationNavigator;
diff --git a/native/navigation/community-drawer-content.react.js b/native/navigation/community-drawer-content.react.js
--- a/native/navigation/community-drawer-content.react.js
+++ b/native/navigation/community-drawer-content.react.js
@@ -1,8 +1,9 @@
// @flow
import { useDrawerStatus } from '@react-navigation/drawer';
+import { useNavigation } from '@react-navigation/native';
import * as React from 'react';
-import { FlatList, Platform, View, Text } from 'react-native';
+import { FlatList, Platform, View, Text, TouchableOpacity } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { useSelector } from 'react-redux';
@@ -25,6 +26,7 @@
import { useResolvedThreadInfos } from 'lib/utils/entity-helpers.js';
import CommunityDrawerItemCommunity from './community-drawer-item-community.react.js';
+import { CommunityCreationRouteName } from './route-names.js';
import { useNavigateToThread } from '../chat/message-list-types.js';
import SWMansionIcon from '../components/swmansion-icon.react.js';
import { useStyles } from '../themes/colors.js';
@@ -104,20 +106,27 @@
[childThreadInfosMap, communitiesSuffixed, labelStyles],
);
+ const { navigate } = useNavigation();
+ const onPressCommunityCreation = React.useCallback(() => {
+ navigate(CommunityCreationRouteName);
+ }, [navigate]);
+
const isCommunityCreationButtonEnabled = false;
let communityCreationButton;
if (isCommunityCreationButtonEnabled) {
communityCreationButton = (
- <View style={styles.communityCreationContainer}>
- <View style={styles.communityCreationIconContainer}>
- <SWMansionIcon
- name="plus"
- size={22}
- style={styles.communityCreationIcon}
- />
+ <TouchableOpacity onPress={onPressCommunityCreation} activeOpacity={0.4}>
+ <View style={styles.communityCreationContainer}>
+ <View style={styles.communityCreationIconContainer}>
+ <SWMansionIcon
+ name="plus"
+ size={22}
+ style={styles.communityCreationIcon}
+ />
+ </View>
+ <Text style={styles.communityCreationText}>Create community</Text>
</View>
- <Text style={styles.communityCreationText}>Create community</Text>
- </View>
+ </TouchableOpacity>
);
}
diff --git a/native/navigation/root-navigator.react.js b/native/navigation/root-navigator.react.js
--- a/native/navigation/root-navigator.react.js
+++ b/native/navigation/root-navigator.react.js
@@ -42,6 +42,7 @@
RegistrationRouteName,
InviteLinkModalRouteName,
InviteLinkNavigatorRouteName,
+ CommunityCreationRouteName,
} from './route-names.js';
import LoggedOutModal from '../account/logged-out-modal.react.js';
import RegistrationNavigator from '../account/registration/registration-navigator.react.js';
@@ -54,6 +55,7 @@
import ComposeSubchannelModal from '../chat/settings/compose-subchannel-modal.react.js';
import SidebarListModal from '../chat/sidebar-list-modal.react.js';
import SubchannelsListModal from '../chat/subchannels-list-modal.react.js';
+import CommunityCreationNavigator from '../community-creation/community-creation-navigator.react.js';
import InviteLinksNavigator from '../invite-links/invite-links-navigator.react.js';
import CustomServerModal from '../profile/custom-server-modal.react.js';
@@ -201,6 +203,10 @@
component={RegistrationNavigator}
options={disableGesturesScreenOptions}
/>
+ <Root.Screen
+ name={CommunityCreationRouteName}
+ component={CommunityCreationNavigator}
+ />
<Root.Screen name={AppRouteName} component={AppNavigator} />
<Root.Screen
name={TermsAndPrivacyRouteName}
diff --git a/native/navigation/route-names.js b/native/navigation/route-names.js
--- a/native/navigation/route-names.js
+++ b/native/navigation/route-names.js
@@ -105,6 +105,8 @@
export const ConnectEthereumRouteName = 'ConnectEthereum';
export const ExistingEthereumAccountRouteName = 'ExistingEthereumAccount';
export const UsernameSelectionRouteName = 'UsernameSelection';
+export const CommunityCreationRouteName = 'CommunityCreation';
+export const CommunityConfigurationRouteName = 'CommunityConfiguration';
export const MessageSearchRouteName = 'MessageSearch';
export type RootParamList = {
@@ -121,6 +123,7 @@
+SubchannelsListModal: SubchannelListModalParams,
+MessageReactionsModal: MessageReactionsModalParams,
+Registration: void,
+ +CommunityCreation: void,
+InviteLinkModal: InviteLinkModalParams,
+InviteLinkNavigator: void,
};
@@ -208,6 +211,10 @@
+ManagePublicLink: ManagePublicLinkScreenParams,
};
+export type CommunityCreationParamList = {
+ +CommunityConfiguration: void,
+};
+
export type ScreenParamList = {
...RootParamList,
...OverlayParamList,
@@ -218,6 +225,7 @@
...CommunityDrawerParamList,
...RegistrationParamList,
...InviteLinkParamList,
+ ...CommunityCreationParamList,
};
export type NavigationRoute<RouteName: string = $Keys<ScreenParamList>> =
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 5, 1:13 AM (13 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2615391
Default Alt Text
D7950.id26989.diff (7 KB)
Attached To
Mode
D7950: [native] Introduce `CommunityCreationNavigator`
Attached
Detach File
Event Timeline
Log In to Comment