Skip to content

Commit

Permalink
Merge pull request #48 from gamer-ai/use appbar to replace footer #48
Browse files Browse the repository at this point in the history
use appbar to replace footer
  • Loading branch information
MUYANGGUO authored Mar 6, 2024
2 parents 8019ec2 + 302ae34 commit 6232083
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 44 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,21 @@ Regular Mode and Recite Mode
<img width="800" alt="Screen Shot 2022-08-23 at 12 52 17 AM" src="https://user-images.githubusercontent.com/39578778/186102830-4c664e9a-adfa-48dc-ba8c-e03df4e22ade.png">


## For Devs

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.


### `npm run build`


Builds the app for production to the `build` folder.\

### Pull Requests

Create a branch with proper name example 'feat/your-cool-feature', create the pull request and add authors for reviews. Please include description with details.


## Sponsors

Expand Down
36 changes: 36 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"react-dom": "^18.0.0",
"react-scripts": "5.0.1",
"react-select": "^5.3.0",
"react-toastify": "^10.0.4",
"styled-components": "^5.3.5",
"use-sound": "^4.0.1",
"web-vitals": "^2.1.4"
Expand Down
65 changes: 33 additions & 32 deletions src/components/common/FooterMenu.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from "react";
import { Grid } from "@mui/material";
import { Grid, AppBar } from "@mui/material";
import { Box } from "@mui/system";
import { Tooltip } from "@mui/material";
import IconButton from "@mui/material/IconButton";
import SelfImprovementIcon from "@mui/icons-material/SelfImprovement";
import VolumeUpIcon from '@mui/icons-material/VolumeUp';
import VolumeUpIcon from "@mui/icons-material/VolumeUp";
import Select from "../utils/Select";
import {
FOCUS_MODE,
Expand All @@ -15,7 +15,7 @@ import {
GAME_MODE_DEFAULT,
GAME_MODE_SENTENCE,
TRAINER_MODE,
WORDS_CARD_MODE
WORDS_CARD_MODE,
} from "../../constants/Constants";
import { Link } from "@mui/material";
import SupportMe from "../features/SupportMe";
Expand All @@ -30,8 +30,8 @@ import MusicNoteIcon from "@mui/icons-material/MusicNote";
import EmojiFoodBeverageIcon from "@mui/icons-material/EmojiFoodBeverage";
import { ReactComponent as DiscordIcon } from "../../assets/Icons/discord.svg";
import { SvgIcon } from "@mui/material";
import KeyboardAltOutlinedIcon from '@mui/icons-material/KeyboardAltOutlined';
import SchoolIcon from '@mui/icons-material/School';
import KeyboardAltOutlinedIcon from "@mui/icons-material/KeyboardAltOutlined";
import SchoolIcon from "@mui/icons-material/School";
import { SOUND_MODE_TOOLTIP } from "../features/sound/sound";

const FooterMenu = ({
Expand All @@ -54,7 +54,7 @@ const FooterMenu = ({
isTrainerMode,
toggleTrainerMode,
isWordsCardMode,
toggleWordsCardMode
toggleWordsCardMode,
}) => {
const isSiteInfoDisabled = isMusicMode || isFocusedMode;
const isBottomLogoEnabled = isFocusedMode && !isMusicMode;
Expand All @@ -75,7 +75,7 @@ const FooterMenu = ({
};

return (
<div className="footer">
<AppBar position="static" color="transparent">
<Grid container justifyContent="space-between" alignItems="center">
<Box display="flex" flexDirection="row">
<Select
Expand All @@ -102,19 +102,23 @@ const FooterMenu = ({
</span>
</Tooltip>
</IconButton>
{soundMode && (<Select
classNamePrefix="Select"
value={soundOptions.find((e) => e.label === soundType)}
options={soundOptions}
isSearchable={false}
isSelected={false}
onChange={handleSoundTypeChange}
menuPlacement="top"
></Select>)}
{soundMode && (
<Select
classNamePrefix="Select"
value={soundOptions.find((e) => e.label === soundType)}
options={soundOptions}
isSearchable={false}
isSelected={false}
onChange={handleSoundTypeChange}
menuPlacement="top"
></Select>
)}
<IconButton onClick={toggleWordsCardMode}>
<Tooltip
title={
<span style={{ whiteSpace: "pre-line" }}>{WORDS_CARD_MODE}</span>
<span style={{ whiteSpace: "pre-line" }}>
{WORDS_CARD_MODE}
</span>
}
>
<span className={getModeButtonClassName(isWordsCardMode)}>
Expand Down Expand Up @@ -185,20 +189,17 @@ const FooterMenu = ({
<SupportMe></SupportMe>
<Tooltip
title={
<span style={{ whiteSpace: "pre-line", fontSize:"12px" }}>
<span style={{ whiteSpace: "pre-line", fontSize: "12px" }}>
{GITHUB_TOOLTIP_TITLE}
<Link
margin="inherit"
href="https://muyangguo.xyz"
>
{AUTHOR}
</Link>
<Link
margin="inherit"
href="https://github.com/gamer-ai/eletype-frontend/"
>
{GITHUB_REPO_LINK}
</Link>
<Link margin="inherit" href="https://muyangguo.xyz">
{AUTHOR}
</Link>
<Link
margin="inherit"
href="https://github.com/gamer-ai/eletype-frontend/"
>
{GITHUB_REPO_LINK}
</Link>
</span>
}
placement="top-start"
Expand All @@ -214,7 +215,7 @@ const FooterMenu = ({
title={
<span style={{ whiteSpace: "pre-line" }}>
<iframe
title="discord-widget"
title="discord-widget"
src="https://discord.com/widget?id=993567075589181621&theme=dark"
width="100%"
height="300"
Expand Down Expand Up @@ -247,7 +248,7 @@ const FooterMenu = ({
</Box>
)}
</Grid>
</div>
</AppBar>
);
};

Expand Down
3 changes: 2 additions & 1 deletion src/components/common/Logo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from "react";
import KeyboardAltIcon from "@mui/icons-material/KeyboardAlt";

const Logo = ({ isFocusedMode, isMusicMode }) => {
const Logo = ({ isFocusedMode }) => {

return (
<div className="header" style={{visibility: isFocusedMode ? 'hidden' : 'visible' }}>
<h1>
Expand Down
2 changes: 1 addition & 1 deletion src/components/features/SupportMe.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const SupportMe = () => {
<Tooltip
title={
<div>
<span style={{ whiteSpace: "pre-line", fontSize:"12px"}}>
<span style={{ whiteSpace: "pre-line", fontSize: "12px" }}>
{SUPPORT_TOOLTIP_TITLE}
</span>
<img
Expand Down
2 changes: 1 addition & 1 deletion src/components/utils/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default styled(Select)`
border-radius: 4px;
cursor: pointer;
color: ${({ theme }) => theme.text};
background: ${({ theme }) => theme.background}
background: transparent;
}
.Select__single-value {
font-size: 12px;
Expand Down
7 changes: 0 additions & 7 deletions src/style/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ export const GlobalStyles = createGlobalStyle`
width: 100%;
text-align: center;
}
.footer {
font-size: .75rem;
line-height: 1rem;
padding: 0;
position: relative;
text-align: center;
}
.bottom-info {
color: ${({ theme }) => theme.title};
margin: 4px;
Expand Down

0 comments on commit 6232083

Please sign in to comment.