-
-
Notifications
You must be signed in to change notification settings - Fork 184
Added responsiveness to nav bar #304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,2 @@ | ||||||||
| npm run build | ||||||||
| npm run start-dev | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure consistency by adding a shebang here as well. + #!/bin/bash
npm run start-devCommittable suggestion
Suggested change
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,36 +1,36 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||
| import React from 'react'; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import DiscordLogo from '../../assets/discord_logo.png'; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import React from "react"; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import DiscordLogo from "../../assets/discord_logo.png"; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| const DiscordButton = () => { | ||||||||||||||||||||||||||||||||||||||||||||||||
| const discordUrl = 'https://discord.gg/2nN2VqwNaK'; | ||||||||||||||||||||||||||||||||||||||||||||||||
| const discordUrl = "https://discord.gg/2nN2VqwNaK"; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| const handleDiscordButtonClick = () => { | ||||||||||||||||||||||||||||||||||||||||||||||||
| window.location.href = discordUrl; | ||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||
| const handleDiscordButtonClick = () => { | ||||||||||||||||||||||||||||||||||||||||||||||||
| window.location.href = discordUrl; | ||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||||||
| <button | ||||||||||||||||||||||||||||||||||||||||||||||||
| style={{ | ||||||||||||||||||||||||||||||||||||||||||||||||
| backgroundColor: 'white', | ||||||||||||||||||||||||||||||||||||||||||||||||
| color: 'white', | ||||||||||||||||||||||||||||||||||||||||||||||||
| padding: '10px 20px', | ||||||||||||||||||||||||||||||||||||||||||||||||
| borderRadius: '5px', | ||||||||||||||||||||||||||||||||||||||||||||||||
| border: 'none', | ||||||||||||||||||||||||||||||||||||||||||||||||
| cursor: 'pointer', | ||||||||||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| onClick={handleDiscordButtonClick} | ||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||
| <img | ||||||||||||||||||||||||||||||||||||||||||||||||
| src={DiscordLogo} | ||||||||||||||||||||||||||||||||||||||||||||||||
| alt="Discord Logo" | ||||||||||||||||||||||||||||||||||||||||||||||||
| style={{ | ||||||||||||||||||||||||||||||||||||||||||||||||
| marginRight: '5px', | ||||||||||||||||||||||||||||||||||||||||||||||||
| width: '95px', | ||||||||||||||||||||||||||||||||||||||||||||||||
| height: '28px', | ||||||||||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||
| </button> | ||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||||||
| <button | ||||||||||||||||||||||||||||||||||||||||||||||||
| style={{ | ||||||||||||||||||||||||||||||||||||||||||||||||
| backgroundColor: "white", | ||||||||||||||||||||||||||||||||||||||||||||||||
| color: "white", | ||||||||||||||||||||||||||||||||||||||||||||||||
| padding: "10px 20px", | ||||||||||||||||||||||||||||||||||||||||||||||||
| borderRadius: "5px", | ||||||||||||||||||||||||||||||||||||||||||||||||
| border: "none", | ||||||||||||||||||||||||||||||||||||||||||||||||
| cursor: "pointer", | ||||||||||||||||||||||||||||||||||||||||||||||||
| maxHeight: "48px", | ||||||||||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| onClick={handleDiscordButtonClick}> | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+12
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add an explicit <button
+ type="button"
style={{
backgroundColor: "white",
color: "white",
padding: "10px 20px",
borderRadius: "5px",
border: "none",
cursor: "pointer",
maxHeight: "48px",
}}
onClick={handleDiscordButtonClick}>Committable suggestion
Suggested change
ToolsBiome
|
||||||||||||||||||||||||||||||||||||||||||||||||
| <img | ||||||||||||||||||||||||||||||||||||||||||||||||
| src={DiscordLogo} | ||||||||||||||||||||||||||||||||||||||||||||||||
| alt="Discord Logo" | ||||||||||||||||||||||||||||||||||||||||||||||||
| style={{ | ||||||||||||||||||||||||||||||||||||||||||||||||
| marginRight: "5px", | ||||||||||||||||||||||||||||||||||||||||||||||||
| width: "75px", | ||||||||||||||||||||||||||||||||||||||||||||||||
| height: "20px", | ||||||||||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||
| </button> | ||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| export default DiscordButton; | ||||||||||||||||||||||||||||||||||||||||||||||||
| export default DiscordButton; | ||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,101 +1,97 @@ | ||
| 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 { createTheme, 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 '../../assets/moon.svg'; | ||
| import LightIcon from '../../assets/sun.svg'; | ||
| import Home from '../Pages/Home'; | ||
| import DiscordButton from './discord'; | ||
| 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 {Box, IconButton, Paper} from "@material-ui/core"; | ||
| import {createTheme, 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 "../../assets/moon.svg"; | ||
| import LightIcon from "../../assets/sun.svg"; | ||
| import Home from "../Pages/Home"; | ||
| import DiscordButton from "./discord"; | ||
|
|
||
| const ElevationScroll = (props) => { | ||
| const { children, window } = props; | ||
| // Note that you normally won't need to set the window ref as useScrollTrigger | ||
| // will default to window. | ||
| // This is only being set here because the demo is in an iframe. | ||
| const trigger = useScrollTrigger({ | ||
| disableHysteresis: true, | ||
| threshold: 0, | ||
| target: window ? window() : undefined, | ||
| }); | ||
| const {children, window} = props; | ||
| // Note that you normally won't need to set the window ref as useScrollTrigger | ||
| // will default to window. | ||
| // This is only being set here because the demo is in an iframe. | ||
| const trigger = useScrollTrigger({ | ||
| disableHysteresis: true, | ||
| threshold: 0, | ||
| target: window ? window() : undefined, | ||
| }); | ||
|
|
||
| return React.cloneElement(children, { | ||
| elevation: trigger ? 4 : 0, | ||
| }); | ||
| } | ||
| return React.cloneElement(children, { | ||
| elevation: trigger ? 4 : 0, | ||
| }); | ||
| }; | ||
|
|
||
| const Dashboard = (props) => { | ||
| const [isDark, setIsDark] = useState(false); | ||
| const theme = isDark | ||
| ? createTheme(DarkTheme) | ||
| : createTheme(LightTheme); | ||
| const classes = getAppBarStyles(); | ||
| const [isDark, setIsDark] = useState(false); | ||
| const theme = isDark ? createTheme(DarkTheme) : createTheme(LightTheme); | ||
| const classes = getAppBarStyles(); | ||
|
|
||
| function handleThemeChange() { | ||
| setIsDark(!isDark); | ||
| } | ||
| return ( | ||
| <React.Fragment> | ||
| <ThemeProvider theme={theme}> | ||
| <Paper> | ||
| <CssBaseline /> | ||
| <ElevationScroll {...props}> | ||
| <AppBar> | ||
| <Toolbar className={classes.root}> | ||
| <Typography | ||
| variant='h6' | ||
| className={classes.title} | ||
| > | ||
| {dashConstants.APP_NAME} | ||
| </Typography> | ||
| <DiscordButton /> | ||
| <IconButton> | ||
| <a | ||
| 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' | ||
| target='_blank' | ||
| rel='noreferrer' | ||
| > | ||
| <img | ||
| src='https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=276934&theme=light' | ||
| alt='Dynamic GitHub Profile Readme Quotes - Everlasting Poetic Touch to GitHub Profiles for everyone | Product Hunt' | ||
| style={{ | ||
| width: ' 250px', | ||
| height: '54px', | ||
| }} | ||
| width='250' | ||
| height='54' | ||
| /> | ||
| </a> | ||
| </IconButton> | ||
| <IconButton | ||
| className={classes.themeIcon} | ||
| onClick={handleThemeChange} | ||
| > | ||
| { | ||
| <img | ||
| alt='Theme Icon' | ||
| src={isDark ? LightIcon : MoonIcon} | ||
| /> | ||
| } | ||
| </IconButton> | ||
| </Toolbar> | ||
| </AppBar> | ||
| </ElevationScroll> | ||
| <Toolbar /> | ||
| <Container style={{ backgroundColor: 'white' }}> | ||
| <Home /> | ||
| </Container> | ||
| </Paper> | ||
| </ThemeProvider> | ||
| </React.Fragment> | ||
| ); | ||
| } | ||
| function handleThemeChange() { | ||
| setIsDark(!isDark); | ||
| } | ||
| return ( | ||
| <React.Fragment> | ||
| <ThemeProvider theme={theme}> | ||
| <Paper> | ||
| <CssBaseline /> | ||
| <ElevationScroll {...props}> | ||
| <AppBar> | ||
| <Toolbar className={classes.navBar}> | ||
| <Typography variant="h6" className={classes.title}> | ||
| {dashConstants.APP_NAME} | ||
| </Typography> | ||
| <Box className={classes.linkButtons}> | ||
| <DiscordButton /> | ||
| <IconButton> | ||
| <a | ||
| 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" | ||
| target="_blank" | ||
| rel="noreferrer"> | ||
| <img | ||
| src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=276934&theme=light" | ||
| alt="Dynamic GitHub Profile Readme Quotes - Everlasting Poetic Touch to GitHub Profiles for everyone | Product Hunt" | ||
| style={{ | ||
| width: { | ||
| xs: "200px", | ||
| sm: "250px", | ||
| }, | ||
| height: "48px", | ||
| }} | ||
| /> | ||
| </a> | ||
| </IconButton> | ||
| <IconButton | ||
| className={classes.themeIcon} | ||
| onClick={handleThemeChange}> | ||
| { | ||
| <img | ||
| alt="Theme Icon" | ||
| src={isDark ? LightIcon : MoonIcon} | ||
| /> | ||
| } | ||
| </IconButton> | ||
| </Box> | ||
| </Toolbar> | ||
| </AppBar> | ||
| </ElevationScroll> | ||
| <Toolbar /> | ||
| <Container style={{backgroundColor: "white"}}> | ||
| <Home /> | ||
| </Container> | ||
| </Paper> | ||
| </ThemeProvider> | ||
| </React.Fragment> | ||
| ); | ||
| }; | ||
|
|
||
| export default Dashboard; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| export const dashConstants = { | ||
| APP_NAME : 'Github Dynamic Quotes for Readme' | ||
| }; | ||
| APP_NAME: "Github Dynamic Quotes for Readme", | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,27 @@ | ||
| import { makeStyles } from '@material-ui/core'; | ||
| import {makeStyles} from "@material-ui/core"; | ||
|
|
||
| export const getAppBarStyles = makeStyles((theme) => ({ | ||
| title: { | ||
| flexGrow: 1, | ||
| }, | ||
| themeIcon: { | ||
| backgroundColor: 'transparent !important', | ||
| height: '38px', | ||
| width: '38px', | ||
| boxShadow: '0px 0px 0.5px 0.5px #6e7681', | ||
| }, | ||
| productHuntBtn: { | ||
| flexGrow: 1, | ||
| title: { | ||
| flexGrow: 1, | ||
| }, | ||
| themeIcon: { | ||
| backgroundColor: "transparent !important", | ||
| height: "38px", | ||
| width: "38px", | ||
| boxShadow: "0px 0px 0.5px 0.5px #6e7681", | ||
| }, | ||
| productHuntBtn: { | ||
| flexGrow: 1, | ||
| }, | ||
| navBar: { | ||
| display: "flex", | ||
| flexWrap: "wrap", | ||
| }, | ||
| linkButtons: { | ||
| display: { | ||
| xs: "none", | ||
| sm: "flex", | ||
| }, | ||
| alignItems: "center", | ||
| }, | ||
| })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a shebang to specify the shell environment.
+ #!/bin/bash npm run buildCommittable suggestion
Tools
Shellcheck