-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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
- Loading branch information
1 parent
64ff08d
commit a7c8d68
Showing
7 changed files
with
242 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ? ( | ||
<IconButton onClick={() => setExpandHeader(!expandHeader)} className={classes.iconBtn}> | ||
{expandHeader ? ( | ||
<ExpandLessIcon className={classes.smallIcon} /> | ||
) : ( | ||
<ExpandMoreIcon className={classes.smallIcon} /> | ||
)} | ||
</IconButton> | ||
) : ( | ||
<div className={classes.container}> | ||
<IconButton onClick={() => setExpandHeader(!expandHeader)} className={classes.iconBtn}> | ||
<ExpandLessIcon className={classes.bigIcon} /> | ||
</IconButton> | ||
</div> | ||
); | ||
}; | ||
export default ExpandIcon; |
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,51 @@ | ||
import { createStyles, makeStyles, Theme, ListSubheader } from '@material-ui/core'; | ||
import Repos from './Repos'; | ||
import Issues from './Issues'; | ||
import PullRequests from './PullRequests'; | ||
import Commits from './Commits'; | ||
import Users from './Users'; | ||
import { filterGitHubUrls } from './GitHubInfo'; | ||
|
||
type Props = { | ||
ghUrls: string[]; | ||
}; | ||
|
||
const useStyles = makeStyles((theme: Theme) => | ||
createStyles({ | ||
root: { | ||
padding: '0', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
marginTop: '0', | ||
lineHeight: '1', | ||
[theme.breakpoints.up('lg')]: { | ||
width: '21rem', | ||
}, | ||
color: theme.palette.text.secondary, | ||
}, | ||
GitHubInfoContainer: { | ||
margin: '0 0 0 1rem', | ||
}, | ||
}) | ||
); | ||
|
||
const GitHubInfoMobile = ({ ghUrls }: Props) => { | ||
const classes = useStyles(); | ||
const { repos, issues, pullRequests, commits, users } = filterGitHubUrls(ghUrls); | ||
|
||
return ( | ||
<div> | ||
<ListSubheader className={classes.root}> | ||
<div className={classes.GitHubInfoContainer}> | ||
{!!repos.length && <Repos repoUrls={repos} />} | ||
{!!issues.length && <Issues issueUrls={issues} />} | ||
{!!pullRequests.length && <PullRequests prUrls={pullRequests} />} | ||
{!!commits.length && <Commits commitUrls={commits} />} | ||
{!!users.length && <Users usernames={users} />} | ||
</div> | ||
</ListSubheader> | ||
</div> | ||
); | ||
}; | ||
|
||
export default GitHubInfoMobile; |
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
Oops, something went wrong.