-
-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from atapas/issue-67-like-comment-play
Enabling Comments and Reactions for the Plays
- Loading branch information
Showing
18 changed files
with
912 additions
and
104 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 |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
# misc | ||
.env | ||
.DS_Store | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import Giscus from "@giscus/react"; | ||
|
||
const Comment = () => { | ||
const projectRepoId = process.env.REACT_APP_GISCUS_PROJECT_REPO_ID; | ||
const discussionCategoryId = | ||
process.env.REACT_APP_GISCUS_DISCUSSION_CATEGORY_ID; | ||
const discussionCategoryName = | ||
process.env.REACT_APP_GISCUS_DISCUSSION_CATEGORY_NAME; | ||
|
||
return ( | ||
<> | ||
<Giscus | ||
repo="atapas/react-play" | ||
repoId={projectRepoId} | ||
category={discussionCategoryName} | ||
categoryId={discussionCategoryId} | ||
mapping="pathname" | ||
reactionsEnabled="0" | ||
emitMetadata="1" | ||
inputPosition="top" | ||
theme="light" | ||
lang="en" | ||
loading="lazy" | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
export default Comment; |
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,43 @@ | ||
|
||
import { useState, useEffect } from 'react'; | ||
import { RiMedal2Fill } from "react-icons/ri"; | ||
import { IoMdTrophy } from "react-icons/io"; | ||
import { IoRibbon } from "react-icons/io5"; | ||
|
||
|
||
const LevelBadge = ({ level }) => { | ||
const [playLevel, setPlayLevel] = useState(null); | ||
|
||
useEffect(() => { | ||
switch (level) { | ||
case "Beginner": | ||
setPlayLevel( | ||
<span className="play-level play-level-1"> | ||
<IoRibbon size="16px" /> {level} | ||
</span>); | ||
break; | ||
case "Intermediate": | ||
setPlayLevel( | ||
<span className="play-level play-level-2"> | ||
<RiMedal2Fill size="16px" /> {level} | ||
</span>); | ||
break; | ||
case "Advanced": | ||
setPlayLevel( | ||
<span className="play-level play-level-3"> | ||
<IoMdTrophy size="16px" /> {level} | ||
</span>); | ||
break; | ||
default: | ||
setPlayLevel( | ||
<span className="play-level play-level-1"> | ||
<IoRibbon size="16px" /> {level} | ||
</span>); | ||
} | ||
}, [level]); | ||
return ( | ||
<>{playLevel}</> | ||
); | ||
}; | ||
|
||
export default LevelBadge; |
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 |
---|---|---|
@@ -1,47 +1,69 @@ | ||
import FilterPlays from 'common/search/FilterPlays'; | ||
import SearchPlays from 'common/search/SearchPlays'; | ||
import HeaderNav from './HeaderNav'; | ||
import FilterPlays from "common/search/FilterPlays"; | ||
import SearchPlays from "common/search/SearchPlays"; | ||
import HeaderNav from "./HeaderNav"; | ||
import { useEffect, useState } from "react"; | ||
import { Link, useLocation } from "react-router-dom"; | ||
import './header.css'; | ||
import "./header.css"; | ||
|
||
const Header = () => { | ||
const location = useLocation(); | ||
const pathName = location.pathname; | ||
|
||
const [showSearch, setShowSearch] = useState(false); | ||
const [headerStyle, setHeaderStyle] = useState(false); | ||
const [showBrowse, setShowBrowse] = useState(false); | ||
|
||
const [showHideBits, setShowHideBits] = useState({ | ||
showSearch: true, | ||
showBrowse: false, | ||
setHeaderStyle: true, | ||
}); | ||
|
||
useEffect(() => { | ||
if (pathName === '/') { | ||
setHeaderStyle(false); | ||
setShowSearch(false); | ||
setShowBrowse(true); | ||
if (pathName === "/") { | ||
setShowHideBits({ | ||
...showHideBits, | ||
showSearch: false, | ||
showBrowse: true, | ||
setHeaderStyle: false, | ||
}); | ||
} else if (pathName === "/ideas") { | ||
setShowHideBits({ | ||
...showHideBits, | ||
showSearch: false, | ||
showBrowse: true, | ||
setHeaderStyle: true, | ||
}); | ||
} else { | ||
setHeaderStyle(true); | ||
setShowSearch(true); | ||
setShowBrowse(false); | ||
setShowHideBits({ | ||
...showHideBits, | ||
showSearch: true, | ||
showBrowse: false, | ||
setHeaderStyle: true, | ||
}); | ||
} | ||
}, [pathName]); | ||
|
||
return ( | ||
<header className={headerStyle ? "app-header" : "app-header app-header-home"}> | ||
<span><Link to="/" className="app-logo"><span className="sr-only">React Play</span></Link></span> | ||
<div className="app-header-search"> | ||
{ | ||
showSearch && ( | ||
<> | ||
<SearchPlays /> | ||
<FilterPlays /> | ||
</> | ||
) | ||
} | ||
</div> | ||
<HeaderNav showBrowse={showBrowse}/> | ||
<header | ||
className={ | ||
showHideBits.setHeaderStyle | ||
? "app-header" | ||
: "app-header app-header-home" | ||
} | ||
> | ||
<span> | ||
<Link to="/" className="app-logo"> | ||
<span className="sr-only">React Play</span> | ||
</Link> | ||
</span> | ||
<div className="app-header-search"> | ||
{showHideBits.showSearch && ( | ||
<> | ||
<SearchPlays /> | ||
<FilterPlays /> | ||
</> | ||
)} | ||
</div> | ||
<HeaderNav showBrowse={showHideBits.showBrowse} /> | ||
</header> | ||
); | ||
}; | ||
|
||
|
||
export default Header; | ||
export default Header; |
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
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.
32868cb
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.
Successfully deployed to the following URLs:
react-play – ./
reactoplay.vercel.app
reactplay.io
react-play-atapas.vercel.app
react-play-git-main-atapas.vercel.app
www.reactplay.io