Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@swm/global nav menu v2 #29104

Closed
Closed
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
9ef6f2e
initial
adamgrzybowski Oct 5, 2023
8ad3d95
add icons
adamgrzybowski Oct 9, 2023
8d0b65b
center text for global nav items
adamgrzybowski Oct 9, 2023
753bd94
styles and consts for subnavigation
adamgrzybowski Oct 9, 2023
a7fc762
fix typo
adamgrzybowski Oct 12, 2023
6d2f27e
integrate iframe into customStackNavigator
adamgrzybowski Oct 12, 2023
76f9ae4
change name to individual_workspace
adamgrzybowski Oct 13, 2023
566a6ca
use useMemo in createCustomStackNavigator
adamgrzybowski Oct 13, 2023
ec1f327
fix comments
adamgrzybowski Oct 16, 2023
fbf2af8
use last in getTopMostCentralPaneRoute
adamgrzybowski Oct 16, 2023
1b39f1e
remove IframeTest
adamgrzybowski Oct 16, 2023
c51495e
use existing translation for workspace
adamgrzybowski Oct 16, 2023
2134a31
remove title from options for centralPaneNavigator
adamgrzybowski Oct 16, 2023
4edfeb1
adjust links in iframe screen
adamgrzybowski Oct 16, 2023
1ebab67
Merge branch 'main' into @swm/global-nav-menu-v2
adamgrzybowski Oct 16, 2023
0cde5ef
adjust IFrame
adamgrzybowski Oct 17, 2023
2fe4074
fix comments
adamgrzybowski Oct 17, 2023
47a1cb0
filter global nav options for small screen
adamgrzybowski Oct 17, 2023
4564260
add HeaderWithBreadcrumbs
adamgrzybowski Oct 17, 2023
ba2fd0c
add bigger screen needed screen
kosmydel Oct 17, 2023
1bfe146
move styles for iframe to styles.ts
adamgrzybowski Oct 17, 2023
ccb3886
add example submenu with breadcrumbs
adamgrzybowski Oct 17, 2023
ac3c8d6
Merge branch 'main' into @swm/global-nav-menu-v2
adamgrzybowski Oct 18, 2023
f40c1c0
fix linting errors
adamgrzybowski Oct 18, 2023
2ebf10e
add isInNewDot param to the olddot url
adamgrzybowski Oct 18, 2023
87668ee
fix addIsInNewDotParam name
adamgrzybowski Oct 18, 2023
ef28cfd
add isDarkMode param
adamgrzybowski Oct 18, 2023
c8c7293
add icons for subnav
adamgrzybowski Oct 18, 2023
58dec78
add rounded corner for home screen
adamgrzybowski Oct 18, 2023
cb94460
change name of empty screen
adamgrzybowski Oct 19, 2023
a414d38
adjust styles of subnavigation menu items
adamgrzybowski Oct 19, 2023
474abf7
change INDIVIDUALS_OLDDOT to INDIVIDUAL_OLDDOT
adamgrzybowski Oct 19, 2023
8ea722c
change isHomeOdSelected to isScreenWithoutSubnavSelected
adamgrzybowski Oct 19, 2023
0f4528a
fix typos
adamgrzybowski Oct 19, 2023
deea594
add consts for olddot url sections
adamgrzybowski Oct 19, 2023
70e9f3d
add translation for global nav
adamgrzybowski Oct 23, 2023
6e91853
add nested subnavigation menus
adamgrzybowski Oct 23, 2023
f0205cf
adjust iframe
adamgrzybowski Oct 23, 2023
09a2edd
Merge branch 'main' into @swm/global-nav-menu-v2
adamgrzybowski Oct 23, 2023
dadac31
use decode uri component for olddot urls
adamgrzybowski Oct 23, 2023
7869f8c
Merge branch 'main' into @swm/global-nav-menu-v2
adamgrzybowski Oct 23, 2023
5596354
Merge branch 'main' into @swm/global-nav-menu-v2
adamgrzybowski Oct 30, 2023
662018a
Merge branch 'main' into @swm/global-nav-menu-v2
adamgrzybowski Oct 31, 2023
f43f741
fix bigger screen blocking view
adamgrzybowski Oct 31, 2023
b1cbad1
fix imports
adamgrzybowski Oct 31, 2023
6bf0d44
change base url for iframe
adamgrzybowski Oct 31, 2023
da480e3
use replace instead of changing src
adamgrzybowski Oct 31, 2023
d2688b7
Merge branch 'main' into @swm/global-nav-menu-v2
WojtekBoman Nov 10, 2023
3819ac1
Merge branch 'main' into @swm/global-nav-menu-v2
adamgrzybowski Nov 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions assets/images/cards-domains.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98 changes: 98 additions & 0 deletions assets/images/empty-state__biggerscreen.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions assets/images/feed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions assets/images/lightbulb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2760,10 +2760,18 @@ const CONST = {
GLOBAL_NAVIGATION_OPTION: {
HOME: 'home',
CHATS: 'chats',
SPEND: 'spend',
MONEY: 'money',
WORKSPACES: 'workspaces',
},

SUB_NAVIGATION_MENU: {
HOME: 'home',
CHATS: 'chats',
MONEY: 'money',
WORKSPACES: 'workspaces',
DOMAINS: 'domains',
},

MISSING_TRANSLATION: 'MISSING TRANSLATION',
SEARCH_MAX_LENGTH: 500,

Expand Down
4 changes: 2 additions & 2 deletions src/GLOBAL_NAVIGATION_MAPPING.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import SCREENS from './SCREENS';
export default {
[CONST.GLOBAL_NAVIGATION_OPTION.HOME]: [SCREENS.HOME_OLDDOT],
[CONST.GLOBAL_NAVIGATION_OPTION.CHATS]: [SCREENS.REPORT],
[CONST.GLOBAL_NAVIGATION_OPTION.SPEND]: [SCREENS.EXPENSES_OLDDOT, SCREENS.REPORTS_OLDDOT, SCREENS.INSIGHTS_OLDDOT],
[CONST.GLOBAL_NAVIGATION_OPTION.WORKSPACES]: [SCREENS.INDIVIDUAL_WORKSPACES_OLDDOT, SCREENS.GROUPS_WORKSPACES_OLDDOT, SCREENS.CARDS_AND_DOMAINS_OLDDOT],
[CONST.GLOBAL_NAVIGATION_OPTION.MONEY]: [SCREENS.EXPENSES_OLDDOT, SCREENS.REPORTS_OLDDOT, SCREENS.INSIGHTS_OLDDOT],
[CONST.GLOBAL_NAVIGATION_OPTION.WORKSPACES]: [SCREENS.INDIVIDUAL_WORKSPACE_OLDDOT, SCREENS.GROUPS_WORKSPACES_OLDDOT, SCREENS.DOMAINS_OLDDOT, SCREENS.DOMAIN_OLDDOT_TEST],
} as const;
19 changes: 16 additions & 3 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,26 @@ export default {
// Iframe screens from olddot
HOME_OLDDOT: 'home',

// Spend tab
// Money tab
EXPENSES_OLDDOT: 'expenses',
REPORTS_OLDDOT: 'reports',
INSIGHTS_OLDDOT: 'insights',

// Workspaces tab
adamgrzybowski marked this conversation as resolved.
Show resolved Hide resolved
INDIVIDUALS_OLDDOT: 'individual_workspaces',
INDIVIDUALS_OLDDOT: 'individual_workspace',
adamgrzybowski marked this conversation as resolved.
Show resolved Hide resolved
GROUPS_OLDDOT: 'group_workspaces',
CARDS_AND_DOMAINS_OLDDOT: 'cards-and-domains',

DOMAINS_OLDDOT: 'domains',

DOMAIN_OLDDOT: {
route: 'domain/:section',
getRoute: (section: string) => `domain/${section}`,
},

WORKSPACES_OLDDOT: {
route: 'workspaces/:workspaceID/:section',
getRoute: (workspaceID: string, section: string) => `workspaces/${workspaceID}/${section}`,
},

DOMAIN_OLDDOT_TEST: 'domain_test',
} as const;
12 changes: 9 additions & 3 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,19 @@ export default {
// Iframe screens from olddot
HOME_OLDDOT: 'Home_OLDDOT',

// Spend tab
// Money tab
EXPENSES_OLDDOT: 'Expenses_OLDDOT',
REPORTS_OLDDOT: 'Reports_OLDDOT',
INSIGHTS_OLDDOT: 'Insights_OLDDOT',

// Workspaces tab
INDIVIDUAL_WORKSPACES_OLDDOT: 'IndividualWorkspaces_OLDDOT',
INDIVIDUAL_WORKSPACE_OLDDOT: 'IndividualWorkspaces_OLDDOT',
GROUPS_WORKSPACES_OLDDOT: 'GroupWorkspaces_OLDDOT',
CARDS_AND_DOMAINS_OLDDOT: 'CardsAndDomains_OLDDOT',
DOMAINS_OLDDOT: 'Domains_OLDDOT',
adamgrzybowski marked this conversation as resolved.
Show resolved Hide resolved
DOMAIN_OLDDOT: 'Domain_OLDDOT',

// Breadcrumb screens
DOMAIN_OLDDOT_TEST: 'Domain_OLDDOT_TEST',
adamgrzybowski marked this conversation as resolved.
Show resolved Hide resolved

WORKSPACE_OLDDOT: 'Workspace_OLDDOT',
} as const;
11 changes: 11 additions & 0 deletions src/SUB_NAVIGATION_MENU_MAPPING.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import CONST from './CONST';
import SCREENS from './SCREENS';

export default {
[CONST.SUB_NAVIGATION_MENU.HOME]: [SCREENS.HOME_OLDDOT],
[CONST.SUB_NAVIGATION_MENU.CHATS]: [SCREENS.REPORT],
[CONST.SUB_NAVIGATION_MENU.MONEY]: [SCREENS.EXPENSES_OLDDOT, SCREENS.REPORTS_OLDDOT, SCREENS.INSIGHTS_OLDDOT],
[CONST.SUB_NAVIGATION_MENU.WORKSPACES]: [SCREENS.INDIVIDUAL_WORKSPACE_OLDDOT, SCREENS.GROUPS_WORKSPACES_OLDDOT, SCREENS.DOMAINS_OLDDOT],
// Breadcrumbs menus
[CONST.SUB_NAVIGATION_MENU.DOMAINS]: [SCREENS.DOMAIN_OLDDOT_TEST],
} as const;
38 changes: 38 additions & 0 deletions src/components/BlockingViews/FullPageBiggerScreenView.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from 'react';
import PropTypes from 'prop-types';
import * as Illustrations from '../Icon/Illustrations';
import Navigation from '../../libs/Navigation/Navigation';
import BlockingView from './BlockingView';
import useLocalize from '../../hooks/useLocalize';
import withWindowDimensions, {windowDimensionsPropTypes} from '../withWindowDimensions';

const propTypes = {
/** Child elements */
children: PropTypes.node.isRequired,

...windowDimensionsPropTypes,
};

function FullPageBiggerScreenView({isSmallScreenWidth, children}) {
const {translate} = useLocalize();

if (isSmallScreenWidth) {
return (
<BlockingView
icon={Illustrations.BiggerScreen}
title={translate('common.biggerScreenNeeded.title')}
subtitle={translate('common.biggerScreenNeeded.subtitle')}
linkKey="notFound.goBackHome"
onLinkPress={Navigation.goBack}
shouldShowLink
/>
);
}

return children;
}

FullPageBiggerScreenView.propTypes = propTypes;
FullPageBiggerScreenView.displayName = 'FullPageBiggerScreenView';

export default withWindowDimensions(FullPageBiggerScreenView);
Loading