-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ba5bb6
commit 6ecf7bd
Showing
12 changed files
with
100 additions
and
44 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -65,4 +65,6 @@ export const BtnLearneMore = styled.button` | |
&:focus { | ||
background-color: ${colors.accentHoverColor}; | ||
} | ||
` | ||
` | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import CarCard from 'components/CarCard/CarCard'; | ||
import { useSelector, } from 'react-redux'; | ||
import { ListCar } from '../CarsList/CarsList.styled'; | ||
|
||
|
||
const FavoritesList = () => { | ||
const { favorites } = useSelector(state => state); | ||
|
||
|
||
return <> | ||
{favorites.items.length === 0 | ||
&& <div> You have not added cars to your favorites list </div>} | ||
<ListCar > | ||
{favorites.items.map((data, index) => ( | ||
<CarCard | ||
key={index} | ||
data={data} | ||
/> | ||
))} | ||
</ListCar> | ||
</> | ||
}; | ||
|
||
export default FavoritesList; | ||
|
File renamed without changes.
File renamed without changes.
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 was deleted.
Oops, something went wrong.
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,8 +1,41 @@ | ||
import { configureStore } from "@reduxjs/toolkit"; | ||
import { reducer } from './reduser'; | ||
import { carReducer } from "./carSlice.js"; | ||
import { favoritesReducer } from "./favoritesSlise.js"; | ||
|
||
import { | ||
persistStore, | ||
persistReducer, | ||
FLUSH, | ||
REHYDRATE, | ||
PAUSE, | ||
PERSIST, | ||
PURGE, | ||
REGISTER, | ||
} from 'redux-persist'; | ||
import storage from 'redux-persist/lib/storage'; | ||
|
||
const PersistConfig = { | ||
key: "favorites", | ||
storage, | ||
}; | ||
|
||
|
||
export const store = configureStore({ | ||
reducer | ||
reducer: { | ||
car: carReducer, | ||
favorites: persistReducer(PersistConfig, favoritesReducer), | ||
}, | ||
middleware(getDefaultMiddleware) { | ||
return getDefaultMiddleware({ | ||
serializableCheck: { | ||
ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER], | ||
}, | ||
}); | ||
}, | ||
}); | ||
|
||
export const persistor = persistStore(store); | ||
|
||
|
||
|
||
|
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