-
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.
Show login form when clicked on login button
- Loading branch information
1 parent
2806f6d
commit 8016528
Showing
6 changed files
with
74 additions
and
30 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
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,40 @@ | ||
import { Link } from 'react-router-dom'; | ||
import FreeTrialButton from './FreeTrialButton'; | ||
|
||
interface UserActionButtonProps { | ||
user: any; | ||
renderGoToChat: boolean; | ||
} | ||
|
||
const UserActionButton: React.FC<UserActionButtonProps> = ({ | ||
user, | ||
renderGoToChat, | ||
}) => { | ||
if (!user) { | ||
return ( | ||
<Link | ||
to='/signup' | ||
className='no-underline rounded-md px-3.5 py-2.5 text-sm text-captn-light-cream hover:bg-captn-cta-green-hover shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:text-captn-light-cream bg-captn-cta-green' | ||
> | ||
Create an account | ||
</Link> | ||
); | ||
} | ||
|
||
if (!user.hasPaid) { | ||
return <FreeTrialButton />; | ||
} | ||
|
||
return renderGoToChat ? ( | ||
<a | ||
href='/chat' | ||
className='no-underline rounded-md px-3.5 py-2.5 text-sm text-captn-light-cream hover:bg-captn-cta-green-hover shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:text-captn-light-cream bg-captn-cta-green' | ||
> | ||
Go to chat <span aria-hidden='true'>→</span> | ||
</a> | ||
) : ( | ||
<></> | ||
); | ||
}; | ||
|
||
export default UserActionButton; |
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 |
---|---|---|
|
@@ -112,7 +112,7 @@ export const UserMenuItems = ({ | |
fill='' | ||
/> | ||
</svg> | ||
Log out | ||
Sign out | ||
</button> | ||
</> | ||
); | ||
|
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