-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(BUN-2176): new storeConfig slice with currencies (#976)
* feat(BUN-2176): new storeConfig slice with currencies * fix(BUN-2176): typo in storeConfig slice * fix(BUN-2176): typo in storeConfig reducer * fix(BUN-2176): typo in storeConfig selector * feat(BUN-2176): enteredInclusiveTax callers refac * fix(BUN-2176): improving readability * fix(BUN-2176): removing log and shadowed var * fix(BUN-2176): separating types
- Loading branch information
Showing
21 changed files
with
238 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
import { createSelector } from '@reduxjs/toolkit' | ||
|
||
import { Currency } from '@/types' | ||
|
||
import { RootState } from './reducer' | ||
|
||
const themeSelector = (state: RootState) => state.theme | ||
const storeConfigSelector = (state: RootState) => state.storeConfigs | ||
|
||
// More selectors will be added | ||
// eslint-disable-next-line | ||
export const themeFrameSelector = createSelector( | ||
themeSelector, | ||
(theme) => theme.themeFrame | ||
) | ||
|
||
export const defaultCurrencyCodeSelector = createSelector( | ||
storeConfigSelector, | ||
(storeConfigs) => | ||
storeConfigs.currencies?.currencies.find( | ||
(currency: Currency) => currency.is_default | ||
) | ||
) |
Oops, something went wrong.