Skip to content

Commit

Permalink
feat react: add ids to a few elements
Browse files Browse the repository at this point in the history
  • Loading branch information
prplwtf committed Apr 10, 2024
1 parent 64c230d commit 6ba185a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
19 changes: 6 additions & 13 deletions resources/scripts/components/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { useState } from 'react';
import { Link, NavLink } from 'react-router-dom';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faCogs, faLayerGroup, faSignOutAlt, faPuzzlePiece } from '@fortawesome/free-solid-svg-icons';
import { faCogs, faLayerGroup, faSignOutAlt } from '@fortawesome/free-solid-svg-icons';
import { useStoreState } from 'easy-peasy';
import { ApplicationStore } from '@/state';
import SearchContainer from '@/components/dashboard/search/SearchContainer';
Expand Down Expand Up @@ -50,7 +50,7 @@ export default () => {
};

return (
<div className={'w-full bg-neutral-900 shadow-md overflow-x-auto'}>
<div className={'w-full bg-neutral-900 shadow-md overflow-x-auto'} id={'NavigationBar'}>
<BeforeNavigation />
<SpinnerOverlay visible={isLoggingOut} />
<div className={'mx-auto w-full flex items-center h-[3.5rem] max-w-[1200px]'}>
Expand All @@ -67,34 +67,27 @@ export default () => {
<RightNavigation className={'flex h-full items-center justify-center'}>
<SearchContainer />
<Tooltip placement={'bottom'} content={'Dashboard'}>
<NavLink to={'/'} exact>
<NavLink to={'/'} exact id={'NavigationDashboard'}>
<FontAwesomeIcon icon={faLayerGroup} />
</NavLink>
</Tooltip>
{rootAdmin && (
<Tooltip placement={'bottom'} content={'Admin'}>
<a href={'/admin'} rel={'noreferrer'}>
<a href={'/admin'} rel={'noreferrer'} id={'NavigationAdmin'}>
<FontAwesomeIcon icon={faCogs} />
</a>
</Tooltip>
)}
{rootAdmin && (
<Tooltip placement={'bottom'} content={'Extensions'}>
<a href={'/admin/extensions'} rel={'noreferrer'}>
<FontAwesomeIcon icon={faPuzzlePiece} />
</a>
</Tooltip>
)}
<AdditionalItems />
<Tooltip placement={'bottom'} content={'Account Settings'}>
<NavLink to={'/account'}>
<NavLink to={'/account'} id={'NavigationAccount'}>
<span className={'flex items-center w-5 h-5'}>
<Avatar.User />
</span>
</NavLink>
</Tooltip>
<Tooltip placement={'bottom'} content={'Sign Out'}>
<button onClick={onTriggerLogout}>
<button onClick={onTriggerLogout} id={'NavigationLogout'}>
<FontAwesomeIcon icon={faSignOutAlt} />
</button>
</Tooltip>
Expand Down
2 changes: 1 addition & 1 deletion resources/scripts/routers/DashboardRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default () => {
<>
<NavigationBar />
{location.pathname.startsWith('/account') && (
<SubNavigation>
<SubNavigation id={'SubNavigation'}>
<BeforeSubNavigation />
<div>
<NavigationLinks />
Expand Down
2 changes: 1 addition & 1 deletion resources/scripts/routers/ServerRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default () => {
) : (
<>
<CSSTransition timeout={150} classNames={'fade'} appear in>
<SubNavigation>
<SubNavigation id={'SubNavigation'}>
<BeforeSubNavigation />
<div>
<NavigationLinks />
Expand Down

0 comments on commit 6ba185a

Please sign in to comment.