mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-20 03:32:09 +10:00
refactor(v4.0.0-alpha): beginning of a new era
This commit is contained in:
46
apps/client/src/pages/home/sections/hero/call-to-action.tsx
Normal file
46
apps/client/src/pages/home/sections/hero/call-to-action.tsx
Normal file
@ -0,0 +1,46 @@
|
||||
import { Book, SignOut } from "@phosphor-icons/react";
|
||||
import { Button } from "@reactive-resume/ui";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
import { useLogout } from "@/client/services/auth";
|
||||
import { useAuthStore } from "@/client/stores/auth";
|
||||
|
||||
export const HeroCTA = () => {
|
||||
const { logout } = useLogout();
|
||||
|
||||
const isLoggedIn = useAuthStore((state) => !!state.user);
|
||||
|
||||
if (isLoggedIn) {
|
||||
return (
|
||||
<>
|
||||
<Button asChild size="lg">
|
||||
<Link to="/dashboard">Go to Dashboard</Link>
|
||||
</Button>
|
||||
|
||||
<Button size="lg" variant="link" onClick={() => logout()}>
|
||||
<SignOut className="mr-3" />
|
||||
Logout
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
if (!isLoggedIn) {
|
||||
return (
|
||||
<>
|
||||
<Button asChild size="lg">
|
||||
<Link to="/auth/login">Get started</Link>
|
||||
</Button>
|
||||
|
||||
<Button asChild size="lg" variant="link">
|
||||
<a href="https://docs.rxresu.me" target="_blank" rel="noopener noreferrer nofollow">
|
||||
<Book className="mr-3" />
|
||||
Learn more
|
||||
</a>
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
Reference in New Issue
Block a user