Skip to content

Commit 268e412

Browse files
authored
removed showHamburgerMenu config (#3080)
* removed showHamburgerMenu config * remove unused component
1 parent 7e6f881 commit 268e412

File tree

9 files changed

+13
-141
lines changed

9 files changed

+13
-141
lines changed

wormhole-connect/docs/config.md

-31
Original file line numberDiff line numberDiff line change
@@ -171,37 +171,6 @@ You can provide a whietlist of routes under `routes`. By default, Connect will o
171171

172172
Required in order to display Wallet Connect as a wallet option. You can get a project ID on https://cloud.walletconnect.com/. Refer to the wallet connect [documentation](https://docs.walletconnect.com/advanced/migration-from-v1.x/overview) for more information on v2.
173173

174-
### Toggle Hamburguer Menu
175-
176-
By setting the `showHamburgerMenu` option to **false**, you can deactivate the hamburger menu, causing the links to be positioned at the bottom.
177-
178-
#### Add extra menu entry
179-
180-
By setting the `showHamburgerMenu` option to **false**, you can use the `menu` array to add extra links.
181-
182-
| property | description |
183-
| --------------- | ------------------------------------------- |
184-
| `menu[].label` | link name to show up |
185-
| `menu[].href` | target url or urn |
186-
| `menu[].target` | anchor standard target, by default `_blank` |
187-
| `menu[].order` | order where the new item should be injected |
188-
189-
#### Sample configuration
190-
191-
```json
192-
{
193-
"showHamburgerMenu": false,
194-
"menu": [
195-
{
196-
"label": "Advance Tools",
197-
"href": "https://portalbridge.com",
198-
"target": "_self",
199-
"order": 1
200-
}
201-
]
202-
}
203-
```
204-
205174
### CoinGecko API Key
206175

207176
If you have a CoinGecko API Plan, you can include the API key in the configuration. In case you do not have the API key, [follow this steps](https://apiguide.coingecko.com/getting-started/getting-started).

wormhole-connect/src/components/MenuFull.tsx

-65
This file was deleted.

wormhole-connect/src/components/PageHeader.tsx

+4-9
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@ import { makeStyles } from 'tss-react/mui';
44
import { setRoute } from 'store/router';
55

66
import Header, { Alignment } from './Header';
7-
import MenuFull from './MenuFull';
87
import DownIcon from 'icons/Down';
98

109
const useStyles = makeStyles<{
11-
showHamburgerMenu: boolean;
1210
align: Alignment;
13-
}>()((theme, { showHamburgerMenu, align }) => ({
11+
}>()((theme, { align }) => ({
1412
container: {
1513
width: '100%',
1614
display: 'flex',
1715
flexDirection: 'column',
1816
gap: '8px',
19-
marginBottom: showHamburgerMenu ? '40px' : '0px',
17+
marginBottom: '0px',
2018
[theme.breakpoints.down('sm')]: {
2119
marginBottom: '20px',
2220
},
@@ -42,7 +40,7 @@ const useStyles = makeStyles<{
4240
fontWeight: '300',
4341
fontSize: '14px',
4442
opacity: '0.6',
45-
marginBottom: showHamburgerMenu ? '0px' : '40px',
43+
marginBottom: '40px',
4644
},
4745
}));
4846

@@ -51,7 +49,6 @@ type PageHeaderProps = {
5149
align?: Alignment;
5250
description?: string;
5351
back?: boolean;
54-
showHamburgerMenu?: boolean;
5552
testId?: string;
5653
};
5754

@@ -60,10 +57,9 @@ function PageHeader({
6057
title,
6158
align = 'left',
6259
description,
63-
showHamburgerMenu = true,
6460
testId,
6561
}: PageHeaderProps) {
66-
const { classes } = useStyles({ showHamburgerMenu, align });
62+
const { classes } = useStyles({ align });
6763
const dispatch = useDispatch();
6864
function goBack() {
6965
dispatch(setRoute('bridge'));
@@ -82,7 +78,6 @@ function PageHeader({
8278
)}
8379
<Header text={title} align={align} testId={testId} />
8480
</div>
85-
{showHamburgerMenu ? <MenuFull /> : null}
8681
</div>
8782
{description && <div className={classes.description}>{description}</div>}
8883
</div>

wormhole-connect/src/config/ui.ts

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export type UiConfig = {
1414
searchTx?: SearchTxConfig;
1515
partnerLogo?: string;
1616
walletConnectProjectId?: string;
17-
showHamburgerMenu?: boolean;
1817
previewMode?: boolean; // Disables making transfers
1918

2019
getHelpUrl?: string;

wormhole-connect/src/views/Terms.tsx

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import { makeStyles } from 'tss-react/mui';
33
import PageHeader from 'components/PageHeader';
4-
import config from 'config';
54
import FooterNavBar from 'components/FooterNavBar';
65

76
const useStyles = makeStyles()(() => ({
@@ -25,11 +24,7 @@ function Terms() {
2524
const { classes } = useStyles();
2625
return (
2726
<div className={classes.terms}>
28-
<PageHeader
29-
title="Terms"
30-
back
31-
showHamburgerMenu={config.ui.showHamburgerMenu}
32-
/>
27+
<PageHeader title="Terms" back />
3328
<div className={classes.body}>
3429
<div>Disclaimer:</div>
3530

@@ -74,7 +69,7 @@ function Terms() {
7469
third-party activities.
7570
</div>
7671
</div>
77-
{config.ui.showHamburgerMenu ? null : <FooterNavBar />}
72+
<FooterNavBar />
7873
</div>
7974
);
8075
}

wormhole-connect/src/views/TxSearch.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ function TxSearch() {
169169
<PageHeader
170170
title="Resume transaction"
171171
description="Bridging can require a manual redemption process on the designation chain. If you did not complete the redemption during your initial transaction, you may do so here."
172-
showHamburgerMenu={config.ui.showHamburgerMenu}
173172
back
174173
/>
175174

@@ -213,11 +212,9 @@ function TxSearch() {
213212
<Button disabled={!state.chain || !state.tx} elevated onClick={search}>
214213
{loading ? <CircularProgress size={24} /> : 'Search'}
215214
</Button>
216-
{config.ui.showHamburgerMenu ? null : (
217-
<div className={classes.footerNavBar}>
218-
<FooterNavBar />
219-
</div>
220-
)}
215+
<div className={classes.footerNavBar}>
216+
<FooterNavBar />
217+
</div>
221218
</div>
222219
);
223220
}

wormhole-connect/src/views/v2/Bridge/index.tsx

+2-8
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,7 @@ const Bridge = () => {
291291
headerConfig = { ...defaults, ...config.ui.pageHeader };
292292
}
293293

294-
return (
295-
<PageHeader
296-
title={headerConfig.text}
297-
align={headerConfig.align}
298-
showHamburgerMenu={config.ui.showHamburgerMenu}
299-
/>
300-
);
294+
return <PageHeader title={headerConfig.text} align={headerConfig.align} />;
301295
}, [config.ui]);
302296

303297
// Asset picker for the source network and token
@@ -510,7 +504,7 @@ const Bridge = () => {
510504
walletConnector
511505
)}
512506
</span>
513-
{config.ui.showHamburgerMenu ? null : <FooterNavBar />}
507+
<FooterNavBar />
514508
<div className={classes.poweredBy}>
515509
<PoweredByIcon color={theme.palette.text.primary} />
516510
</div>

wormhole-connect/src/views/v2/Redeem/index.tsx

+1-7
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,7 @@ const Redeem = () => {
369369
headerConfig = { ...defaults, ...config.ui.pageHeader };
370370
}
371371

372-
return (
373-
<PageHeader
374-
title={headerConfig.text}
375-
align={headerConfig.align}
376-
showHamburgerMenu={config.ui.showHamburgerMenu}
377-
/>
378-
);
372+
return <PageHeader title={headerConfig.text} align={headerConfig.align} />;
379373
}, []);
380374

381375
// Header showing the status of the transaction

wormhole-connect/src/views/v2/TxHistory/index.tsx

+1-7
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,7 @@ const TxHistory = () => {
9090
headerConfig = { ...defaults, ...config.ui.pageHeader };
9191
}
9292

93-
return (
94-
<PageHeader
95-
title={headerConfig.text}
96-
align={headerConfig.align}
97-
showHamburgerMenu={config.ui.showHamburgerMenu}
98-
/>
99-
);
93+
return <PageHeader title={headerConfig.text} align={headerConfig.align} />;
10094
}, []);
10195

10296
// Header for Transaction History, which includes the title and settings icon

0 commit comments

Comments
 (0)