Skip to content

Commit

Permalink
grey background for code frequency view
Browse files Browse the repository at this point in the history
  • Loading branch information
bigabig committed Jun 12, 2024
1 parent 24485cc commit 8c80b39
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
22 changes: 19 additions & 3 deletions frontend/src/components/User/UserSelectorMulti.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { Checkbox, FormControl, InputLabel, ListItemText, MenuItem, Select, SelectChangeEvent } from "@mui/material";
import {
Checkbox,
FormControl,
FormControlProps,
InputLabel,
ListItemText,
MenuItem,
Select,
SelectChangeEvent,
} from "@mui/material";
import React from "react";
import ProjectHooks from "../../api/ProjectHooks.ts";
import UserName from "./UserName.tsx";
Expand All @@ -10,7 +19,13 @@ interface UserSelectorProps {
title: string;
}

function UserSelectorMulti({ projectId, userIds, onUserIdChange, title }: UserSelectorProps) {
function UserSelectorMulti({
projectId,
userIds,
onUserIdChange,
title,
...props
}: UserSelectorProps & FormControlProps) {
// global server state (react query)
const projectUsers = ProjectHooks.useGetAllUsers(projectId);

Expand All @@ -21,7 +36,7 @@ function UserSelectorMulti({ projectId, userIds, onUserIdChange, title }: UserSe

// render
return (
<FormControl>
<FormControl {...props}>
<InputLabel id="multi-user-select-label">{title}</InputLabel>
<Select
labelId="multi-user-select-label"
Expand All @@ -30,6 +45,7 @@ function UserSelectorMulti({ projectId, userIds, onUserIdChange, title }: UserSe
multiple
onChange={handleChange}
disabled={!projectUsers.isSuccess}
fullWidth
renderValue={(userIds) =>
userIds.map((userId, index) => (
<React.Fragment key={userId}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function CodeFrequencyAnalysis() {
}, [selectedUserIds]);

return (
<Grid container columnSpacing={1} className="h100" px={2} pt={2}>
<Grid container columnSpacing={1} className="h100" px={2} pt={2} bgcolor="grey.200">
{codeTree ? (
<>
<Portal container={appBarContainerRef?.current}>
Expand All @@ -44,6 +44,8 @@ function CodeFrequencyAnalysis() {
userIds={selectedUserIds}
onUserIdChange={setSelectedUserIds}
title="User(s)"
fullWidth
sx={{ bgcolor: "background.paper" }}
/>
{selectedUserIds.length === 0 ? (
<Card variant="outlined">
Expand Down

0 comments on commit 8c80b39

Please sign in to comment.