Skip to content

Commit

Permalink
add different colors for non-clickable files list
Browse files Browse the repository at this point in the history
  • Loading branch information
sumn2u committed Jul 31, 2024
1 parent aba55c9 commit f720cde
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion client/src/Annotator/reducers/general-reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ export default (state, action) => {
case "SELECT_FILE": {
const { selected } = action
if (!activeImage) return state
return setIn(state, [...pathToActiveImage, "selected"], selected)
const updatedState = setIn(state, [...pathToActiveImage, "selected"], selected);
const isAnyImageSelected = updatedState.images.some(image => image.selected);
return setIn(updatedState, ["enabledDownload"], isAnyImageSelected);
}

case "SELECT_REGION": {
Expand Down
7 changes: 7 additions & 0 deletions client/src/FilesListMenu/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ export const FilesListMenu = ({
selectedImage !== null && selectedImage !== index
? "not-allowed"
: "pointer",
"&.Mui-disabled": {
background: !hasRegions(index) ? muiColors.grey[400] : "auto",
cursor: "not-allowed",
borderRadius: 0,
width: 14,
height: 14,
},
}}
checked={image.selected}
onClick={() => handleCheckBoxClick(image, index)}
Expand Down
1 change: 0 additions & 1 deletion client/src/ThemeContext/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export const ThemeProvider = ({ children }) => {
}

const preferredColorScheme = getPreferredColorScheme();
console.log(`Preferred color scheme: ${preferredColorScheme}`);

const [theme, setTheme] = useState(preferredColorScheme); // Default to browser theme

Expand Down

0 comments on commit f720cde

Please sign in to comment.