Skip to content

Commit

Permalink
refactor: remove commented code and unused consts
Browse files Browse the repository at this point in the history
  • Loading branch information
bfabio committed Jan 30, 2024
1 parent 1178bc3 commit 117ade6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 52 deletions.
39 changes: 0 additions & 39 deletions src/app/components/Head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,9 @@ import {
import { useTranslation } from "react-i18next";
import { Icon } from "design-react-kit";

// let timer = null;
// let lastGen = null;

export const Head = (): JSX.Element => {
// const [info, setInfo] = useState(null);
const { t } = useTranslation();

// const updateGen = (lastGen) => {
// let info = null;
// if (lastGen) {
// info = moment(lastGen).locale(DEFAULT_LANGUAGE).fromNow();
// timer = setTimeout(
// function() {
// updateGen(lastGen);
// }.bind(this),
// 30000
// );
// }
// setInfo(info);
// };

// useEffect(() => {
// if (props.lastGen != lastGen) {
// if (timer) {
// clearTimeout(timer);
// }
// updateGen(props.lastGen);

// return () => {
// //unmount
// if (timer) {
// clearTimeout(timer);
// }
// };
// }
// }, [props.lastGen]);

return (
<div className="content__head">
<div className="content__head__title">{t("editor.title")}</div>
Expand All @@ -61,11 +27,6 @@ export const Head = (): JSX.Element => {
<Icon icon="it-github" />
{t("editor.source_code")}
</a>
{/* {info && (
<span className="content__head__status">
{t("editor.lastgeneration")}: {info}
</span>
)} */}
</div>
</div>
</div>
Expand Down
4 changes: 0 additions & 4 deletions src/app/contents/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ export const {
} = process.env;

export const documentationUrl = `https://yml.publiccode.tools`;
export const versionsUrl = `https://api.github.com/repos/${REPOSITORY}/contents/version`;
export const SAMPLE_YAML_URL = `https://raw.githubusercontent.com/italia/publiccode-editor/master/publiccode.yml`;
export const elasticUrl = ELASTIC_URL || "";
export const validatorUrl = VALIDATOR_URL || "";
export const validatorRemoteUrl = VALIDATOR_REMOTE_URL || "";
export const APP_FORM = "appForm";
export const defaultCountry = DEFAULT_COUNTRY || "it";
export const AUTOSAVE_TIMEOUT = 15000;
export const NOTIFICATION_TIMEOUT = 3000;
Expand Down
9 changes: 0 additions & 9 deletions src/app/utils/calls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ export const getDefaultBranch = async (urlString: string) => {
}
};

/*
export const getReleases = (versionsUrl) => {
return fetch(versionsUrl)
.then((res) => res.json())
.then((data) => data.filter((d) => d.type == "dir"))
.then((data) => data.map((d) => d.name));
};
*/

export const getRemotePubliccode = async (yamlURL: string) => {
const myInit = {
method: "GET",
Expand Down

0 comments on commit 117ade6

Please sign in to comment.