From fd7e13bc694e744f4d8658af78284d0b3065e573 Mon Sep 17 00:00:00 2001 From: Olushesi Toheeb Date: Fri, 7 May 2021 10:16:02 -0700 Subject: [PATCH] move svgs to assets and added product hunt button (#136) --- frontend/src/{ => assets}/logo.svg | 0 frontend/src/{ => assets}/moon.svg | 0 frontend/src/{ => assets}/sun.svg | 0 frontend/src/components/Dashboard/index.js | 77 +++++++++++++++------ frontend/src/util/styles/componentStyles.js | 21 +++--- 5 files changed, 68 insertions(+), 30 deletions(-) rename frontend/src/{ => assets}/logo.svg (100%) rename frontend/src/{ => assets}/moon.svg (100%) rename frontend/src/{ => assets}/sun.svg (100%) diff --git a/frontend/src/logo.svg b/frontend/src/assets/logo.svg similarity index 100% rename from frontend/src/logo.svg rename to frontend/src/assets/logo.svg diff --git a/frontend/src/moon.svg b/frontend/src/assets/moon.svg similarity index 100% rename from frontend/src/moon.svg rename to frontend/src/assets/moon.svg diff --git a/frontend/src/sun.svg b/frontend/src/assets/sun.svg similarity index 100% rename from frontend/src/sun.svg rename to frontend/src/assets/sun.svg diff --git a/frontend/src/components/Dashboard/index.js b/frontend/src/components/Dashboard/index.js index e6e51dd..2bb579d 100644 --- a/frontend/src/components/Dashboard/index.js +++ b/frontend/src/components/Dashboard/index.js @@ -1,17 +1,17 @@ -import React,{useState} from 'react'; +import React, { useState } from 'react'; import AppBar from '@material-ui/core/AppBar'; import Toolbar from '@material-ui/core/Toolbar'; import Typography from '@material-ui/core/Typography'; import CssBaseline from '@material-ui/core/CssBaseline'; import useScrollTrigger from '@material-ui/core/useScrollTrigger'; import Container from '@material-ui/core/Container'; -import { IconButton,Paper } from "@material-ui/core"; -import { createMuiTheme, ThemeProvider } from "@material-ui/core/styles"; +import { IconButton, Paper } from '@material-ui/core'; +import { createMuiTheme, ThemeProvider } from '@material-ui/core/styles'; import { dashConstants } from '../../config/constants'; -import {LightTheme,DarkTheme} from "../../util/themes/GlobalThemes" -import {getAppBarStyles} from "../../util/styles/componentStyles" -import MoonIcon from '../../moon.svg'; -import LightIcon from "../../sun.svg" +import { LightTheme, DarkTheme } from '../../util/themes/GlobalThemes'; +import { getAppBarStyles } from '../../util/styles/componentStyles'; +import MoonIcon from '../../assets/moon.svg'; +import LightIcon from '../../assets/sun.svg'; import Home from '../Pages/Home'; function ElevationScroll(props) { @@ -31,29 +31,64 @@ function ElevationScroll(props) { } function Dashboard(props) { - const [isDark, setIsDark] = useState(false); - const theme = isDark ? createMuiTheme(DarkTheme) : createMuiTheme(LightTheme) - const classes = getAppBarStyles() + const [isDark, setIsDark] = useState(false); + const theme = isDark + ? createMuiTheme(DarkTheme) + : createMuiTheme(LightTheme); + const classes = getAppBarStyles(); - function handleThemeChange(){ - setIsDark(!isDark) - } + function handleThemeChange() { + setIsDark(!isDark); + } return ( - - - {dashConstants.APP_NAME} - {Theme Icon} - - + + + + {dashConstants.APP_NAME} + + + + Dynamic GitHub Profile Readme Quotes - Everlasting Poetic Touch to GitHub Profiles for everyone | Product Hunt + + + + { + Theme Icon + } + + + - - + + diff --git a/frontend/src/util/styles/componentStyles.js b/frontend/src/util/styles/componentStyles.js index bc44844..7aa1d83 100644 --- a/frontend/src/util/styles/componentStyles.js +++ b/frontend/src/util/styles/componentStyles.js @@ -1,13 +1,16 @@ -import { makeStyles } from "@material-ui/core"; +import { makeStyles } from '@material-ui/core'; export const getAppBarStyles = makeStyles((theme) => ({ title: { - flexGrow: 1, + flexGrow: 1, }, - themeIcon:{ - backgroundColor:"transparent !important", - height:"38px", - width:"38px", - boxShadow:"0px 0px 0.5px 0.5px #6e7681" - } - })); \ No newline at end of file + themeIcon: { + backgroundColor: 'transparent !important', + height: '38px', + width: '38px', + boxShadow: '0px 0px 0.5px 0.5px #6e7681', + }, + productHuntBtn: { + flexGrow: 1, + }, +}));