Tailwind config and basic services

This commit is contained in:
Aslan 2025-12-31 17:15:14 +01:00
parent f1e90c4dd2
commit be6467cd2c
41 changed files with 581 additions and 102 deletions

View file

@ -0,0 +1,34 @@
import { fetchCommunity } from "../../services/community";
import { CommunityActionTypes, CommunityAction } from "./actions";
import { ICommunityState } from "./types";
function communityReducer(
state: ICommunityState,
action: CommunityAction,
): ICommunityState {
switch (action.type) {
case CommunityActionTypes.FETCH_COMMUNITY_START:
fetchCommunity(action.payload);
return state;
case CommunityActionTypes.FETCH_COMMUNITY_FINISH:
return {
...state,
communities: {
...state.communities,
[action.payload.id]: action.payload,
},
};
case CommunityActionTypes.SET_COMMUNITY:
return {
...state,
communities: {
...state.communities,
[action.payload.id]: action.payload,
},
};
default:
return state;
}
}
export { communityReducer };