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

refactor simple react jsx to typescript #1066

Merged
merged 13 commits into from
May 27, 2024
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2015 Ben Ockmore
* 2015 Sean Burke
* 2024 Meziyum
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -22,7 +23,11 @@ import React from 'react';
import {faCircleNotch} from '@fortawesome/free-solid-svg-icons';


function LoadingSpinner() {
/**
* Renders a LoadingSpinner Component displaying a spinning loading icon.
* @returns {JSX.Element} The JSX content of the LoadingSpinner indicator
*/
function LoadingSpinner(): JSX.Element {
return (
<div className="loading-background">
<FontAwesomeIcon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import {faXTwitter} from '@fortawesome/free-brands-svg-icons';

/**
* Renders the document and displays the 'About' page.
* @returns {ReactElement} a HTML document which displays the About
* @returns {JSX.Element} a React JSX Element
* page
*/
function AboutPage() {
function AboutPage(): JSX.Element {
const NESLink =
'https://ocharles.org.uk/blog/posts/' +
'2012-07-10-nes-does-it-better-1.html';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ import React from 'react';

/**
* Renders the the document and displays the 'Contribute' page.
* @returns {ReactElement} a HTML document which displays the
* Contribute page
* @returns {JSX.Element} a React JSX Element
*/
function ContributePage() {
function ContributePage(): JSX.Element {
const IRCLink = 'https://kiwiirc.com/nextclient/irc.libera.chat/?#bookbrainz';
const styleLink = 'https://bookbrainz-user-guide.readthedocs.io/';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import React from 'react';

/**
* Renders the document and displays the 'Develop' page.
* @returns {ReactElement} a HTML document to display the Develop page
* @returns {JSX.Element} a React JSX Element
*/
function DevelopPage() {
function DevelopPage(): JSX.Element {
return (
<div>
<div className="page-header">
Expand Down
7 changes: 5 additions & 2 deletions src/client/components/pages/faq.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ import {Card, ListGroup} from 'react-bootstrap';
import React from 'react';
import {genEntityIconHTMLElement} from '../../helpers/entity';


function FAQPage() {
/**
* Renders the page for the Frequently Asked Questions on Bookbrainz
* @returns {JSX.Element} a React JSX Element
*/
function FAQPage(): JSX.Element {
return (
<Card>
<Card.Header as="h2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import {genEntityIconHTMLElement} from '../../helpers/entity';

/**
* Renders the document and displays the 'Help' page.
* @returns {ReactElement} a HTML document to display the Develop page
* @returns {JSX.Element} a React JSX Element
*/
function HelpPage() {
function HelpPage(): JSX.Element {
const IRCLink = 'https://kiwiirc.com/nextclient/irc.libera.chat/?#bookbrainz';
const userGuideLink =
'https://bookbrainz-user-guide.readthedocs.io/';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ import React from 'react';

const {Col, Row} = bootstrap;

function LicensingPage() {
/**
* Renders a page containing information about the licensing and copyrights for the content available on the Bookbrainz.
* @returns {JSX.Element} a React JSX Component
*/
function LicensingPage(): JSX.Element {
const CC0Link = 'http://creativecommons.org/publicdomain/zero/1.0/';
const CC0Image = 'http://i.creativecommons.org/p/zero/1.0/88x31.png';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import React from 'react';
* Renders a page containing a link to the current MusicBrainz privacy
* policy, which will form the basis of a future privacy policy
* for BookBrainz.
* @returns {ReactElement} an element containing the rendered output
* @returns {JSX.Element} an element containing the rendered output
*/
function PrivacyPage() {
function PrivacyPage(): JSX.Element {
return (
<div>
<div className="page-header">
Expand Down
Loading