-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #530 from sparcs-kaist/dev
Main branch update from Dev branch
- Loading branch information
Showing
84 changed files
with
1,204 additions
and
784 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 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { atom } from "recoil"; | ||
|
||
export type MyRoomsType = { | ||
ongoing: Array<any>; // FIXME: 방의 타입 정의 | ||
done: Array<any>; | ||
}; | ||
|
||
const myRoomsAtom = atom<MyRoomsType>({ | ||
key: "myRoomsAtom", | ||
default: { | ||
ongoing: [], | ||
done: [], | ||
}, | ||
}); | ||
|
||
export default myRoomsAtom; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { atom } from "recoil"; | ||
|
||
export type TaxiLocationsType = Array<any>; | ||
|
||
const taxiLocationsAtom = atom<TaxiLocationsType>({ | ||
key: "taxiLocationsAtom", | ||
default: [], | ||
}); | ||
|
||
export default taxiLocationsAtom; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
import theme from "tools/theme"; | ||
|
||
const HeaderBar = () => { | ||
return ( | ||
<div | ||
style={{ | ||
background: theme.purple, | ||
width: "100%", | ||
height: "max(5px, env(safe-area-inset-top))", | ||
position: "fixed", | ||
top: "0px", | ||
left: "0px", | ||
zIndex: theme.zIndex_headerBar, | ||
}} | ||
/> | ||
); | ||
type HeaderBarProps = { | ||
position?: "fixed" | "absolute"; | ||
}; | ||
|
||
const HeaderBar = ({ position = "fixed" }: HeaderBarProps) => ( | ||
<div | ||
style={{ | ||
background: theme.purple, | ||
width: "100%", | ||
height: "max(5px, env(safe-area-inset-top))", | ||
position, | ||
top: "0px", | ||
left: "0px", | ||
zIndex: theme.zIndex_headerBar, | ||
}} | ||
/> | ||
); | ||
|
||
export default HeaderBar; |
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 { useLocation } from "react-router-dom"; | ||
|
||
import { backServer } from "loadenv"; | ||
|
||
type LinkLoginProps = { | ||
children: React.ReactNode; | ||
redirect?: string; | ||
}; | ||
|
||
const LinkLogin = ({ children, redirect }: LinkLoginProps) => { | ||
const { pathname, search } = useLocation(); | ||
const redirectPath = redirect || pathname + search; | ||
return ( | ||
<a | ||
href={`${backServer}/auth/sparcssso?redirect=${encodeURIComponent( | ||
redirectPath | ||
)}`} | ||
css={{ textDecoration: "none" }} | ||
> | ||
{children} | ||
</a> | ||
); | ||
}; | ||
|
||
export default LinkLogin; |
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,28 @@ | ||
import { useCallback, useRef } from "react"; | ||
import { useHistory, useLocation } from "react-router-dom"; | ||
|
||
type LinkLogoutProps = { | ||
children: React.ReactNode; | ||
redirect?: string; | ||
}; | ||
|
||
export const useOnClickLogout = (redirect?: string) => { | ||
const history = useHistory(); | ||
const { pathname, search } = useLocation(); | ||
const redirectPath = redirect || pathname + search; | ||
const isClicked = useRef(false); | ||
|
||
return useCallback(async () => { | ||
if (isClicked.current) return; | ||
isClicked.current = true; | ||
history.replace(`/logout?redirect=${encodeURIComponent(redirectPath)}`); | ||
isClicked.current = false; | ||
}, [history, redirectPath]); | ||
}; | ||
|
||
const LinkLogout = ({ children, redirect }: LinkLogoutProps) => { | ||
const onClickLogout = useOnClickLogout(redirect); | ||
return <div onClick={onClickLogout}>{children}</div>; | ||
}; | ||
|
||
export default LinkLogout; |
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.