-
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 pull request #6 from khanghy2130/profile-route
Profile route
- Loading branch information
Showing
6 changed files
with
42 additions
and
31 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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
// 404 route | ||
|
||
|
||
export default function SplatRoute(){ | ||
return <div> | ||
404 Not Found!! | ||
</div> | ||
} | ||
export default function SplatRoute() { | ||
return <div>404 Not Found!!</div>; | ||
} |
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 { Link, useOutletContext } from "@remix-run/react"; | ||
import { ContextProps } from "~/utils/types/ContextProps.type"; | ||
|
||
export default function Profile() { | ||
const { supabase, user } = useOutletContext<ContextProps>(); | ||
|
||
// unauthenticated render | ||
if (!user) { | ||
return ( | ||
<div> | ||
<h1>Log in to see your profile.</h1> | ||
<Link to="/login"> | ||
<button className="btn">Login</button> | ||
</Link> | ||
</div> | ||
); | ||
} | ||
|
||
// authenticated render | ||
return ( | ||
<div> | ||
<h1 className="text-3xl"> | ||
My Profile (no one else can see my profile) | ||
</h1> | ||
<p>UUID: {user.id}</p> | ||
<p>Name: {user.user_metadata.full_name}</p> | ||
<p>Email: {user.user_metadata.email}</p> | ||
</div> | ||
); | ||
} |
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