Skip to content

Commit 88820f0

Browse files
committed
adding social icons for new mastodon and discord sever
1 parent 30c2780 commit 88820f0

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

app/global.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,19 @@ make the text color a bit darker */
926926
margin-right: calc(var(--main-spacing) / 2);
927927
}
928928

929+
/* not on mobile */
930+
@media (hover: hover) {
931+
932+
.socialIcon {
933+
margin-right: calc(var(--main-spacing) / 2);
934+
color: var(--primary-light-color);
935+
}
936+
937+
.socialIcon:hover {
938+
color: var(--secondary-light-color);
939+
}
940+
}
941+
929942
@keyframes rippleAnimation {
930943
0% {
931944
box-shadow: 0 0 0 0 rgba(255, 255, 255, 1);

components/aside/Content.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import BaseLink from '@/components/base/Link'
33
import ShareButton from '@/components/base/button/Share'
44
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
55
import { faHeart, faBug, faComments } from '@fortawesome/free-solid-svg-icons'
6+
import { faGithub, faMastodon, faDiscord } from '@fortawesome/free-brands-svg-icons'
67
import Image from 'next/image'
78
import buyMeACoffeeImport from '@/public/assets/images/buy_me_a_coffee_button.png'
89

@@ -14,7 +15,6 @@ const AsideContent: React.FC = () => {
1415
<a href="https://www.buymeacoffee.com/chriswwweb" className={`${styles.coffeeButton} shake`} rel="noopener noreferrer" target="_blank">
1516
<Image src={buyMeACoffeeImport} priority fill alt="buy me a coffee, please" />
1617
</a>
17-
<br />
1818
<span className="fontDarker">* Please 😉</span>
1919
<p className="fontSmall fontDarker alignLeft">
2020
<FontAwesomeIcon icon={faHeart} size="1x" className="startInlineIcon" />
@@ -32,9 +32,22 @@ const AsideContent: React.FC = () => {
3232
<p className="fontSmall fontDarker alignLeft">
3333
<FontAwesomeIcon icon={faComments} className="startInlineIcon" />
3434
Suggestions and Ideas are appreciated, please use the&nbsp;
35+
<BaseLink href="https://discord.gg/4p59CCTUAJ">chris.lu Discord server</BaseLink>
36+
or the&nbsp;
3537
<BaseLink href="https://github.com/chrisweb/chris.lu/discussions">discussion board</BaseLink>
3638
to leave feedback or ask a question.
3739
</p>
40+
<p>
41+
<BaseLink href="https://discord.gg/4p59CCTUAJ" noExternalIcon={true}>
42+
<FontAwesomeIcon icon={faDiscord} color="white" size="2x" className="socialIcon" />
43+
</BaseLink>
44+
<BaseLink href="https://mastodon.social/@chriswwweb" noExternalIcon={true}>
45+
<FontAwesomeIcon icon={faMastodon} color="white" size="2x" className="socialIcon" />
46+
</BaseLink>
47+
<BaseLink href="https://github.com/chrisweb" noExternalIcon={true}>
48+
<FontAwesomeIcon icon={faGithub} color="white" size="2x" className="socialIcon" />
49+
</BaseLink>
50+
</p>
3851
</div>
3952
)
4053
}

components/base/Link.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface IBaseLinkProps extends PropsWithChildren {
99
target?: string
1010
rel?: string
1111
className?: string
12+
noExternalIcon?: boolean
1213
}
1314

1415
const isExternalUrl = (url: string, domain: string): boolean => {
@@ -53,12 +54,12 @@ const isUrlMe = (url: string): boolean => {
5354

5455
const BaseLink: React.FC<IBaseLinkProps> = (props) => {
5556

56-
const { href, children, ...linkProps } = props
57+
const { href, children, noExternalIcon, ...linkProps } = props
58+
const newLinkProps = { ...linkProps }
5759

5860
const isExternal = isExternalUrl(href.toString(), 'chris.lu')
5961
const isMe = isUrlMe(href.toString())
60-
61-
const newLinkProps = { ...linkProps }
62+
const withExternalIcon = isExternal && !noExternalIcon
6263

6364
if (isExternal) {
6465
newLinkProps.rel = 'noopener noreferrer'
@@ -71,7 +72,7 @@ const BaseLink: React.FC<IBaseLinkProps> = (props) => {
7172

7273
return (
7374
<>
74-
{isExternal ?
75+
{(withExternalIcon) ?
7576
(
7677
<>
7778
<a href={href.toString()} {...newLinkProps}>

0 commit comments

Comments
 (0)