Skip to content

Commit

Permalink
add authorDetails template
Browse files Browse the repository at this point in the history
  • Loading branch information
Chakravarthy7102 committed Nov 22, 2023
1 parent 21e5e95 commit 95d1748
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
10 changes: 7 additions & 3 deletions src/authors-details.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
//TODO: data related to each author on the blog posts should be added incrementally here.

module.exports = [
{
module.exports = []


/**
* Example:
* {
name: "Joel Coutinho",
title: "Backend Developer @Supertokens",
image: "https://avatars.githubusercontent.com/u/87567452?v=4",
Expand All @@ -22,4 +26,4 @@ module.exports = [
description:
"The one major downside of TOTP is that the secret key is stored on both the user’s device and the server. If either of these systems were to be compromised, a malicious actor would now be able to generate codes and have unfettered access to the user’s account.",
},
]
*/
5 changes: 1 addition & 4 deletions src/components/AuthorCardFooter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ import authorsDetails from "../authors-details"
import { Github, Linkedin, Twitter } from "../icons"

export default function AuthorCardFooter({ author }) {
if (author === undefined) {
return null
}

const authorDetails = authorsDetails.find(a => a.name === author)

if (authorDetails === undefined) {
return null
return <b>Written by the Folks at <a href="https://supertokens.com">SuperTokens</a> — hope you enjoyed!</b>
}

return (
Expand Down
4 changes: 2 additions & 2 deletions src/components/AuthorCardTop.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export default function AuthorCard({ author }) {
</p>
)
}

return (
<div className="author-card-top-container">
<img
src={authorDetails.image}
alt="author image"
alt="author"
/>
<div className="author-info">
<span className="author-name">By {author}</span>
Expand Down
1 change: 0 additions & 1 deletion src/components/BlogPostFooter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const BlogPostFooter = ({ idSlug , author}) => {

return (
<footer id={`last_section_${idSlug}`}>
<b>Written by the Folks at <a href="https://supertokens.com">SuperTokens</a> — hope you enjoyed!</b>
<AuthorCardFooter author={author}/>
<div className="sign-up-banner-content-border">
<div className="blog-post-sign-up-banner">
Expand Down
8 changes: 4 additions & 4 deletions src/styles/blog.css
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@

.author-card-top-container{
display: flex;
justify-content: start;
justify-content: flex-start;
align-items: center;
gap: 8px;

Expand Down Expand Up @@ -307,8 +307,8 @@

.author-card-footer-container{
display: flex;
justify-content: start;
align-items: start;
justify-content: flex-start;
align-items: flex-start;
gap: 23px;

margin: 38px 0px;
Expand All @@ -325,7 +325,7 @@
.author-card-footer-container .author-info{
display: flex;
flex-direction: column;
justify-content: start;
justify-content: flex-start;
flex-grow: 1;

gap: 8px;
Expand Down

0 comments on commit 95d1748

Please sign in to comment.