-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: enable linting in react example and fix lint errors
Signed-off-by: Marin Petrunic <[email protected]>
- Loading branch information
Showing
3 changed files
with
52 additions
and
28 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 |
---|---|---|
@@ -1,59 +1,77 @@ | ||
import { SygmaProtocolReactWidget } from '@buildwithsygma/sygmaprotocol-react-widget' | ||
import './App.css'; | ||
import sygmaIcon from './public/sygmaIcon.svg' | ||
import gitHubIcon from './public/githubIcon.png' | ||
import docsIcon from './public/docsIcon.png' | ||
import closeIcon from './public/closeIcon.png' | ||
import sidebarIcon from './public/sidebarIcon.png' | ||
import { useState } from 'react'; | ||
import { SygmaProtocolReactWidget } from '@buildwithsygma/sygmaprotocol-react-widget'; | ||
|
||
function App() { | ||
import closeIcon from './public/closeIcon.png'; | ||
import docsIcon from './public/docsIcon.png'; | ||
import gitHubIcon from './public/githubIcon.png'; | ||
import sidebarIcon from './public/sidebarIcon.png'; | ||
import sygmaIcon from './public/sygmaIcon.svg'; | ||
|
||
import './App.css'; | ||
|
||
function App() { | ||
const [sidebarOpen, setSidebarOpen] = useState(false); | ||
|
||
const toggleSidebar = () => { | ||
setSidebarOpen(!sidebarOpen); | ||
}; | ||
|
||
const obtainTokensClick = () => { | ||
window.open("https://docs.buildwithsygma.com/environments/testnet/obtain-testnet-tokens", "_blank"); | ||
window.open( | ||
'https://docs.buildwithsygma.com/environments/testnet/obtain-testnet-tokens', | ||
'_blank', | ||
); | ||
}; | ||
|
||
return ( | ||
|
||
<div className="page"> | ||
<aside className={`sidebar centered ${sidebarOpen ? 'open' : ''}`}> | ||
{sidebarOpen && ( | ||
<div id="close-icon" onClick={toggleSidebar}> | ||
<button type="button" id="close-icon" onClick={toggleSidebar}> | ||
<img src={closeIcon} alt="Close Sidebar" className="icon" /> | ||
</div> | ||
)} | ||
</button> | ||
)} | ||
<div className="sidebar-title">Sygma Widget</div> | ||
<div className="icon-column"> | ||
<div className="icon-column"> | ||
<div className="icon-wrapper"> | ||
<a href="https://buildwithsygma.com/" target="_blank"><img src={sygmaIcon} alt="Main Page" /></a> | ||
<a href="https://buildwithsygma.com/" target="_blank"><span>Website</span></a> | ||
<a href="https://buildwithsygma.com/" target="_blank" rel="noreferrer"> | ||
<img src={sygmaIcon} alt="Main Page" /> | ||
</a> | ||
<a href="https://buildwithsygma.com/" target="_blank" rel="noreferrer"> | ||
<span>Website</span> | ||
</a> | ||
</div> | ||
<div className="icon-wrapper"> | ||
<a href="https://docs.buildwithsygma.com/" target="_blank"><img src={docsIcon} alt="Documentation"/></a> | ||
<a href="https://docs.buildwithsygma.com/" target="_blank"><span>Docs</span></a> | ||
<a href="https://docs.buildwithsygma.com/" target="_blank" rel="noreferrer"> | ||
<img src={docsIcon} alt="Documentation" /> | ||
</a> | ||
<a href="https://docs.buildwithsygma.com/" target="_blank" rel="noreferrer"> | ||
<span>Docs</span> | ||
</a> | ||
</div> | ||
<div className="icon-wrapper"> | ||
<a href="https://github.com/sygmaprotocol" target="_blank"><img src={gitHubIcon} alt="GitHub" id="github-icon"/></a> | ||
<a href="https://github.com/sygmaprotocol" target="_blank"><span>GitHub</span></a> | ||
<a href="https://github.com/sygmaprotocol" target="_blank" rel="noreferrer"> | ||
<img src={gitHubIcon} alt="GitHub" id="github-icon" /> | ||
</a> | ||
<a href="https://github.com/sygmaprotocol" target="_blank" rel="noreferrer"> | ||
<span>GitHub</span> | ||
</a> | ||
</div> | ||
<button className="sidebar-button" onClick={obtainTokensClick}>Obtain Testnet Tokens</button> | ||
<button type="button" className="sidebar-button" onClick={obtainTokensClick}> | ||
Obtain Testnet Tokens | ||
</button> | ||
</div> | ||
</aside> | ||
<main className={"main centered"}> | ||
<main className="main centered"> | ||
<SygmaProtocolReactWidget /> | ||
</main> | ||
{!sidebarOpen && ( | ||
<div id="open-sidebar-button" onClick={toggleSidebar}> | ||
<button type="button" id="open-sidebar-button" onClick={toggleSidebar}> | ||
<img src={sidebarIcon} alt="Toggle Sidebar" className="icon" /> | ||
</div> | ||
</button> | ||
)} | ||
</div> | ||
) | ||
} | ||
export default App | ||
); | ||
} | ||
|
||
export default App; |