Skip to content
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

Update metatags #88

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/images/communityFocus.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Community Focus</title>

</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

51 changes: 51 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 @@ -22,6 +22,7 @@
"react-dom": "^18.2.0",
"react-dropdown": "^1.11.0",
"react-ga4": "^2.1.0",
"react-helmet-async": "^2.0.4",
"react-icons": "^4.10.1",
"react-loading": "^2.0.3",
"react-modal": "^3.16.1",
Expand Down
Binary file added public/images/communityFocus-icon-meta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
217 changes: 114 additions & 103 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ import ModalContext from "./components/Modal/ModalContext";
import UsernameContext from "./components/Username/UsernameContext";
import ValidRoom from "./Pages/Room/ValidRoom";
import DefaultRoom from "./Pages/DefaultRoom/DefaultRoom";
import { tracker } from "../common/common";
import { roomName, tracker } from "../common/common";
import { PublicRoom } from "./Pages/PublicRoom/PublicRoom";
import { HelmetProvider } from "react-helmet-async";
import HelmetTags from "./helmet";


const App = (): JSX.Element => {
const [globalUsersConnected, setGlobalUsersConnected] = useState<number>(0);
Expand Down Expand Up @@ -54,6 +57,8 @@ const App = (): JSX.Element => {
setIsConnected(false);
};

const helmetContext = {}

useEffect(() => {
socket.on("globalUsers", onGlobalUsers);
socket.on("connect", onConnect);
Expand All @@ -73,116 +78,122 @@ const App = (): JSX.Element => {
}, []);

return (
<ThemeProvider theme={{ themeGroup, setThemeGroup }}>
<UsernameContext.Provider
value={useMemo(
() => ({
userName,
setUserName,
}),
[userName, setUserName]
)}
>
<ModalContext.Provider
<HelmetProvider context={helmetContext}>
<ThemeProvider theme={{ themeGroup, setThemeGroup }}>
<UsernameContext.Provider
value={useMemo(
() => ({
isUsernamModalOpen,
setIsUsernameModalOpen,
userName,
setUserName,
}),
[isUsernamModalOpen, setIsUsernameModalOpen]
[userName, setUserName]
)}
>
<Tooltip id="my-tooltip" style={{ zIndex: 99 }} />
<BrowserRouter>
<Routes>
<Route
path="/"
element={
<LandingPage
globalUsersConnected={
globalUsersConnected
}
isBreak={isBreak}
isConnected={isConnected}
/>
}
/>
<HelmetTags
userName={userName}
roomName={roomName}
/>
<ModalContext.Provider
value={useMemo(
() => ({
isUsernamModalOpen,
setIsUsernameModalOpen,
}),
[isUsernamModalOpen, setIsUsernameModalOpen]
)}
>
<Tooltip id="my-tooltip" style={{ zIndex: 99 }} />
<BrowserRouter>
<Routes>
<Route
path="/"
element={
<LandingPage
globalUsersConnected={
globalUsersConnected
}
isBreak={isBreak}
isConnected={isConnected}
/>
}
/>

<Route
path="/contributors"
element={
<ContributorsPage
globalUsersConnected={
globalUsersConnected
}
isBreak={isBreak}
isConnected={isConnected}
/>
}
/>
<Route
path="/contributors"
element={
<ContributorsPage
globalUsersConnected={
globalUsersConnected
}
isBreak={isBreak}
isConnected={isConnected}
/>
}
/>

<Route
path="admin"
element={
<PublicRoom
roomName="admin"
userName={userName}
setIsConnected={setIsConnected}
isBreak={isBreak}
isConnected={isConnected}
globalUsersConnected={
globalUsersConnected
}
/>
}
/>
<Route
path="public-timers"
element={
<PublicRoom
roomName="public-timers"
userName={userName}
setIsConnected={setIsConnected}
isBreak={isBreak}
isConnected={isConnected}
globalUsersConnected={
globalUsersConnected
}
/>
}
/>
<Route
path="admin"
element={
<PublicRoom
roomName="admin"
userName={userName}
setIsConnected={setIsConnected}
isBreak={isBreak}
isConnected={isConnected}
globalUsersConnected={
globalUsersConnected
}
/>
}
/>
<Route
path="public-timers"
element={
<PublicRoom
roomName="public-timers"
userName={userName}
setIsConnected={setIsConnected}
isBreak={isBreak}
isConnected={isConnected}
globalUsersConnected={
globalUsersConnected
}
/>
}
/>

<Route
path="/:room"
element={
<ValidRoom
globalUsersConnected={
globalUsersConnected
}
isBreak={isBreak}
setIsBreak={setIsBreak}
isConnected={isConnected}
setIsConnected={setIsConnected}
/>
}
/>
<Route
path="*"
element={
<DefaultRoom
globalUsersConnected={
globalUsersConnected
}
isBreak={isBreak}
isConnected={isConnected}
/>
}
/>
</Routes>
</BrowserRouter>
</ModalContext.Provider>
</UsernameContext.Provider>
</ThemeProvider>
<Route
path="/:room"
element={
<ValidRoom
globalUsersConnected={
globalUsersConnected
}
isBreak={isBreak}
setIsBreak={setIsBreak}
isConnected={isConnected}
setIsConnected={setIsConnected}
/>
}
/>
<Route
path="*"
element={
<DefaultRoom
globalUsersConnected={
globalUsersConnected
}
isBreak={isBreak}
isConnected={isConnected}
/>
}
/>
</Routes>
</BrowserRouter>
</ModalContext.Provider>
</UsernameContext.Provider>
</ThemeProvider>
</HelmetProvider>
);
};

Expand Down
Loading
Loading