Skip to content

Commit fd7e13b

Browse files
move svgs to assets and added product hunt button (#136)
1 parent 4c03968 commit fd7e13b

File tree

5 files changed

+68
-30
lines changed

5 files changed

+68
-30
lines changed

frontend/src/components/Dashboard/index.js

Lines changed: 56 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import React,{useState} from 'react';
1+
import React, { useState } from 'react';
22
import AppBar from '@material-ui/core/AppBar';
33
import Toolbar from '@material-ui/core/Toolbar';
44
import Typography from '@material-ui/core/Typography';
55
import CssBaseline from '@material-ui/core/CssBaseline';
66
import useScrollTrigger from '@material-ui/core/useScrollTrigger';
77
import Container from '@material-ui/core/Container';
8-
import { IconButton,Paper } from "@material-ui/core";
9-
import { createMuiTheme, ThemeProvider } from "@material-ui/core/styles";
8+
import { IconButton, Paper } from '@material-ui/core';
9+
import { createMuiTheme, ThemeProvider } from '@material-ui/core/styles';
1010
import { dashConstants } from '../../config/constants';
11-
import {LightTheme,DarkTheme} from "../../util/themes/GlobalThemes"
12-
import {getAppBarStyles} from "../../util/styles/componentStyles"
13-
import MoonIcon from '../../moon.svg';
14-
import LightIcon from "../../sun.svg"
11+
import { LightTheme, DarkTheme } from '../../util/themes/GlobalThemes';
12+
import { getAppBarStyles } from '../../util/styles/componentStyles';
13+
import MoonIcon from '../../assets/moon.svg';
14+
import LightIcon from '../../assets/sun.svg';
1515
import Home from '../Pages/Home';
1616

1717
function ElevationScroll(props) {
@@ -31,29 +31,64 @@ function ElevationScroll(props) {
3131
}
3232

3333
function Dashboard(props) {
34-
const [isDark, setIsDark] = useState(false);
35-
const theme = isDark ? createMuiTheme(DarkTheme) : createMuiTheme(LightTheme)
36-
const classes = getAppBarStyles()
34+
const [isDark, setIsDark] = useState(false);
35+
const theme = isDark
36+
? createMuiTheme(DarkTheme)
37+
: createMuiTheme(LightTheme);
38+
const classes = getAppBarStyles();
3739

38-
function handleThemeChange(){
39-
setIsDark(!isDark)
40-
}
40+
function handleThemeChange() {
41+
setIsDark(!isDark);
42+
}
4143
return (
4244
<React.Fragment>
4345
<ThemeProvider theme={theme}>
4446
<Paper>
4547
<CssBaseline />
4648
<ElevationScroll {...props}>
47-
<AppBar>
48-
<Toolbar className = {classes.root}>
49-
<Typography variant="h6" className = {classes.title}>{dashConstants.APP_NAME}</Typography>
50-
<IconButton className = {classes.themeIcon} onClick = {handleThemeChange} >{<img alt="Theme Icon" src={isDark ? LightIcon : MoonIcon}/>}</IconButton>
51-
</Toolbar>
52-
</AppBar>
49+
<AppBar>
50+
<Toolbar className={classes.root}>
51+
<Typography
52+
variant='h6'
53+
className={classes.title}
54+
>
55+
{dashConstants.APP_NAME}
56+
</Typography>
57+
<IconButton>
58+
<a
59+
href='https://www.producthunt.com/posts/dynamic-github-profile-readme-quotes?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-dynamic-github-profile-readme-quotes'
60+
target='_blank'
61+
rel='noreferrer'
62+
>
63+
<img
64+
src='https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=276934&theme=light'
65+
alt='Dynamic GitHub Profile Readme Quotes - Everlasting Poetic Touch to GitHub Profiles for everyone | Product Hunt'
66+
style={{
67+
width: ' 250px',
68+
height: '54px',
69+
}}
70+
width='250'
71+
height='54'
72+
/>
73+
</a>
74+
</IconButton>
75+
<IconButton
76+
className={classes.themeIcon}
77+
onClick={handleThemeChange}
78+
>
79+
{
80+
<img
81+
alt='Theme Icon'
82+
src={isDark ? LightIcon : MoonIcon}
83+
/>
84+
}
85+
</IconButton>
86+
</Toolbar>
87+
</AppBar>
5388
</ElevationScroll>
5489
<Toolbar />
55-
<Container style={{backgroundColor:'white'}}>
56-
<Home/>
90+
<Container style={{ backgroundColor: 'white' }}>
91+
<Home />
5792
</Container>
5893
</Paper>
5994
</ThemeProvider>
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
import { makeStyles } from "@material-ui/core";
1+
import { makeStyles } from '@material-ui/core';
22

33
export const getAppBarStyles = makeStyles((theme) => ({
44
title: {
5-
flexGrow: 1,
5+
flexGrow: 1,
66
},
7-
themeIcon:{
8-
backgroundColor:"transparent !important",
9-
height:"38px",
10-
width:"38px",
11-
boxShadow:"0px 0px 0.5px 0.5px #6e7681"
12-
}
13-
}));
7+
themeIcon: {
8+
backgroundColor: 'transparent !important',
9+
height: '38px',
10+
width: '38px',
11+
boxShadow: '0px 0px 0.5px 0.5px #6e7681',
12+
},
13+
productHuntBtn: {
14+
flexGrow: 1,
15+
},
16+
}));

0 commit comments

Comments
 (0)