Skip to content

Commit

Permalink
chore: updated sidebar options
Browse files Browse the repository at this point in the history
  • Loading branch information
OtavioStasiak committed Jan 28, 2025
1 parent ffb4cd8 commit 9c6df22
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 32 deletions.
Binary file modified android/app/src/main/assets/fonts/custom.ttf
Binary file not shown.
1 change: 1 addition & 0 deletions app/containers/CustomIcon/mappedIcons.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const mappedIcons = {
'accessibility': 59855,
'add': 59872,
'administration': 59662,
'adobe-reader-monochromatic': 59663,
Expand Down
2 changes: 1 addition & 1 deletion app/containers/CustomIcon/selection.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions app/stacks/InsideStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ import {
InsideStackParamList,
NewMessageStackParamList,
ProfileStackParamList,
SettingsStackParamList
SettingsStackParamList,
AccessibilityStackParamList
} from './types';
import { isIOS } from '../lib/methods/helpers';
import { TNavigation } from './stackType';
Expand Down Expand Up @@ -185,7 +186,6 @@ const SettingsStackNavigator = () => {
<SettingsStack.Screen name='PushTroubleshootView' component={PushTroubleshootView} />
<SettingsStack.Screen name='E2EEncryptionSecurityView' component={E2EEncryptionSecurityView} />
<SettingsStack.Screen name='LanguageView' component={LanguageView} />
<SettingsStack.Screen name='ThemeView' component={ThemeView} />
<SettingsStack.Screen name='DefaultBrowserView' component={DefaultBrowserView} />
<SettingsStack.Screen name='MediaAutoDownloadView' component={MediaAutoDownloadView} />
<SettingsStack.Screen name='GetHelpView' component={GetHelpView} />
Expand Down Expand Up @@ -213,15 +213,15 @@ const AdminPanelStackNavigator = () => {
);
};

// DisplayPreferenceNavigator
const DisplayPrefStack = createNativeStackNavigator<DisplayPrefStackParamList>();
const DisplayPrefStackNavigator = () => {
// AccessibilityStackNavigator
const AccessibilityStack = createNativeStackNavigator<AccessibilityStackParamList>();
const AccessibilityStackNavigator = () => {
const { theme } = React.useContext(ThemeContext);

return (
<DisplayPrefStack.Navigator screenOptions={{ ...defaultHeader, ...themedHeader(theme) }}>
<DisplayPrefStack.Screen name='DisplayPrefsView' component={DisplayPrefsView} />
</DisplayPrefStack.Navigator>
<AccessibilityStack.Navigator screenOptions={{ ...defaultHeader, ...themedHeader(theme) }}>
<AccessibilityStack.Screen name='DisplayPrefsView' component={DisplayPrefsView} />
<AccessibilityStack.Screen name='ThemeView' component={ThemeView} />
</AccessibilityStack.Navigator>
);
};

Expand All @@ -246,7 +246,7 @@ const DrawerNavigator = () => {
<Drawer.Screen name='ProfileStackNavigator' component={ProfileStackNavigator} />
<Drawer.Screen name='SettingsStackNavigator' component={SettingsStackNavigator} />
<Drawer.Screen name='AdminPanelStackNavigator' component={AdminPanelStackNavigator} />
<Drawer.Screen name='DisplayPrefStackNavigator' component={DisplayPrefStackNavigator} />
<Drawer.Screen name='AccessibilityStackNavigator' component={AccessibilityStackNavigator} />
</Drawer.Navigator>
);
};
Expand Down
39 changes: 22 additions & 17 deletions app/stacks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ export type ChatsStackParamList = {
NewMessageStack: undefined;
RoomsListView: undefined;
RoomView:
| {
rid: string;
t: SubscriptionType;
tmid?: string;
messageId?: string;
name?: string;
fname?: string;
prid?: string;
room?: TSubscriptionModel | { rid: string; t: string; name?: string; fname?: string; prid?: string };
jumpToMessageId?: string;
jumpToThreadId?: string;
roomUserId?: string | null;
usedCannedResponse?: string;
status?: string;
| {
rid: string;
t: SubscriptionType;
tmid?: string;
messageId?: string;
name?: string;
fname?: string;
prid?: string;
room?: TSubscriptionModel | { rid: string; t: string; name?: string; fname?: string; prid?: string };
jumpToMessageId?: string;
jumpToThreadId?: string;
roomUserId?: string | null;
usedCannedResponse?: string;
status?: string;
}
| undefined; // Navigates back to RoomView already on stack
| undefined; // Navigates back to RoomView already on stack
RoomActionsView: {
room: TSubscriptionModel;
member?: any;
Expand Down Expand Up @@ -210,7 +210,6 @@ export type SettingsStackParamList = {
SecurityPrivacyView: undefined;
E2EEncryptionSecurityView: undefined;
LanguageView: undefined;
ThemeView: undefined;
DefaultBrowserView: undefined;
ScreenLockConfigView: undefined;
ProfileView: undefined;
Expand All @@ -224,6 +223,12 @@ export type AdminPanelStackParamList = {
AdminPanelView: undefined;
};

export type AccessibilityStackParamList = {
AccessibilityAndAppearanceView: undefined;
DisplayPrefsView: undefined;
ThemeView: undefined;
};

export type DisplayPrefStackParamList = {
DisplayPrefsView: undefined;
};
Expand All @@ -233,7 +238,7 @@ export type DrawerParamList = {
ProfileStackNavigator: NavigatorScreenParams<ProfileStackParamList>;
SettingsStackNavigator: NavigatorScreenParams<SettingsStackParamList>;
AdminPanelStackNavigator: NavigatorScreenParams<AdminPanelStackParamList>;
DisplayPrefStackNavigator: NavigatorScreenParams<DisplayPrefStackParamList>;
AccessibilityStackNavigator: NavigatorScreenParams<AccessibilityStackParamList>;
};

export type NewMessageStackParamList = {
Expand Down
8 changes: 4 additions & 4 deletions app/views/SidebarView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@ class Sidebar extends Component<ISidebarProps, ISidebarState> {
/>
<List.Separator />
<List.Item
title={'Display'}
left={() => <List.Icon name='sort' />}
onPress={() => this.sidebarNavigate('DisplayPrefStackNavigator')}
backgroundColor={this.currentItemKey === 'DisplayPrefStackNavigator' ? themes[theme!].strokeLight : undefined}
title={'Accessibility'}
left={() => <List.Icon name='accessibility' />}
onPress={() => this.sidebarNavigate('AccessibilityStackNavigator')}
backgroundColor={this.currentItemKey === 'AccessibilityStackNavigator' ? themes[theme!].strokeLight : undefined}
testID='sidebar-display'
/>
<List.Separator />
Expand Down
Binary file modified ios/custom.ttf
Binary file not shown.

0 comments on commit 9c6df22

Please sign in to comment.