Skip to content
Open
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
fix few stuff
  • Loading branch information
PiyushChandra17 committed Jun 15, 2024
commit 64a4bbb39731b93fbcbc48f65b12779c74c85e8d
2 changes: 2 additions & 0 deletions client/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,5 @@ export const START_SAVING_PROJECT = 'START_SAVING_PROJECT';
export const END_SAVING_PROJECT = 'END_SAVING_PROJECT';

export const SET_COOKIE_CONSENT = 'SET_COOKIE_CONSENT';

export const SET_SEARCH_TERM = 'SET_SEARCH_TERM';
4 changes: 2 additions & 2 deletions client/modules/IDE/actions/sorting.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as ActionTypes from '../../../constants';
import { sortingActions } from '../reducers/sorting';
import { setSorting } from '../reducers/sorting';

export const { toggleDirection, setSorting } = sortingActions;
export { toggleDirectionForField } from '../reducers/sorting';

export const DIRECTION = {
ASC: 'ASCENDING',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class CollectionList extends React.Component {

_renderFieldHeader = (fieldName, displayName) => {
const { field, direction } = this.props.sorting;
console.log(field);
const headerClass = classNames({
'sketches-table__header': true,
'sketches-table__header--selected': field === fieldName
Expand Down
5 changes: 2 additions & 3 deletions client/modules/IDE/reducers/sorting.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { createSlice } from '@reduxjs/toolkit';
import { DIRECTION } from '../actions/sorting';
import * as ActionTypes from '../../../constants';

const initialState = {
field: 'createdAt',
Expand All @@ -11,7 +10,7 @@ const sortingSlice = createSlice({
name: 'sorting',
initialState,
reducers: {
toggleDirection: (state, action) => {
toggleDirectionForField: (state, action) => {
const { field } = action.payload;
if (field && field !== state.field) {
const direction = field === 'name' ? DIRECTION.ASC : DIRECTION.DESC;
Expand All @@ -28,6 +27,6 @@ const sortingSlice = createSlice({
}
});

export const sortingActions = sortingSlice.actions;
export const { toggleDirectionForField, setSorting } = sortingSlice.actions;

export default sortingSlice.reducer;