Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
olwalkey committed Nov 23, 2024
2 parents c3d145c + e4088bc commit 6757e9d
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions resources/scripts/routers/ServerRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import HugeIconsDashboardSettings from '@/components/elements/hugeicons/Dashboar
import HugeIconsDatabase from '@/components/elements/hugeicons/Database';
import HugeIconsFolder from '@/components/elements/hugeicons/Folder';
import HugeIconsHome from '@/components/elements/hugeicons/Home';
import HugeIconsPencil from '@/components/elements/hugeicons/Pencil';
import HugeIconsPeople from '@/components/elements/hugeicons/People';
import ConflictStateRenderer from '@/components/server/ConflictStateRenderer';
import InstallListener from '@/components/server/InstallListener';
Expand Down Expand Up @@ -146,6 +147,7 @@ export default () => {
const NavigationStartup = useRef(null);
const NavigationSchedules = useRef(null);
const NavigationSettings = useRef(null);
const NavigationActivity = useRef(null);
const NavigationShell = useRef(null);

const calculateTop = (pathname: string) => {
Expand All @@ -162,6 +164,7 @@ export default () => {
const ButtonSchedules = NavigationSchedules.current;
const ButtonSettings = NavigationSettings.current;
const ButtonShell = NavigationShell.current;
const ButtonActivity = NavigationActivity.current;

// Perfectly center the page highlighter with simple math.
// Height of navigation links (56) minus highlight height (40) equals 16. 16 devided by 2 is 8.
Expand Down Expand Up @@ -191,6 +194,8 @@ export default () => {
return (ButtonSettings as any).offsetTop + HighlightOffset;
if (pathname.endsWith(`/server/${id}/shell`) && ButtonShell != null)
return (ButtonShell as any).offsetTop + HighlightOffset;
if (pathname.endsWith(`/server/${id}/activity`) && ButtonActivity != null)
return (ButtonActivity as any).offsetTop + HighlightOffset;
return '0';
};

Expand Down Expand Up @@ -389,6 +394,17 @@ export default () => {
<p>Settings</p>
</NavLink>
</Can>
<Can action={['activity.*', 'activity.read']} matchAny>
<NavLink
className='flex flex-row items-center'
ref={NavigationActivity}
to={`/server/${id}/activity`}
end
>
<HugeIconsPencil fill='currentColor' />
<p>Activity</p>
</NavLink>
</Can>
</>
)}
<Can action={'startup.software'}>
Expand All @@ -402,14 +418,6 @@ export default () => {
<p>Software</p>
</NavLink>
</Can>
{/* {rootAdmin && (
<a href={`/admin/servers/view/${serverId}`} target={'_blank'} rel='noreferrer'>
<div className='ml-1'>Manage Server </div>
<span className='z-10 rounded-full bg-zinc-600 px-2 py-1 text-xs text-white'>
Staff
</span>
</a>
)} */}
</ul>
</MainSidebar>
<CommandMenu />
Expand Down

0 comments on commit 6757e9d

Please sign in to comment.