Skip to content

Commit

Permalink
Merge pull request #20 from NEARBuilders/prompt-login-for-post
Browse files Browse the repository at this point in the history
Prompt for login when creating post
  • Loading branch information
elliotBraem authored Jan 3, 2024
2 parents 9af6886 + 794fe79 commit 28fff2f
Show file tree
Hide file tree
Showing 5 changed files with 321 additions and 76 deletions.
7 changes: 6 additions & 1 deletion apps/builddao/widget/Feed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,19 @@ return (
/>
</Aside>
<MainContent>
{context.accountId && (
{context.accountId ? (
<Widget
src="/*__@appAccount__*//widget/Compose"
props={{
feed: feedsDict[currentFeed],
template: feedsDict[currentFeed].template,
}}
/>
) : (
<Widget
src="/*__@appAccount__*//widget/components.login-now"
props={props}
/>
)}
{feed()}
</MainContent>
Expand Down
46 changes: 46 additions & 0 deletions apps/builddao/widget/components/login-now.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
console.log(props);

const Container = styled.div`
background-color: #23242b;
color: #ffffff;
width: 100%;
height: 16rem;
border-radius: 1rem;
display: flex;
align-items: center;
justify-content: center;
button {
all: unset;
cursor: pointer;
display: flex;
padding: 16px 20px;
justify-content: center;
align-items: center;
gap: 4px;
border-radius: 8px;
border: 1px solid var(--white-100, #fff);
background: #fff;
transition: all 300ms;
&:hover {
text-decoration: none;
}
color: var(--black-100, #000);
font-size: 14px;
font-style: normal;
font-weight: 500;
line-height: normal;
}
`;

return (
<Container>
<button onClick={props.requestSignIn}>Login</button>
</Container>
);
1 change: 1 addition & 0 deletions apps/builddao/widget/login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const LoginContainer = styled.div`
button {
all: unset;
cursor: pointer;
display: flex;
padding: 16px 20px;
justify-content: center;
Expand Down
1 change: 1 addition & 0 deletions src/pages/FeedPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default function FeedPage(props) {
config={{
redirectMap: redirectMapStore.redirectMap,
}}
props={props}
/>
</div>
);
Expand Down
Loading

0 comments on commit 28fff2f

Please sign in to comment.