Skip to content
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

add different colors for non-clickable files list #183

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading