-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extract notifications to the separate page
- Loading branch information
Showing
7 changed files
with
94 additions
and
89 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
66 changes: 66 additions & 0 deletions
66
libs/shared-components/src/mini-overlay/pages/notifications.tsx
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,66 @@ | ||
import { Space, Typography } from 'antd' | ||
import React, { FC } from 'react' | ||
import styled from 'styled-components' | ||
import NotificationFeed from '../../notifications/notification-feed' | ||
import { useEngine } from '../../contexts/engine-context' | ||
|
||
const { Title, Text } = Typography | ||
|
||
const MainContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 10px; | ||
` | ||
|
||
export interface INotificationsProps { | ||
modalContainerRef: React.RefObject<HTMLElement> | ||
} | ||
|
||
const Notifications: FC<INotificationsProps> = ({ modalContainerRef }) => { | ||
const { loggedInAccountId, onConnectWallet } = useEngine() | ||
return ( | ||
<MainContainer data-testid="main-page"> | ||
{loggedInAccountId ? ( | ||
<NotificationFeed | ||
onConnectWallet={onConnectWallet} | ||
loggedInAccountId={loggedInAccountId} | ||
modalContainerRef={modalContainerRef} | ||
/> | ||
) : ( | ||
<Space | ||
direction="vertical" | ||
style={{ | ||
width: '100%', | ||
borderRadius: '20px', | ||
background: '#fff', | ||
padding: '8px 8px 20px', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}} | ||
> | ||
<Space direction="horizontal" style={{ width: '100%', display: 'flex' }}> | ||
<Title style={{ userSelect: 'none', margin: '0 auto' }} level={3}> | ||
Sign in | ||
</Title> | ||
</Space> | ||
|
||
<Text | ||
type="secondary" | ||
style={{ | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
padding: '5px', | ||
textAlign: 'center', | ||
fontSize: '12px', | ||
}} | ||
> | ||
To see personalized notifications, you must sign in by connecting your wallet. | ||
</Text> | ||
</Space> | ||
)} | ||
</MainContainer> | ||
) | ||
} | ||
|
||
export default Notifications |
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.