From a7c8d681470584fdaa067fe0027a87c73f48a2af Mon Sep 17 00:00:00 2001
From: Francesco Menghi <53121061+menghif@users.noreply.github.com>
Date: Sat, 15 Jan 2022 14:15:35 -0500
Subject: [PATCH] - Initial work from @irenejoeunpark with PR #2491 - Changed
repos display to row, added border bottom for header, added hint icon for
accordion - Fixed clicking on expand icon copies link to blog post - Added
expand icons in the bottom of the github info - Added function to auto close
accordion when scroll pass post - Added css for mobile device < 375 px width
---
src/web/src/components/Posts/ExpandIcon.tsx | 49 +++++
src/web/src/components/Posts/GitHubInfo.tsx | 2 +-
.../src/components/Posts/GitHubInfoMobile.tsx | 51 +++++
src/web/src/components/Posts/Post.tsx | 187 ++++++++++++------
src/web/src/components/Posts/PostAvatar.tsx | 7 +-
src/web/src/components/Posts/Repos.tsx | 2 +-
src/web/src/components/Posts/ShareButton.tsx | 7 +-
7 files changed, 242 insertions(+), 63 deletions(-)
create mode 100644 src/web/src/components/Posts/ExpandIcon.tsx
create mode 100644 src/web/src/components/Posts/GitHubInfoMobile.tsx
diff --git a/src/web/src/components/Posts/ExpandIcon.tsx b/src/web/src/components/Posts/ExpandIcon.tsx
new file mode 100644
index 0000000000..1057bd0003
--- /dev/null
+++ b/src/web/src/components/Posts/ExpandIcon.tsx
@@ -0,0 +1,49 @@
+import { IconButton, createStyles } from '@material-ui/core';
+import { makeStyles } from '@material-ui/core/styles';
+import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
+import ExpandLessIcon from '@material-ui/icons/ExpandLess';
+
+type Props = {
+ small: Boolean;
+ expandHeader: Boolean;
+ setExpandHeader: Function;
+};
+
+const useStyles = makeStyles(() =>
+ createStyles({
+ container: {
+ display: 'flex',
+ justifyContent: 'center',
+ },
+ smallIcon: {
+ padding: 0,
+ fill: '#cccccc',
+ },
+ bigIcon: {
+ fontSize: '5rem',
+ fill: '#cccccc',
+ },
+ iconBtn: {
+ padding: '5px',
+ },
+ })
+);
+const ExpandIcon = ({ small, expandHeader, setExpandHeader }: Props) => {
+ const classes = useStyles();
+ return small ? (
+