-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* clean margins on comments list component. * create share buttons component. * Add share buttons to all relevant pages. * Minor adjustments to buttons on Chapter & Markdown component
- Loading branch information
1 parent
967b924
commit 74cb455
Showing
10 changed files
with
186 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { SHARE } from "@constants/app"; | ||
import { firebaseApp } from "@fb/client"; | ||
import { generateShareLink } from "@lib/utils"; | ||
import { getAnalytics, logEvent } from "firebase/analytics"; | ||
import Link from "next/link"; | ||
import React from "react"; | ||
import styles from "../styles/modules/Share.module.scss"; | ||
|
||
function Share({ title, url, contentType }) { | ||
const logShare = (method) => { | ||
const analytics = getAnalytics(firebaseApp); | ||
logEvent(analytics, "share", { | ||
method, | ||
content_type: contentType, | ||
item_id: title, | ||
}); | ||
}; | ||
|
||
return ( | ||
<> | ||
<span className="h5 mb-0">Share “{title}”</span> | ||
<div className={styles.share_list}> | ||
{Object.entries(SHARE).map(([platform, config]) => ( | ||
<Link | ||
key={platform} | ||
target="_blank" | ||
href={generateShareLink(title, url, platform)} | ||
rel="noopener noreferrer" | ||
className={styles.share_btn} | ||
onClick={() => logShare(config.label)} | ||
> | ||
<span className="me-2">{config.label}</span> | ||
{config.icon} | ||
</Link> | ||
))} | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default Share; |
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
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 |
---|---|---|
|
@@ -32,5 +32,8 @@ | |
} | ||
p { | ||
transition: all 0.2s ease-in; | ||
&:last-child { | ||
margin-bottom: 0; | ||
} | ||
} | ||
} |
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,27 @@ | ||
@import "../theme/variables"; | ||
|
||
.share_list { | ||
display: flex; | ||
flex-wrap: wrap; | ||
align-items: center; | ||
margin-top: 0.75rem; | ||
gap: 0.5rem; | ||
} | ||
|
||
.share_btn { | ||
text-decoration: none; | ||
padding: 0.1rem 0.5rem; | ||
border-radius: 0.25rem; | ||
background-color: darken($color: $dark, $amount: 2); | ||
border: 1px solid rgba($color: $light, $alpha: 0.2); | ||
transition: all 0.15s ease-in-out; | ||
color: rgba($color: $white, $alpha: 0.45); | ||
display: flex; | ||
align-items: center; | ||
&:hover, | ||
&:focus { | ||
background-color: lighten($color: $dark, $amount: 1); | ||
outline: none; | ||
color: rgba($color: $white, $alpha: 0.95); | ||
} | ||
} |
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
74cb455
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
the-pilfered-diaries – ./
the-pilfered-diaries-amittras-pal.vercel.app
the-pilfered-diaries.vercel.app
the-pilfered-diaries-git-main-amittras-pal.vercel.app
thepilfereddiaries.in
www.thepilfereddiaries.in