/* SPINNER */ export const SHOW_SPINNER = '[ui] show spinner'; export const HIDE_SPINNER = '[ui] hide spinner'; export const showSpinner = () => ({ type: SHOW_SPINNER }); export const hideSpinner = () => ({ type: HIDE_SPINNER }); /* DETAIL VIEW */ export const OPEN_DETAIL = '[ui] Open detail view'; export const CLOSE_DETAIL = '[ui] Close detail view'; export const SHOW_NEXT_ITEM = '[ui] Show the next item'; export const SHOW_PREV_ITEM = '[ui] Show the previous item'; export const SET_MAGNET_INSTANCE = '[ui] Set Magnet instance'; export const openDetail = item => { return { type: OPEN_DETAIL, item }; }; export const showNextItem = () => ({ type: SHOW_NEXT_ITEM }); export const showPrevItem = () => ({ type: SHOW_PREV_ITEM }); export const closeDetail = () => ({ type: CLOSE_DETAIL }); /* OTHER */ export const TOGGEL_MENU = '[ui] toggle app menu'; export const TOGGEL_SHOWING_SEARCH_RESULTS = '[ui] toggle showing search results'; export const TOGGLE_PARTICIPATED = '[ui] toogle participated'; export const REBUILD_LAYOUT = '[ui] Rebuild the grid layout'; export const SHUFFLE_CATALOG = '[ui] Shuffle items'; export const SET_PRE_LAUNCH = '[ui] Set the pre-launch flag'; export const SET_INTERNAL = '[ui] Set the internal flag'; export const toggleMenu = () => ({ type: TOGGEL_MENU }); export const toggleShowingSearchResults = show => ({ type: TOGGEL_SHOWING_SEARCH_RESULTS, payload: show }); export const toggleParticipated = participated => ({ type: TOGGLE_PARTICIPATED, payload: participated }); export const setMagnetInstance = instance => ({ type: SET_MAGNET_INSTANCE, payload: instance }); export const rebuildLayout = () => ({ type: REBUILD_LAYOUT }); export const shuffle = () => { return { type: SHUFFLE_CATALOG }; }; export const setPreLaunch = isPreLaunch => { return { type: SET_PRE_LAUNCH, payload: isPreLaunch }; }; export const setInternal = isInternal => { return { type: SET_INTERNAL, payload: isInternal }; };