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

Link to GitHub #274

Merged
merged 6 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
9 changes: 9 additions & 0 deletions src/data/AppVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,12 @@ export async function downloadLatestRelease() {
const latestRelease = await getLatestReleaseInfo();
window.open(latestRelease.htmlUrl, "_system", "location=yes");
}

const homepageURL = "https://github.com/IraSoro/peri";
export function openGitHubPage() {
if (isPlatform("desktop")) {
window.open(homepageURL, "_blank")?.focus();
return;
}
window.open(homepageURL, "_system", "location=yes");
}
53 changes: 38 additions & 15 deletions src/modals/Menu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useContext, useEffect, useState } from "react";
import {
IonChip,
IonIcon,
IonItem,
IonLabel,
Expand All @@ -16,6 +17,7 @@ import {
cloudUploadOutline,
globeOutline,
colorFillOutline,
logoGithub,
} from "ionicons/icons";
import { useTranslation } from "react-i18next";
import { storage } from "../data/Storage";
Expand All @@ -24,6 +26,7 @@ import { exportConfig, importConfig } from "../data/Config";
import {
downloadLatestRelease,
isNewVersionAvailable,
openGitHubPage,
} from "../data/AppVersion";
import { CyclesContext, ThemeContext } from "../state/Context";
import {
Expand Down Expand Up @@ -267,24 +270,44 @@ export const Menu = (props: MenuProps) => {
</IonItem>
)}
</IonList>
<IonItem
color="none"
lines="none"
<IonList
style={{
display: "flex",
flexDirection: "column",
alignItems: "center",
}}
>
<IonLabel
style={{ fontSize: "13px" }}
color="medium"
<IonChip
outline
color={`text-${theme}`}
onClick={() => openGitHubPage()}
>
Peri - The Period Tracker App
</IonLabel>
<IonLabel
style={{ fontSize: "13px" }}
color="medium"
slot="end"
<IonIcon
icon={logoGithub}
color={`text-${theme}`}
/>
<IonLabel>{t("We are on GitHub")}</IonLabel>
</IonChip>
<IonItem
color="none"
lines="none"
style={{ width: "100%" }}
>
{configuration.app.version}
</IonLabel>
</IonItem>
<IonLabel
style={{ fontSize: "13px" }}
color="medium"
>
Peri - The Period Tracker App
</IonLabel>
<IonLabel
style={{ fontSize: "13px" }}
color="medium"
slot="end"
>
{configuration.app.version}
</IonLabel>
</IonItem>
</IonList>
</IonMenu>
);
};
1 change: 1 addition & 0 deletions src/utils/translations/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const es = {
"This is just a demo": "Esto es solo una demostración",
"You can download the application ": "Puedes descargar la aplicación ",
here: "Aquí",
"We are on GitHub": "Estamos en GitHub",
};

export default es;
1 change: 1 addition & 0 deletions src/utils/translations/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const ru = {
"This is just a demo": "Это только demo",
"You can download the application ": "Загрузить приложение можно ",
here: "тут",
"We are on GitHub": "Мы в GitHub",
};

export default ru;
Loading