Skip to content

feat(site): add basic organization management ui #13288

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

Merged
merged 24 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
🧹
  • Loading branch information
aslilac committed Jun 11, 2024
commit f8ccd9652fd4b759629b714c8f6f3f170b30c02c
1 change: 0 additions & 1 deletion site/src/api/queries/organizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const updateOrganization = (queryClient: QueryClient) => {
API.updateOrganization(variables.orgId, variables.req),

onSuccess: async () => {
await queryClient.invalidateQueries(meKey);
await queryClient.invalidateQueries(myOrganizationsKey);
},
};
Expand Down
62 changes: 13 additions & 49 deletions site/src/components/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,29 +77,6 @@ export const SidebarNavItem: FC<SidebarNavItemProps> = ({
);
};

interface SidebarNavSubItemProps {
children?: ReactNode;
href: string;
}

export const SidebarNavSubItem: FC<SidebarNavSubItemProps> = ({
children,
href,
}) => {
const link = useClassName(classNames.subLink, []);
const activeLink = useClassName(classNames.activeSubLink, []);

return (
<NavLink
end
to={href}
className={({ isActive }) => cx([link, isActive && activeLink])}
>
{children}
</NavLink>
);
};

const styles = {
sidebar: {
width: 245,
Expand Down Expand Up @@ -141,35 +118,22 @@ const classNames = {
&:hover {
background-color: ${theme.palette.action.hover};
}

border-left: 3px solid transparent;
`,

activeLink: (css, theme) => css`
border-left-color: ${theme.palette.primary.main};
`,

subLink: (css, theme) => css`
color: inherit;
text-decoration: none;

display: block;
font-size: 13px;
margin-left: 16px;
padding: 8px;
border-radius: 4px;
transition: background-color 0.15s ease-in-out;
margin-bottom: 1px;
position: relative;
border-left: 3px solid transparent;

&:hover {
background-color: ${theme.palette.action.hover};
background-color: ${theme.palette.action.hover};

&:before {
content: "";
display: block;
width: 3px;
height: 100%;
position: absolute;
left: 0;
top: 0;
background-color: ${theme.palette.primary.main};
border-top-left-radius: 8px;
border-bottom-left-radius: 8px;
}
`,

activeSubLink: (css, theme) => css`
border-left-color: ${theme.palette.primary.main};
font-weight: 500;
`,
} satisfies Record<string, ClassName>;
Loading