Skip to content

Commit

Permalink
GitHub logo links to repository
Browse files Browse the repository at this point in the history
  • Loading branch information
dnhn committed Mar 21, 2023
1 parent 04e0d68 commit 0ac26a6
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
3 changes: 3 additions & 0 deletions public/github-mark-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Image from './components/Image';
import Loading from './components/Loading';
import Controls from './components/Controls';
import Info from './components/Info';
import GitHub from './components/GitHub';

const App = () => {
// Get date from URL
Expand Down Expand Up @@ -128,6 +129,7 @@ const App = () => {
error={error}
/>
{hasImage(image) && !hideUI && <Info image={image} />}
{!hideUI && <GitHub />}
</main>
);
};
Expand Down
17 changes: 17 additions & 0 deletions src/components/GitHub.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';

import css from './GitHub.module.scss';

const GitHub = () => {
return (
<a
href="https://github.com/dnhn/hubble30"
className={css.GitHub}
target="_blank"
>
<img src="./github-mark-white.svg" alt="GitHub" />
</a>
);
};

export default GitHub;
22 changes: 22 additions & 0 deletions src/components/GitHub.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.GitHub {
position: fixed;
top: 0;
left: 0;
margin: 10px;
border-radius: 50%;
padding: 5px;
background-color: black;
line-height: 0;

@media (min-width: 768px) {
right: 0;
left: auto;
}
}

.GitHub img {
object-fit: contain;
object-position: center;
width: 36px;
height: 36px;
}
4 changes: 4 additions & 0 deletions src/components/Info.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
margin-top: 0;
font-size: 1.25em;

@media (max-width: 767px) {
padding-left: 45px;
}

@media (min-width: 768px) {
font-size: 1.5em;
}
Expand Down

0 comments on commit 0ac26a6

Please sign in to comment.