|
| 1 | +/** |
| 2 | + * Copyright 2025 Shift Crypto AG |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +import { useTranslation } from 'react-i18next'; |
| 18 | +import { Link, useLocation } from 'react-router-dom'; |
| 19 | +import { AccountIconSVG, ExchangeIconSVG, MoreIconSVG, PortfolioIconSVG } from '@/components/bottom-navigation/menu-icons'; |
| 20 | +import styles from './bottom-navigation.module.css'; |
| 21 | + |
| 22 | +export const BottomNavigation = () => { |
| 23 | + const { t } = useTranslation(); |
| 24 | + const { pathname } = useLocation(); |
| 25 | + |
| 26 | + return ( |
| 27 | + <div className={styles.container}> |
| 28 | + <Link |
| 29 | + className={`${styles.link} ${pathname.startsWith('/account-summary') ? styles.active : ''}`} |
| 30 | + to="/account-summary" |
| 31 | + > |
| 32 | + <PortfolioIconSVG /> |
| 33 | + {t('accountSummary.portfolio')} |
| 34 | + </Link> |
| 35 | + <Link |
| 36 | + className={`${styles.link} ${pathname.startsWith('/account/') || pathname.startsWith('/accounts/') ? styles.active : ''}`} |
| 37 | + to="/accounts/all" |
| 38 | + > |
| 39 | + <AccountIconSVG /> |
| 40 | + {t('settings.accounts')} |
| 41 | + </Link> |
| 42 | + <Link |
| 43 | + className={`${styles.link} ${pathname.startsWith('/exchange/') ? styles.active : ''}`} |
| 44 | + to="/exchange/info" |
| 45 | + > |
| 46 | + <ExchangeIconSVG /> |
| 47 | + {t('generic.buySell')} |
| 48 | + </Link> |
| 49 | + <Link |
| 50 | + className={`${styles.link} ${pathname.startsWith('/settings/') || pathname.startsWith('/bitsurance/') ? styles.active : ''}`} |
| 51 | + to="/settings/more" |
| 52 | + > |
| 53 | + <MoreIconSVG /> |
| 54 | + {t('settings.more')} |
| 55 | + </Link> |
| 56 | + </div> |
| 57 | + ); |
| 58 | +}; |
0 commit comments