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 6 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
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
<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>
<!-- <meta name="description" content="Create a shareable timer for you and your friends!">
<meta name="image" content="https://raw.githubusercontent.com/CommunityFocus/cf-frontend/main/public/images/communityFocus-icon-meta.png"> -->

</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.
15 changes: 14 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
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';

Check failure

Code scanning / ESLint

Enforce a convention in module import order. Error

react-helmet-async import should occur before import of ./components/Socket/socket

Check failure

Code scanning / ESLint

Replace 'react-helmet-async' with "react-helmet-async" Error

Replace 'react-helmet-async' with "react-helmet-async"
import HelmetTags from "./helmet";


const App = (): JSX.Element => {

const [globalUsersConnected, setGlobalUsersConnected] = useState<number>(0);
const [isConnected, setIsConnected] = useState<boolean>(false);
const [isBreak, setIsBreak] = useState<boolean>(false);
Expand Down Expand Up @@ -73,7 +77,15 @@
}, []);

return (
<HelmetProvider>

<ThemeProvider theme={{ themeGroup, setThemeGroup }}>

Check failure

Code scanning / ESLint

Delete ⏎↹ Error

Delete ⏎↹

<HelmetTags

Check failure

Code scanning / ESLint

Replace ⏎↹↹↹↹<HelmetTags· with ↹<HelmetTags Error

Replace ⏎↹↹↹↹<HelmetTags· with ↹<HelmetTags
title={userName}

Check failure

Code scanning / ESLint

Replace ↹↹↹title={userName}· with ↹↹↹↹↹title={userName} Error

Replace ↹↹↹title={userName}· with ↹↹↹↹↹title={userName}
description={roomName}

Check failure

Code scanning / ESLint

Replace ↹↹↹description={roomName}· with ↹↹↹↹↹description={roomName} Error

Replace ↹↹↹description={roomName}· with ↹↹↹↹↹description={roomName}
imageCard="https://raw.githubusercontent.com/CommunityFocus/cf-frontend/main/public/images/communityFocus-icon-meta.png"

Check failure

Code scanning / ESLint

Insert ↹↹ Error

Insert ↹↹
/>

Check failure

Code scanning / ESLint

Replace />· with ↹/> Error

Replace />· with ↹/>
<UsernameContext.Provider
value={useMemo(
() => ({
Expand Down Expand Up @@ -183,6 +195,7 @@
</ModalContext.Provider>
</UsernameContext.Provider>
</ThemeProvider>
</HelmetProvider>
);
};

Expand Down
44 changes: 44 additions & 0 deletions src/helmet.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Helmet } from "react-helmet-async";
// import { roomName } from '../common/common';
// import image from "./public/images/communityFocus-icon-meta.png"

const HelmetTags = (props: {

Check failure

Code scanning / ESLint

Delete · Error

Delete ·
title: string,

Check failure

Code scanning / ESLint

Replace ····title:·string, with ↹title:·string; Error

Replace ····title:·string, with ↹title:·string;
description: string,

Check failure

Code scanning / ESLint

Replace ····description:·string, with ↹description:·string; Error

Replace ····description:·string, with ↹description:·string;
imageCard: string

Check failure

Code scanning / ESLint

Replace ····imageCard:·string with ↹imageCard:·string; Error

Replace ····imageCard:·string with ↹imageCard:·string;
}): JSX.Element => {

const {
title,
description,
imageCard,
} = props;

Check failure

Code scanning / ESLint

Replace ⏎····const·{·⏎············title,⏎············description,⏎············imageCard,·⏎······· with ↹const·{·title,·description,·imageCard Error

Replace ⏎····const·{·⏎············title,⏎············description,⏎············imageCard,·⏎······· with ↹const·{·title,·description,·imageCard

let joinTitle = `Join ${title}'s Timer!`

Check failure

Code scanning / ESLint

Replace ····let·joinTitle·=·Join·${title}'s·Timer!`` with ↹let·joinTitle·=·Join·${title}'s·Timer!`;` Error

Replace ····let·joinTitle·=·Join·${title}'s·Timer!`` with ↹let·joinTitle·=·Join·${title}'s·Timer!`;`

Check failure

Code scanning / ESLint

require `const` declarations for variables that are never reassigned after declared Error

'joinTitle' is never reassigned. Use 'const' instead.

return (

Check failure

Code scanning / ESLint

Replace ···· with ↹ Error

Replace ···· with ↹
<>

Check failure

Code scanning / ESLint

Replace ········ with ↹↹ Error

Replace ········ with ↹↹
<Helmet >

Check failure

Code scanning / ESLint

Replace ········<Helmet· with ↹↹↹<Helmet Error

Replace ········<Helmet· with ↹↹↹<Helmet
<meta name='description' content={description} />

Check failure

Code scanning / ESLint

Replace ················<meta·name='description' with ↹↹↹↹<meta·name="description" Error

Replace ················<meta·name='description' with ↹↹↹↹<meta·name="description"
<meta name="title" content={title} />

Check failure

Code scanning / ESLint

Replace ················ with ↹↹↹↹ Error

Replace ················ with ↹↹↹↹
/* OG Tags */

Check failure

Code scanning / ESLint

Replace ········ with ↹↹↹↹ Error

Replace ········ with ↹↹↹↹
<meta property="og:type" content="website" />

Check failure

Code scanning / ESLint

Disallow comments from being inserted as text nodes Error

Comments inside children section of tag should be placed inside braces

Check failure

Code scanning / ESLint

Replace ················ with ↹↹↹↹ Error

Replace ················ with ↹↹↹↹
<meta property="og:url" content= "https://communityfocus.app" />

Check failure

Code scanning / ESLint

Replace ················<meta·property="og:url"·content=· with ↹↹↹↹<meta·property="og:url"·content= Error

Replace ················<meta·property="og:url"·content=· with ↹↹↹↹<meta·property="og:url"·content=
<meta property="og:title" content={joinTitle} />

Check failure

Code scanning / ESLint

Replace ················ with ↹↹↹↹ Error

Replace ················ with ↹↹↹↹
<meta property="og:description" content={description} />

Check failure

Code scanning / ESLint

Replace ················ with ↹↹↹↹ Error

Replace ················ with ↹↹↹↹
<meta property="og:image" content={imageCard} />

Check failure

Code scanning / ESLint

Replace ················ with ↹↹↹↹ Error

Replace ················ with ↹↹↹↹

<meta property="og:image:width" content="38" />

Check failure

Code scanning / ESLint

Replace ············⏎················ with ↹↹↹↹ Error

Replace ············⏎················ with ↹↹↹↹
<meta property="og:image:height" content="40" />

Check failure

Code scanning / ESLint

Replace ················ with ↹↹↹↹ Error

Replace ················ with ↹↹↹↹

/* Twitter Card Meta Tags */

Check failure

Code scanning / ESLint

Replace ············⏎················ with ↹↹↹↹ Error

Replace ············⏎················ with ↹↹↹↹
<meta property="twitter:card" content="summary_large_image" />

Check failure

Code scanning / ESLint

Disallow comments from being inserted as text nodes Error

Comments inside children section of tag should be placed inside braces

Check failure

Code scanning / ESLint

Replace ················ with ↹↹↹↹ Error

Replace ················ with ↹↹↹↹
<meta property="twitter:url" content="https://communityfocus.app/"/>

Check failure

Code scanning / ESLint

Replace ················<meta·property="twitter:url"·content="https://communityfocus.app/" with ↹↹↹↹<meta⏎↹↹↹↹↹property="twitter:url"⏎↹↹↹↹↹content="https://communityfocus.app/"⏎↹↹↹↹ Error

Replace ················<meta·property="twitter:url"·content="https://communityfocus.app/" with ↹↹↹↹<meta⏎↹↹↹↹↹property="twitter:url"⏎↹↹↹↹↹content="https://communityfocus.app/"⏎↹↹↹↹
<meta property="twitter:title" content={joinTitle} />

Check failure

Code scanning / ESLint

Replace ················ with ↹↹↹↹ Error

Replace ················ with ↹↹↹↹
<meta property="twitter:description" content={description} />

Check failure

Code scanning / ESLint

Replace ················ with ↹↹↹↹ Error

Replace ················ with ↹↹↹↹
<meta property="twitter:image" content={imageCard}/>

Check failure

Code scanning / ESLint

Replace ········<meta·property="twitter:image"·content={imageCard} with ↹↹<meta·property="twitter:image"·content={imageCard}· Error

Replace ········<meta·property="twitter:image"·content={imageCard} with ↹↹<meta·property="twitter:image"·content={imageCard}·
</Helmet>

Check failure

Code scanning / ESLint

Replace ············ with ↹↹↹ Error

Replace ············ with ↹↹↹
</>

Check failure

Code scanning / ESLint

Disallow unnecessary fragments Error

Fragments should contain more than one child - otherwise, there’s no need for a Fragment at all.

Check failure

Code scanning / ESLint

Replace ········· with ↹↹ Error

Replace ········· with ↹↹
);

Check failure

Code scanning / ESLint

Replace ···· with ↹ Error

Replace ···· with ↹
};
export default HelmetTags;

Check failure

Code scanning / ESLint

Insert ⏎ Error

Insert ⏎
Loading