forked from falling-fruit/falling-fruit-web
-
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.
Merge branch 'main' into feature/falling-fruit#495-change-outdated-tw…
…itter-logo
- Loading branch information
Showing
13 changed files
with
130 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { useEffect } from 'react' | ||
import { useDispatch } from 'react-redux' | ||
import { useLocation } from 'react-router-dom' | ||
|
||
import { setIsBeingInitializedMobile } from '../../redux/locationSlice' | ||
import { useAppHistory } from '../../utils/useAppHistory' | ||
import { useIsDesktop } from '../../utils/useBreakpoint' | ||
|
||
const ConnectInitLocation = () => { | ||
const isDesktop = useIsDesktop() | ||
const history = useAppHistory() | ||
const dispatch = useDispatch() | ||
const location = useLocation() | ||
const isSettingsPage = location.pathname.startsWith('/settings') | ||
|
||
useEffect(() => { | ||
if (!isSettingsPage) { | ||
if (isDesktop) { | ||
history.push('/locations/new') | ||
return | ||
} | ||
|
||
dispatch(setIsBeingInitializedMobile(true)) | ||
} | ||
}, [history, isDesktop, dispatch, isSettingsPage]) | ||
|
||
return null | ||
} | ||
|
||
export default ConnectInitLocation |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { useEffect } from 'react' | ||
import { useDispatch } from 'react-redux' | ||
|
||
import { setIsBeingInitializedMobile } from '../../redux/locationSlice' | ||
|
||
const DisconnectInitLocation = () => { | ||
const dispatch = useDispatch() | ||
|
||
useEffect(() => { | ||
dispatch(setIsBeingInitializedMobile(false)) | ||
}, [dispatch]) | ||
|
||
return null | ||
} | ||
|
||
export default DisconnectInitLocation |
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
Oops, something went wrong.