-
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
68a6f0d
commit 5143d48
Showing
53 changed files
with
1,970 additions
and
1,317 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import '../styles/dock.css'; | ||
import { Icon, Link, SocialIcon } from '@zigurous/react-components'; | ||
import { Link as GatsbyLink } from 'gatsby'; | ||
import React from 'react'; | ||
import { dockLinks, socialLinks } from '../links'; | ||
|
||
const Dock = ({ theme, toggleTheme, secondaryLinks }) => { | ||
return ( | ||
<div className="dock"> | ||
<div className="dock__container" id="primary"> | ||
<div className="dock__section" id="navigation"> | ||
{dockLinks.map((link) => ( | ||
<DockItem link={link} key={link.key} /> | ||
))} | ||
</div> | ||
<div className="dock__section" id="socials"> | ||
{socialLinks.map((link) => ( | ||
<DockItem link={link} key={link.key} external /> | ||
))} | ||
</div> | ||
<div className="dock__section" id="gallery"> | ||
<div className="dock__item" id="Previous"> | ||
<button | ||
onClick={() => { | ||
if (!document) return; | ||
const e = new Event('previous_slide'); | ||
document.dispatchEvent(e); | ||
}} | ||
> | ||
<Icon name="chevron_left" /> | ||
</button> | ||
<div className="dock__tooltip">Previous</div> | ||
</div> | ||
<div className="dock__item" id="Next"> | ||
<button | ||
onClick={() => { | ||
if (!document) return; | ||
const e = new Event('next_slide'); | ||
document.dispatchEvent(e); | ||
}} | ||
> | ||
<Icon name="chevron_right" /> | ||
</button> | ||
<div className="dock__tooltip">Next</div> | ||
</div> | ||
</div> | ||
<div className="dock__section" id="theme"> | ||
<div className="dock__item" id="Theme"> | ||
<button onClick={toggleTheme}> | ||
<Icon name={theme === 'dark' ? 'light_mode' : 'dark_mode'} /> | ||
</button> | ||
<div className="dock__tooltip"> | ||
{theme === 'dark' ? 'Light Mode' : 'Dark Mode'} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{secondaryLinks && ( | ||
<div className="dock__container" id="secondary"> | ||
{secondaryLinks.map((link) => ( | ||
<DockItem link={link} key={link.key || link.name} external /> | ||
))} | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
const DockItem = ({ link, external = false }) => { | ||
return ( | ||
<div className="dock__item" id={link.name}> | ||
<Link | ||
ElementType={link.ElementType || (external ? 'a' : GatsbyLink)} | ||
external={external} | ||
to={link.to || link.url} | ||
unstyled | ||
> | ||
{link.icon ? ( | ||
<Icon name={link.icon} /> | ||
) : ( | ||
<SocialIcon iconName={link.key} innerPadding={0} size={18} /> | ||
)} | ||
</Link> | ||
<div className="dock__tooltip">{link.name}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Dock; |
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.
Oops, something went wrong.