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

fix/1410-suggestion-to-improve-seo #1426

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
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
2 changes: 0 additions & 2 deletions govtool/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/icons/AppLogo.svg" />
<!-- <link rel="preconnect" href="https://fonts.googleapis.com"> -->
<!-- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> -->
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap"
rel="stylesheet"
Expand Down
36,418 changes: 15,953 additions & 20,465 deletions govtool/frontend/package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion govtool/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@
"jsdom": "^23.0.1",
"storybook": "^7.4.5",
"typescript": "^5.0.2",
"vite": "^4.3.9",
"vite": "^5.3.1",
"vite-plugin-static-copy": "^1.0.5",
"vitest": "^1.1.0"
},
"optionalDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Box, Link, SxProps } from "@mui/material";
import { Typography } from "@atoms";
import { useTranslation } from "@hooks";
import { MetadataValidationStatus } from "@models";
import { openInNewTab } from "@utils";

export const DataMissingInfoBox = ({
isDataMissing,
Expand Down Expand Up @@ -78,12 +77,9 @@ export const DataMissingInfoBox = ({
{gaMetadataErrorDescription}
</Typography>
<Link
onClick={() =>
// TODO: Add the correct link
openInNewTab(
"https://docs.sanchogov.tools/how-to-use-the-govtool/getting-started/get-a-compatible-wallet",
)
}
// TODO: Add the correct link
href="https://docs.sanchogov.tools/how-to-use-the-govtool/getting-started/get-a-compatible-wallet"
target="_blank"
sx={{
fontFamily: "Poppins",
fontSize: "16px",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
useTranslation,
} from "@hooks";
import { BgCard, ControlledField } from "@organisms";
import { openInNewTab } from "@utils";

type StoreDataInfoProps = {
setStep: Dispatch<SetStateAction<number>>;
Expand All @@ -20,7 +19,7 @@ export const StoreDataInfo = ({ setStep }: StoreDataInfoProps) => {
const { isMobile } = useScreenDimension();

// TODO: change link when available
const openLink = () => openInNewTab("https://docs.sanchogov.tools");
const link = "https://docs.sanchogov.tools";

const isContinueDisabled = !watch("storeData");

Expand All @@ -40,7 +39,8 @@ export const StoreDataInfo = ({ setStep }: StoreDataInfoProps) => {
</Typography>
<Link
data-testid="storing-information-link"
onClick={openLink}
href={link}
target="_blank"
sx={{
cursor: "pointer",
fontSize: 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
useTranslation,
useEditDRepInfoForm,
} from "@hooks";
import { openInNewTab } from "@utils";

import { BgCard, ControlledField } from "..";

Expand All @@ -27,7 +26,7 @@ export const EditDRepStoreDataInfo = ({
const isContinueDisabled = !watch("storeData");

// TODO: Add link about store data when available
const openLink = () => openInNewTab("https://sancho.network/get-started");
const link = "https://sancho.network/get-started";

return (
<BgCard
Expand All @@ -40,7 +39,8 @@ export const EditDRepStoreDataInfo = ({
{t("editMetadata.storeDataTitle")}
</Typography>
<Link
onClick={openLink}
href={link}
target="_blank"
sx={{
cursor: "pointer",
fontSize: 16,
Expand Down
25 changes: 10 additions & 15 deletions govtool/frontend/src/components/organisms/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ import { openInNewTab, testIdFromLabel } from "@utils";

type FooterLinkProps = {
label: string;
onClick: () => void;
href: string;
};

const FooterLink = ({ label, onClick }: FooterLinkProps) => (
const PRIVACY_POLICY = "https://docs.sanchogov.tools/legal/privacy-policy";
const TERM_OF_SERVICE =
"https://docs.sanchogov.tools/legal/terms-and-conditions";

const FooterLink = ({ label, href }: FooterLinkProps) => (
<Link
data-testid={`${testIdFromLabel(label)}-footer-link`}
onClick={onClick}
href={href}
target="_blank"
sx={{
color: "textBlack",
cursor: "pointer",
Expand All @@ -37,13 +42,6 @@ export const Footer = () => {
const onClickHelp = () =>
openInNewTab("https://docs.sanchogov.tools/support/get-help-in-discord");

const onClickPrivacyPolicy = () =>
openInNewTab("https://docs.sanchogov.tools/legal/privacy-policy");

// TODO: change term of service link
const onClickTermOfService = () =>
openInNewTab("https://docs.sanchogov.tools/legal/terms-and-conditions");

const onClickFeedback = () => openFeedbackWindow();

return (
Expand All @@ -70,13 +68,10 @@ export const Footer = () => {
mt: screenWidth < 640 ? 1.5 : 0,
}}
>
<FooterLink
label={t("footer.privacyPolicy")}
onClick={onClickPrivacyPolicy}
/>
<FooterLink label={t("footer.privacyPolicy")} href={PRIVACY_POLICY} />
<FooterLink
label={t("footer.termOfService")}
onClick={onClickTermOfService}
href={TERM_OF_SERVICE}
/>
</Box>
<Box
Expand Down
9 changes: 4 additions & 5 deletions govtool/frontend/src/components/organisms/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { Button, Typography } from "@atoms";
import { IMAGES, PATHS } from "@consts";
import { useCardano, useModal } from "@context";
import { useScreenDimension, useTranslation } from "@hooks";
import { openInNewTab } from "@utils";

const VOTING_POWER = "https://docs.sanchogov.tools/faqs/what-is-voting-power";

export const Hero = () => {
const { isEnabled } = useCardano();
Expand All @@ -33,9 +34,6 @@ export const Hero = () => {
return screenWidth / 11;
}, [screenWidth]);

const onClickVotingPower = () =>
openInNewTab("https://docs.sanchogov.tools/faqs/what-is-voting-power");

return (
<Box
alignItems="center"
Expand Down Expand Up @@ -69,7 +67,8 @@ export const Hero = () => {
components={[
<Link
data-testid="voting-power-link"
onClick={onClickVotingPower}
href={VOTING_POWER}
target="_blank"
sx={{
cursor: "pointer",
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ModalContents, ModalHeader, ModalWrapper } from "@atoms";
import { useModal } from "@context";
import type { WalletOption } from "@molecules";
import { WalletOptionButton } from "@molecules";
import { openInNewTab } from "@utils";
import { useTranslation } from "@hooks";
import { To } from "react-router-dom";

Expand Down Expand Up @@ -105,11 +104,8 @@ export const ChooseWalletModal = forwardRef<HTMLDivElement>((_, ref) => {
<Link
fontSize={11}
fontWeight={500}
onClick={() =>
openInNewTab(
"https://docs.sanchogov.tools/how-to-use-the-govtool/getting-started/get-a-compatible-wallet",
)
}
href="https://docs.sanchogov.tools/how-to-use-the-govtool/getting-started/get-a-compatible-wallet"
target="_blank"
sx={{ cursor: "pointer" }}
>
{t("here")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Button, Link, Typography } from "@mui/material";
import { ModalContents, ModalHeader, ModalWrapper } from "@atoms";
import { ICONS, IMAGES } from "@consts";
import { useModal, useUsersnapApi } from "@context";
import { openInNewTab } from "@utils";
import { useScreenDimension, useTranslation } from "@hooks";

export interface StatusModalState {
Expand Down Expand Up @@ -70,7 +69,7 @@ export const StatusModal = forwardRef<HTMLDivElement>((_, ref) => {
{state?.message}{" "}
{state?.link && (
<Link
onClick={() => openInNewTab(state?.link || "")}
href={state?.link || ""}
target="_blank"
sx={[{ "&:hover": { cursor: "pointer" } }]}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
useTranslation,
useRegisterAsdRepForm,
} from "@hooks";
import { openInNewTab } from "@utils";

import { BgCard, ControlledField } from "..";

Expand All @@ -27,7 +26,7 @@ export const DRepStoreDataInfo = ({
const onClickContinue = () => setStep(4);

// TODO: Add link about store data when available
const openLink = () => openInNewTab("https://sancho.network/get-started");
const link = "https://sancho.network/get-started";

return (
<BgCard
Expand All @@ -40,7 +39,8 @@ export const DRepStoreDataInfo = ({
{t("registration.storeDataTitle")}
</Typography>
<Link
onClick={openLink}
href={link}
target="_blank"
sx={{
cursor: "pointer",
fontSize: 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import { useScreenDimension, useTranslation } from "@hooks";
import {
correctAdaFormat,
getItemFromLocalStorage,
openInNewTab,
PROTOCOL_PARAMS_KEY,
} from "@utils";

import { BgCard } from "..";

const MORE_ABOUT_DREPS = "https://sancho.network/roles/drep";

export const RolesAndResponsibilities = ({
onClickCancel,
setStep,
Expand All @@ -27,9 +28,6 @@ export const RolesAndResponsibilities = ({

const onClickContinue = () => setStep(2);

const openLearnMoreAboutDrep = () =>
openInNewTab("https://sancho.network/roles/drep");

return (
<BgCard
actionButtonLabel={t("continue")}
Expand All @@ -55,7 +53,8 @@ export const RolesAndResponsibilities = ({
components={[
<Link
key="1"
onClick={openLearnMoreAboutDrep}
href={MORE_ABOUT_DREPS}
target="_blank"
sx={{ cursor: "pointer" }}
/>,
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
PROTOCOL_PARAMS_KEY,
correctAdaFormat,
getItemFromLocalStorage,
openInNewTab,
} from "@utils";

export const RegisterAsDirectVoterBoxContent = () => {
Expand Down Expand Up @@ -36,7 +35,8 @@ export const RegisterAsDirectVoterBoxContent = () => {
values={{ deposit: correctAdaFormat(epochParams.drep_deposit) }}
components={[
<Link
onClick={() => openInNewTab("https://sancho.network/")}
href="https://sancho.network/"
target="_blank"
sx={{ cursor: "pointer" }}
key="0"
/>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Box, Link } from "@mui/material";
import { Spacer, Typography } from "@atoms";
import { useScreenDimension, useTranslation, useVoteContextForm } from "@hooks";
import { ControlledField, VoteContextWrapper } from "@organisms";
import { openInNewTab } from "@utils";

type StoreDataInfoProps = {
setStep: Dispatch<SetStateAction<number>>;
Expand All @@ -17,7 +16,7 @@ export const VoteContextTerms = ({ setStep, onCancel }: StoreDataInfoProps) => {
const { isMobile } = useScreenDimension();

// TODO: change link when available
const openLink = () => openInNewTab("https://docs.sanchogov.tools");
const link = "https://docs.sanchogov.tools";

const isContinueDisabled = !watch("terms");

Expand All @@ -31,7 +30,8 @@ export const VoteContextTerms = ({ setStep, onCancel }: StoreDataInfoProps) => {
{t("createGovernanceAction.storeDataTitle")}
</Typography>
<Link
onClick={openLink}
href={link}
target="_blank"
sx={{
cursor: "pointer",
fontSize: 16,
Expand Down
4 changes: 2 additions & 2 deletions govtool/frontend/src/context/wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ import {
generateAnchor,
getItemFromLocalStorage,
getPubDRepID,
openInNewTab,
PROTOCOL_PARAMS_KEY,
removeItemFromLocalStorage,
SANCHO_INFO_KEY,
Expand Down Expand Up @@ -966,7 +965,8 @@ function useCardano() {
i18nKey="system.testnetDescription"
components={[
<Link
onClick={() => openInNewTab("https://sancho.network/")}
href="https://sancho.network/"
target="_blank"
sx={{ cursor: "pointer" }}
/>,
]}
Expand Down
6 changes: 2 additions & 4 deletions govtool/frontend/src/pages/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { checkIsWalletConnected } from "@utils";
export const Dashboard = () => {
const { isEnabled, stakeKey } = useCardano();
const { isMobile } = useScreenDimension();
const { pathname, hash } = useLocation();
const { pathname } = useLocation();
const divRef = useRef<HTMLDivElement>(null);
const navigate = useNavigate();
const { t } = useTranslation();
Expand All @@ -37,9 +37,7 @@ export const Dashboard = () => {
if (window.location.pathname === PATHS.dashboard) {
navigate(PATHS.home);
} else {
navigate(
window.location.pathname.replace("connected/", "") + hash ?? "",
);
navigate(window.location.pathname.replace("connected/", ""));
}
}
}, [isEnabled, stakeKey]);
Expand Down
4 changes: 2 additions & 2 deletions govtool/frontend/src/pages/RegisterAsDirectVoter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
checkIsWalletConnected,
correctAdaFormat,
getItemFromLocalStorage,
openInNewTab,
} from "@utils";

export const RegisterAsDirectVoter = () => {
Expand Down Expand Up @@ -141,7 +140,8 @@ export const RegisterAsDirectVoter = () => {
values={{ deposit: correctAdaFormat(epochParams.drep_deposit) }}
components={[
<Link
onClick={() => openInNewTab("https://sancho.network/")}
href="https://sancho.network/"
target="_blank"
sx={{ cursor: "pointer" }}
key="0"
/>,
Expand Down
Loading
Loading