File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
modules/navigation-buttons Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 11import { StyleSheet , Platform } from 'react-native'
2+ import { link } from '@frogpond/colors'
23
34export const commonStyles = StyleSheet . create ( {
45 button : {
@@ -40,6 +41,7 @@ export const rightButtonStyles = StyleSheet.create({
4041 } ) ,
4142 } ,
4243 icon : {
44+ color : link ,
4345 ...Platform . select ( {
4446 ios : {
4547 fontSize : 24 ,
Original file line number Diff line number Diff line change @@ -17,7 +17,12 @@ const slice = createSlice({
1717 reducers : {
1818 toggleFavoriteBuilding ( state , action : PayloadAction < string > ) {
1919 let favoritesSet = new Set ( state . favorites )
20- favoritesSet . delete ( action . payload )
20+
21+ if ( favoritesSet . has ( action . payload ) ) {
22+ favoritesSet . delete ( action . payload )
23+ } else {
24+ favoritesSet . add ( action . payload )
25+ }
2126
2227 let newFavorites = Array . from ( favoritesSet )
2328
You can’t perform that action at this time.
0 commit comments