-
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.
- Loading branch information
1 parent
2908e55
commit 8ae61c9
Showing
8 changed files
with
238 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { connectMetamask, signV4 } from '../services/ethereum' | ||
|
||
import Logo from '../images/logo' | ||
import { ModalContext } from '../Contexts/ModalProvider'; | ||
|
||
const Reader = ({setPage}) => { | ||
const [web3Enabled, setWeb3Enabled] = useState(false) | ||
const [title, setTitle] = useState("nothing...") | ||
|
||
return ( | ||
<ModalContext.Consumer> | ||
{(props) => ( | ||
<div id="modal" className="modal-window"> | ||
<div className="modal-body"> | ||
<div className="modal-content"> | ||
<div className="modal-content__logo"> | ||
<Logo /> | ||
<h3>{`Reading comments`}</h3> | ||
</div> | ||
<div className="modal-content__comments"> | ||
<Comment | ||
user="Joe cool" | ||
date="July 12" | ||
commentText="Do you know what this is? It's the world's smallest violin playing just for the waitresses." | ||
/> | ||
|
||
<Comment | ||
user="Everyone, ever" | ||
date="July 13" | ||
commentText="May the Force be with you." | ||
/> | ||
<Comment | ||
user="Punk" | ||
date="July 13" | ||
commentText="Go ahead, make my day." | ||
/> | ||
<Comment | ||
user="Car Salesperson" | ||
date="July 13" | ||
commentText="I'm going to make him an offer he can't refuse." | ||
/> | ||
<Comment | ||
user="Jane Doe" | ||
date="July 13" | ||
commentText="There's no place like home." | ||
/> | ||
<Comment | ||
user="John Doe" | ||
date="July 13" | ||
commentText="You talking to me?" | ||
/> | ||
<Comment | ||
user="Journalist" | ||
date="July 13" | ||
commentText="What we've got here is failure to communicate." | ||
/> | ||
<Comment | ||
user="Billy boy" | ||
date="July 13" | ||
commentText="D-J-A-N-G-O. The D is silent." | ||
/> | ||
</div> | ||
<div className="modal-content__confirm"> | ||
<TerciaryButton | ||
label="Load more" | ||
onClick={()=> {}} | ||
/> | ||
<PrimaryButton | ||
label="Create a comment" | ||
onClick={()=>setPage('writer')} | ||
/> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
)} | ||
</ModalContext.Consumer> | ||
); | ||
}; | ||
|
||
export default Reader; | ||
|
||
|
||
const Comment = ({ user, date, commentText }) => { | ||
return ( | ||
<div className="text-comment"> | ||
<div className="header"> | ||
<p className="header__author small-text">{user}</p> | ||
<p className="header__date small-text">{date}</p> | ||
</div> | ||
<div className="comment-body"> | ||
<p className="comment-body__text">{commentText}</p> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
const PrimaryButton = ({ label = 'ok', onClick, disabled = false }) => { | ||
return ( | ||
<button className="primary-button" disabled={disabled} onClick={onClick}> | ||
{label} | ||
</button> | ||
) | ||
} | ||
|
||
const TerciaryButton = ({ label = 'ok', onClick, disabled = false }) => { | ||
return ( | ||
<button className="terciary-button" disabled={disabled} onClick={onClick}> | ||
{label} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import Reader from './Reader' | ||
import Writer from './Writer' | ||
|
||
const pages = { | ||
reader: "reader", | ||
writer: "writer" | ||
} | ||
|
||
const Router = () => { | ||
const [page, setPage] = useState(pages.reader) | ||
|
||
switch (page) { | ||
case pages.reader: { return <Reader setPage={setPage} /> } | ||
case pages.writer: { return <Writer setPage={setPage} /> } | ||
} | ||
|
||
} | ||
|
||
export default Router |
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,71 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { connectMetamask, signV4 } from '../services/ethereum' | ||
|
||
import Logo from '../images/logo' | ||
import { ModalContext } from '../Contexts/ModalProvider'; | ||
|
||
const Reader = ({ setPage }) => { | ||
const [web3Enabled, setWeb3Enabled] = useState(false) | ||
const [title, setTitle] = useState("nothing...") | ||
|
||
return ( | ||
<ModalContext.Consumer> | ||
{(props) => ( | ||
<div id="modal" className="modal-window"> | ||
<div className="modal-body"> | ||
<div className="modal-content"> | ||
<div className="modal-content__logo"> | ||
<Logo /> | ||
<h3>{`Comment Editor`}</h3> | ||
</div> | ||
<div className="modal-content__comment-editor"> | ||
<TerciaryButton | ||
label="< Back to reading" | ||
onClick={() => setPage('reader')} | ||
/> | ||
<CommentEditor /> | ||
</div> | ||
<div className="modal-content__confirm"> | ||
<PrimaryButton | ||
label="Comment" | ||
onClick={() => setPage('reader')} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
)} | ||
</ModalContext.Consumer> | ||
); | ||
}; | ||
|
||
export default Reader; | ||
|
||
|
||
const CommentEditor = ({ }) => { | ||
const [commentContent, setCommentContent] = useState('') | ||
const updateCommentContent = (e) => { | ||
setCommentContent(e.target.value) | ||
} | ||
return ( | ||
<div className="comment-editor"> | ||
<textarea className="comment-editor__input" value={commentContent} onChange={updateCommentContent} /> | ||
</div> | ||
) | ||
} | ||
|
||
const PrimaryButton = ({ label = 'ok', onClick, disabled = false }) => { | ||
return ( | ||
<button className="primary-button" disabled={disabled} onClick={onClick}> | ||
{label} | ||
</button> | ||
) | ||
} | ||
|
||
const TerciaryButton = ({ label = 'ok', onClick, disabled = false }) => { | ||
return ( | ||
<button className="terciary-button" disabled={disabled} onClick={onClick}> | ||
{label} | ||
</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
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