generated from EasyWebApp/WebCell-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[add] GitHub sign-in button & page with Strapi API
[add] Lark notification for Vercel preview URL [optimize] Layout & Style of Team Work card & User Detail page
- Loading branch information
Showing
9 changed files
with
294 additions
and
191 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
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,13 +1,28 @@ | ||
import dynamic from 'next/dynamic'; | ||
import { Icon } from 'idea-react'; | ||
import { observer } from 'mobx-react'; | ||
import { JWTProps } from 'next-ssr-middleware'; | ||
import { FC, HTMLAttributes } from 'react'; | ||
import { Button } from 'react-bootstrap'; | ||
|
||
const AuthingGuard = dynamic(() => import('./AuthingGuard'), { ssr: false }); | ||
import { i18n } from '../../models/Base/Translation'; | ||
import { strapiClient } from '../../models/User/Session'; | ||
|
||
export type ServerSessionBoxProps = HTMLAttributes<HTMLDivElement> & JWTProps; | ||
|
||
export const ServerSessionBox: FC<ServerSessionBoxProps> = ({ | ||
jwtPayload, | ||
children, | ||
...props | ||
}) => <div {...props}>{jwtPayload ? children : <AuthingGuard />}</div>; | ||
export const ServerSessionBox: FC<ServerSessionBoxProps> = observer( | ||
({ jwtPayload, children, ...props }) => ( | ||
<div {...props}> | ||
{jwtPayload ? ( | ||
children | ||
) : ( | ||
<Button | ||
variant="dark" | ||
size="lg" | ||
href={`${strapiClient.baseURI}connect/github`} | ||
> | ||
<Icon className="me-2" name="github" /> GitHub {i18n.t('sign_in')} | ||
</Button> | ||
)} | ||
</div> | ||
), | ||
); |
Oops, something went wrong.
035110a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for open-hackathon ready!
✅ Preview
https://open-hackathon-qbweltmzf-techquery.vercel.app
Built with commit 035110a.
This pull request is being automatically deployed with vercel-action