From 371fb85b3593dc63812cbf08169a8d7c3dc918a9 Mon Sep 17 00:00:00 2001 From: rmgutierrez Date: Wed, 29 Nov 2023 08:44:26 -0700 Subject: [PATCH] Updated styling --- .../src/components/post/GitHubEventList.tsx | 60 +++++++++++++++---- 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/client/src/components/post/GitHubEventList.tsx b/client/src/components/post/GitHubEventList.tsx index 750f5cb1..6fd6d96d 100644 --- a/client/src/components/post/GitHubEventList.tsx +++ b/client/src/components/post/GitHubEventList.tsx @@ -7,14 +7,19 @@ import { Typography, Grid, Paper, + Box } from "@mui/material"; +import { makeStyles } from "@mui/styles"; + import { formatDateTime } from "../../utils/dateUtils"; import { useState, useEffect } from "react"; import axios from "axios"; +import GitHubIcon from '@mui/icons-material/GitHub'; + const extractUsernameFromUrl = (url: string): string | null => { try { const urlObject = new URL(url); @@ -32,10 +37,19 @@ const extractUsernameFromUrl = (url: string): string | null => { } }; +const useStyles = makeStyles((theme) => ({ + root: { + "&::-webkit-scrollbar": { + width: 0, + }, + }, +})); + const GitHubEventsList = ({ githubUrl }: { githubUrl: string }) => { const [githubEvents, setGitHubEvents] = useState([]); const username = extractUsernameFromUrl(githubUrl); const gitehubUrl = `https://api.github.com/users/${username}/events`; + const classes = useStyles(); useEffect(() => { const fetchGitHubEvents = async (): Promise => { @@ -156,52 +170,72 @@ const GitHubEventsList = ({ githubUrl }: { githubUrl: string }) => { alignItems: "center", }} > - + + + + Github + + theme.palette.background.paper, - boxShadow: "0px 4px 10px rgba(0, 0, 0, 0.1)", + maxHeight: "85vh", + width: "100%" }} + className={classes.root} > {githubEvents.length > 0 ? ( githubEvents.map((event) => ( } - title={event.actor.display_login} + title={{event.actor.display_login}} subheader={formatDateTime(event.created_at)} sx={{ margin: 0 }} /> - {renderEventContent(event)} + {renderEventContent(event)} )) ) : ( - GitHub activity unavailable please check username + GitHub activity unavailable, please check username )}